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. All of the above
B. Differential backup
C. Full backup
D. Incremental backup

Correct Answer: Option A


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 user interface
B. A tool for indexing
C. A backup utility
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. DELETE DATABASE
C. DROP DATABASE
D. TRUNCATE DATABASE

Correct Answer: Option C


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 create indexes
C. To define rules for data integrity
D. To join tables

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. AVG()
B. SUM()
C. COUNT()
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 manage and maintain the database system
B. To design the user interface
C. To develop applications
D. To write queries

Correct Answer: Option A


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. FROM
B. SELECT
C. WHERE
D. GROUP BY

Correct Answer: Option A


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 technique to rotate rows into columns for data summarization
B. A view
C. A type of index
D. A stored procedure

Correct Answer: Option A


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. All of the above
B. Relationships are represented through keys
C. Data is stored in tables
D. Data is accessed via SQL

Correct Answer: Option A


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 filter rows
B. To group rows
C. To join tables
D. To sort the result set

Correct Answer: Option D


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. UPDATE table_name column1 = value1 WHERE condition;
B. UPDATE table_name SET column1 = value1 WHERE condition;
C. CHANGE table_name SET column1 = value1 WHERE condition;
D. MODIFY table_name SET column1 = value1 WHERE condition;

Correct Answer: Option B


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. All of the above
B. Reduced application development time
C. Data integrity and security
D. Data sharing and concurrency control

Correct Answer: Option A


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. UNIQUE
B. Both A and B
C. PRIMARY KEY
D. DISTINCT

Correct Answer: Option B


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 mechanism to prevent simultaneous access to the same data causing inconsistency
B. A user account
C. A backup file
D. A type of index

Correct Answer: Option A


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. Shared lock
B. Both A and B
C. Exclusive lock
D. None

Correct Answer: Option B


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. Deadlock detection and resolution
B. All of the above
C. Using a timeout
D. Lock ordering

Correct Answer: Option B


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 delete data
B. To update data
C. To create a view
D. To define a temporary result set that can be referenced within a query

Correct Answer: Option D


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. VARCHAR
B. BLOB
C. TEXT
D. CHAR

Correct Answer: Option B


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)