Database Management System (DBMS) MCQs

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

278 Total
Question #81 Report Error
Which of the following is not a type of database model?
A. Flat-file
B. Hierarchical
C. Network
D. Object-oriented

Correct Answer: Option A


Explanation:
Flat-file is not a database model; it is a simple file containing records. Hierarchical, Network, Relational, and Object-oriented are database models.

This question belongs to: Computer Database Management System (DBMS)
Question #82 Report Error
What is the purpose of an index in a database?
A. To enforce foreign key constraints
B. To encrypt data
C. To compress data
D. To speed up data retrieval operations

Correct Answer: Option D


Explanation:
Indexes are used to improve the speed of data retrieval queries, at the cost of additional storage and maintenance overhead.

This question belongs to: Computer Database Management System (DBMS)
Question #83 Report Error
Which SQL clause is used to limit the number of rows returned in a query?
A. All of the above (depending on DBMS)
B. ROWNUM
C. LIMIT
D. TOP

Correct Answer: Option A


Explanation:
Different DBMS use different keywords: MySQL uses LIMIT, SQL Server uses TOP, Oracle uses ROWNUM.

This question belongs to: Computer Database Management System (DBMS)
Question #84 Report Error
What is a data dictionary in a DBMS?
A. A backup of the database
B. A repository of metadata about the database
C. A table containing user data
D. A log file

Correct Answer: Option B


Explanation:
The data dictionary stores metadata such as table definitions, column types, constraints, and other database objects.

This question belongs to: Computer Database Management System (DBMS)
Question #85 Report Error
Which of the following is a valid SQL statement to add a new column to a table?
A. ALTER TABLE table_name ADD COLUMN column_name datatype;
B. ADD COLUMN TO table_name column_name datatype;
C. Both A and C
D. ALTER TABLE table_name ADD column_name datatype;

Correct Answer: Option C


Explanation:
Both 'ADD column_name datatype' and 'ADD COLUMN column_name datatype' are valid syntax in some DBMS, but standard SQL uses 'ADD column_name datatype'. However, many DBMS support both.

This question belongs to: Computer Database Management System (DBMS)
Question #86 Report Error
In SQL, what does the wildcard '%' match when used with LIKE?
A. Any string of zero or more characters
B. A specific character
C. Any single character
D. Only digits

Correct Answer: Option A


Explanation:
'%' matches any sequence of zero or more characters, while '_' matches a single character.

This question belongs to: Computer Database Management System (DBMS)
Question #87 Report Error
Which of the following is a DCL (Data Control Language) command?
A. CREATE
B. COMMIT
C. SELECT
D. GRANT

Correct Answer: Option D


Explanation:
GRANT and REVOKE are DCL commands. COMMIT is TCL, SELECT is DML, CREATE is DDL.

This question belongs to: Computer Database Management System (DBMS)
Question #88 Report Error
What is the purpose of the COMMIT statement in SQL?
A. To undo all changes made in a transaction
B. To save a point within a transaction
C. To start a new transaction
D. To permanently save all changes made in a transaction

Correct Answer: Option D


Explanation:
COMMIT finalizes a transaction, making all changes permanent in the database.

This question belongs to: Computer Database Management System (DBMS)
Question #89 Report Error
What does the ROLLBACK statement do?
A. Starts a new transaction
B. Saves the changes
C. Undoes all changes made in the current transaction
D. Creates a savepoint

Correct Answer: Option C


Explanation:
ROLLBACK reverts the database to the state it was in at the beginning of the transaction, undoing all changes.

This question belongs to: Computer Database Management System (DBMS)
Question #90 Report Error
Which of the following is an example of a relational database management system (RDBMS)?
A. Oracle Database
B. Cassandra
C. Redis
D. MongoDB

Correct Answer: Option A


Explanation:
Oracle Database is a well-known RDBMS. MongoDB, Redis, and Cassandra are NoSQL databases.

This question belongs to: Computer Database Management System (DBMS)
Question #91 Report Error
What is the concept of referential integrity?
A. Ensuring data is normalized
B. Ensuring that all primary keys are unique
C. Ensuring that no null values exist
D. Ensuring that foreign key values match primary key values in the referenced table

Correct Answer: Option D


Explanation:
Referential integrity ensures that relationships between tables remain consistent, meaning foreign key values must have corresponding primary key values.

This question belongs to: Computer Database Management System (DBMS)
Question #92 Report Error
Which SQL function returns the average of a numeric column?
A. AVG()
B. SUM()
C. MEAN()
D. COUNT()

Correct Answer: Option A


Explanation:
AVG() calculates the average of the values in a numeric column.

This question belongs to: Computer Database Management System (DBMS)
Question #93 Report Error
What is the difference between a clustered index and a non-clustered index?
A. Non-clustered index determines physical order; clustered does not
B. Clustered index is faster for inserts
C. They are the same
D. Clustered index determines the physical order of data; non-clustered does not

Correct Answer: Option D


Explanation:
A clustered index sorts and stores the data rows in the table based on key values, while a non-clustered index is a separate structure that points to the data rows.

This question belongs to: Computer Database Management System (DBMS)
Question #94 Report Error
Which of the following is a valid SQL datatype for storing variable-length strings?
A. VARCHAR
B. DATE
C. INT
D. CHAR

Correct Answer: Option A


Explanation:
VARCHAR stores variable-length character strings. CHAR stores fixed-length strings.

This question belongs to: Computer Database Management System (DBMS)
Question #95 Report Error
What is the default behavior of a foreign key when a referenced row is deleted?
A. Depends on the ON DELETE action specified
B. Cascade delete
C. Set null
D. Restrict

Correct Answer: Option A


Explanation:
The behavior is defined by the ON DELETE rule (CASCADE, SET NULL, RESTRICT, NO ACTION) specified in the foreign key constraint.

This question belongs to: Computer Database Management System (DBMS)
Question #96 Report Error
Which of the following is a TCL (Transaction Control Language) command?
A. SAVEPOINT
B. CREATE
C. SELECT
D. DROP

Correct Answer: Option A


Explanation:
Transaction Control Language includes COMMIT, ROLLBACK, and SAVEPOINT.

This question belongs to: Computer Database Management System (DBMS)
Question #97 Report Error
What is the purpose of the SAVEPOINT statement?
A. To start a new transaction
B. To release locks
C. To create a point within a transaction to which you can later roll back
D. To permanently save changes

Correct Answer: Option C


Explanation:
SAVEPOINT creates a named point within a transaction, allowing partial rollback to that point without affecting the entire transaction.

This question belongs to: Computer Database Management System (DBMS)
Question #98 Report Error
What is a subquery in SQL?
A. A query that returns multiple results
B. A query that is used to create a table
C. A query nested inside another query
D. A query that is always correlated

Correct Answer: Option C


Explanation:
A subquery is a SELECT statement nested within another SQL statement (e.g., SELECT, INSERT, UPDATE, DELETE).

This question belongs to: Computer Database Management System (DBMS)
Question #99 Report Error
Which operator is used in SQL to compare a value to a set of values returned by a subquery?
A. EXISTS
B. LIKE
C. IN
D. BETWEEN

Correct Answer: Option C


Explanation:
IN checks if a value matches any value in a list or subquery result set.

This question belongs to: Computer Database Management System (DBMS)
Question #100 Report Error
What does the EXISTS operator do in SQL?
A. Compares two values
B. Checks if a value is null
C. Performs arithmetic
D. Tests for the existence of rows returned by a subquery

Correct Answer: Option D


Explanation:
EXISTS returns TRUE if the subquery returns at least one row, otherwise FALSE.

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