Database Management System (DBMS) MCQs

Computer

Database Management System (DBMS) MCQs

Practice DBMS MCQs covering database, data, information, DBMS, RDBMS and SQL basics with answers and explanations.

278
Total Questions

Practice Questions

Page 8 of 14
Question #141
Which of the following is a type of database backup?
A. Incremental backup
B. Differential backup
C. All of the above
D. Full backup

Correct Answer: Option C


Explanation:
Full, incremental, and differential backups are common backup strategies.

This question belongs to: Computer Database Management System (DBMS)
Question #142
What is a query optimizer in a DBMS?
A. A backup utility
B. A user interface
C. A tool for indexing
D. A component that determines the most efficient way to execute a query

Correct Answer: Option D


Explanation:
The query optimizer analyzes SQL queries and selects the most efficient execution plan based on statistics and indexes.

This question belongs to: Computer Database Management System (DBMS)
Question #143
Which of the following is a valid SQL command to delete a database?
A. REMOVE DATABASE
B. TRUNCATE DATABASE
C. DELETE DATABASE
D. DROP DATABASE

Correct Answer: Option D


Explanation:
DROP DATABASE is the SQL command to delete an entire database.

This question belongs to: Computer Database Management System (DBMS)
Question #144
What is the purpose of the SQL 'CONSTRAINT' keyword?
A. To create views
B. To join tables
C. To define rules for data integrity
D. To create indexes

Correct Answer: Option C


Explanation:
Constraints are used to enforce rules on data, such as NOT NULL, UNIQUE, PRIMARY KEY, FOREIGN KEY, and CHECK.

This question belongs to: Computer Database Management System (DBMS)
Question #145
Which of the following is a non-aggregate function in SQL?
A. COUNT()
B. SUM()
C. AVG()
D. LENGTH()

Correct Answer: Option D


Explanation:
LENGTH() (or LEN()) is a string function that returns the length of a string, not an aggregate. SUM, COUNT, AVG are aggregates.

This question belongs to: Computer Database Management System (DBMS)
Question #146
What is the role of a database administrator (DBA)?
A. To develop applications
B. To manage and maintain the database system
C. To write queries
D. To design the user interface

Correct Answer: Option B


Explanation:
A DBA is responsible for the overall administration, maintenance, performance, security, and backup of the database system.

This question belongs to: Computer Database Management System (DBMS)
Question #147
In SQL, which clause is used to specify the table(s) from which to retrieve data?
A. SELECT
B. WHERE
C. GROUP BY
D. FROM

Correct Answer: Option D


Explanation:
The FROM clause identifies the table(s) from which data is to be selected.

This question belongs to: Computer Database Management System (DBMS)
Question #148
What is a pivot table in a database context?
A. A stored procedure
B. A type of index
C. A view
D. A technique to rotate rows into columns for data summarization

Correct Answer: Option D


Explanation:
Pivoting transforms data by turning unique values from one column into multiple columns, often for reporting.

This question belongs to: Computer Database Management System (DBMS)
Question #149
Which of the following is a characteristic of the relational model?
A. Data is accessed via SQL
B. Data is stored in tables
C. All of the above
D. Relationships are represented through keys

Correct Answer: Option C


Explanation:
The relational model organizes data in tables, uses keys for relationships, and is queried using a language like SQL.

This question belongs to: Computer Database Management System (DBMS)
Question #150
What is the purpose of the SQL 'ORDER BY' clause?
A. To join tables
B. To sort the result set
C. To filter rows
D. To group rows

Correct Answer: Option B


Explanation:
ORDER BY sorts the query results in ascending or descending order based on specified columns.

This question belongs to: Computer Database Management System (DBMS)
Question #151
Which of the following is a valid SQL statement to update a record?
A. MODIFY table_name SET column1 = value1 WHERE condition;
B. CHANGE table_name SET column1 = value1 WHERE condition;
C. UPDATE table_name column1 = value1 WHERE condition;
D. UPDATE table_name SET column1 = value1 WHERE condition;

Correct Answer: Option D


Explanation:
The correct syntax for UPDATE is: UPDATE table_name SET column1 = value1 WHERE condition;

This question belongs to: Computer Database Management System (DBMS)
Question #152
What is the difference between a clustered and a non-clustered index?
A. Non-clustered determines physical order; clustered is logical
B. Clustered index determines physical order; non-clustered is a logical order
C. They both determine physical order
D. There is no difference

Correct Answer: Option B


Explanation:
A clustered index sorts the data rows and stores them in that order; a non-clustered index is a separate structure with pointers to data rows.

This question belongs to: Computer Database Management System (DBMS)
Question #153
What is the main advantage of using a DBMS?
A. Data integrity and security
B. Data sharing and concurrency control
C. All of the above
D. Reduced application development time

Correct Answer: Option C


Explanation:
DBMS provides numerous benefits including data sharing, concurrency control, integrity, security, and reduces development time.

This question belongs to: Computer Database Management System (DBMS)
Question #154
Which of the following is a valid SQL constraint that ensures a column's values are all distinct?
A. DISTINCT
B. PRIMARY KEY
C. UNIQUE
D. Both A and B

Correct Answer: Option D


Explanation:
Both UNIQUE and PRIMARY KEY enforce uniqueness. PRIMARY KEY also implies NOT NULL.

This question belongs to: Computer Database Management System (DBMS)
Question #155
What is a database lock?
A. A user account
B. A mechanism to prevent simultaneous access to the same data causing inconsistency
C. A type of index
D. A backup file

Correct Answer: Option B


Explanation:
Locking is a concurrency control mechanism that ensures data integrity during simultaneous transactions.

This question belongs to: Computer Database Management System (DBMS)
Question #156
Which of the following is a type of lock in a database?
A. None
B. Exclusive lock
C. Both A and B
D. Shared lock

Correct Answer: Option C


Explanation:
Shared locks allow multiple transactions to read a resource, while exclusive locks allow only one transaction to write.

This question belongs to: Computer Database Management System (DBMS)
Question #157
What is a deadlock in a database?
A. A type of backup
B. A situation where two or more transactions are waiting indefinitely for each other to release locks
C. A query error
D. A system crash

Correct Answer: Option B


Explanation:
Deadlock occurs when each transaction holds a lock that the other needs, resulting in a circular .

This question belongs to: Computer Database Management System (DBMS)
Question #158
Which of the following is a method to avoid deadlock?
A. Using a timeout
B. Deadlock detection and resolution
C. Lock ordering
D. All of the above

Correct Answer: Option D


Explanation:
Strategies to handle deadlocks include timeout, lock ordering, and detection with rollback.

This question belongs to: Computer Database Management System (DBMS)
Question #159
What is the purpose of the SQL 'WITH' clause (Common Table Expression)?
A. To create a view
B. To delete data
C. To define a temporary result set that can be referenced within a query
D. To update data

Correct Answer: Option C


Explanation:
A Common Table Expression (CTE) provides a temporary named result set that can be used within a SELECT, INSERT, UPDATE, or DELETE statement.

This question belongs to: Computer Database Management System (DBMS)
Question #160
Which of the following is a valid SQL data type for storing large binary data?
A. CHAR
B. TEXT
C. BLOB
D. VARCHAR

Correct Answer: Option C


Explanation:
BLOB (Binary Large Object) is used for storing large binary data, such as images or files.

This question belongs to: Computer Database Management System (DBMS)