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 5 of 14
Question #81
Which of the following is not a type of database model?
A. Network
B. Hierarchical
C. Flat-file
D. Object-oriented

Correct Answer: Option C


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
What is the purpose of an index in a database?
A. To encrypt data
B. To enforce foreign key constraints
C. To speed up data retrieval operations
D. To compress data

Correct Answer: Option C


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
Which SQL clause is used to limit the number of rows returned in a query?
A. LIMIT
B. TOP
C. All of the above (depending on DBMS)
D. ROWNUM

Correct Answer: Option C


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
What is a data dictionary in a DBMS?
A. A repository of metadata about the database
B. A table containing user data
C. A backup of the database
D. A log file

Correct Answer: Option A


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
Which of the following is a valid SQL statement to add a new column to a table?
A. ADD COLUMN TO table_name column_name datatype;
B. ALTER TABLE table_name ADD COLUMN column_name datatype;
C. ALTER TABLE table_name ADD column_name datatype;
D. Both A and C

Correct Answer: Option D


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
In SQL, what does the wildcard '%' match when used with LIKE?
A. A specific character
B. Only digits
C. Any single character
D. Any string of zero or more characters

Correct Answer: Option D


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
Which of the following is a DCL (Data Control Language) command?
A. GRANT
B. SELECT
C. CREATE
D. COMMIT

Correct Answer: Option A


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
What is the purpose of the COMMIT statement in SQL?
A. To save a point within a transaction
B. To permanently save all changes made in a transaction
C. To undo all changes made in a transaction
D. To start a new transaction

Correct Answer: Option B


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

This question belongs to: Computer Database Management System (DBMS)
Question #89
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
Which of the following is an example of a relational database management system (RDBMS)?
A. Oracle Database
B. Cassandra
C. MongoDB
D. Redis

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
What is the concept of referential integrity?
A. Ensuring data is normalized
B. Ensuring that no null values exist
C. Ensuring that foreign key values match primary key values in the referenced table
D. Ensuring that all primary keys are unique

Correct Answer: Option C


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
Which SQL function returns the average of a numeric column?
A. AVG()
B. COUNT()
C. SUM()
D. MEAN()

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
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 determines the physical order of data; non-clustered does not
C. They are the same
D. Clustered index is faster for inserts

Correct Answer: Option B


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
Which of the following is a valid SQL datatype for storing variable-length strings?
A. VARCHAR
B. INT
C. DATE
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
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. Restrict
D. Set null

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
Which of the following is a TCL (Transaction Control Language) command?
A. SELECT
B. CREATE
C. DROP
D. SAVEPOINT

Correct Answer: Option D


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

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

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
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
Which operator is used in SQL to compare a value to a set of values returned by a subquery?
A. BETWEEN
B. IN
C. LIKE
D. EXISTS

Correct Answer: Option B


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
What does the EXISTS operator do in SQL?
A. Tests for the existence of rows returned by a subquery
B. Checks if a value is null
C. Compares two values
D. Performs arithmetic

Correct Answer: Option A


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

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