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. Hierarchical
B. Flat-file
C. Network
D. Object-oriented

Correct Answer: Option B


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

Correct Answer: Option B


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 table containing user data
B. A backup of the database
C. A repository of metadata about the database
D. A log file

Correct Answer: Option C


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. ALTER TABLE table_name ADD COLUMN column_name datatype;
B. Both A and C
C. ALTER TABLE table_name ADD column_name datatype;
D. ADD COLUMN TO table_name column_name datatype;

Correct Answer: Option B


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. COMMIT
B. GRANT
C. CREATE
D. SELECT

Correct Answer: Option B


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 permanently save all changes made in a transaction
B. To save a point within a transaction
C. To undo all changes made in a transaction
D. To start a new transaction

Correct Answer: Option A


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. Creates a savepoint
C. Saves the changes
D. Undoes all changes made in the current transaction

Correct Answer: Option D


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. Redis
B. Oracle Database
C. Cassandra
D. MongoDB

Correct Answer: Option B


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

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. MEAN()
B. COUNT()
C. SUM()
D. AVG()

Correct Answer: Option D


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 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
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
What is the default behavior of a foreign key when a referenced row is deleted?
A. Set null
B. Cascade delete
C. Depends on the ON DELETE action specified
D. Restrict

Correct Answer: Option C


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. DROP
B. SELECT
C. CREATE
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 permanently save changes
B. To release locks
C. To create a point within a transaction to which you can later roll back
D. To start a new transaction

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 is used to create a table
B. A query that is always correlated
C. A query that returns multiple results
D. A query nested inside another query

Correct Answer: Option D


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. IN
B. LIKE
C. BETWEEN
D. EXISTS

Correct Answer: Option A


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. Compares two values
B. Tests for the existence of rows returned by a subquery
C. Checks if a value is null
D. Performs arithmetic

Correct Answer: Option B


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

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