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 3 of 14
Question #41
What is a foreign key in a database table?
A. A column that references the primary key of another table
B. A key used to uniquely identify records in the same table
C. A key that is always indexed
D. A key that allows null values

Correct Answer: Option A


Explanation:
A foreign key is a field in one table that links to the primary key of another table, establishing a relationship between tables.

This question belongs to: Computer Database Management System (DBMS)
Question #42
Which type of relationship is represented by a foreign key in a relational database?
A. Many-to-many
B. One-to-one
C. All of the above
D. One-to-many

Correct Answer: Option C


Explanation:
Foreign keys can represent various relationships, including one-to-one, one-to-many, and many-to-many (via junction tables).

This question belongs to: Computer Database Management System (DBMS)
Question #43
What is the purpose of the SQL 'JOIN' clause?
A. To combine columns from multiple tables into a single table
B. To delete records from a table
C. To create a new table
D. To combine rows from two or more tables based on a related column

Correct Answer: Option D


Explanation:
JOIN is used to combine rows from different tables based on a common column, allowing querying across related tables.

This question belongs to: Computer Database Management System (DBMS)
Question #44
Which SQL keyword is used to remove a table from the database?
A. TRUNCATE
B. DELETE
C. REMOVE
D. DROP

Correct Answer: Option D


Explanation:
DROP TABLE is a DDL command that deletes the table and its structure from the database.

This question belongs to: Computer Database Management System (DBMS)
Question #45
What does the SQL command 'INSERT INTO' do?
A. Adds a new row to a table
B. Deletes rows
C. Creates a table
D. Updates existing rows

Correct Answer: Option A


Explanation:
INSERT INTO is used to insert new records (rows) into a table.

This question belongs to: Computer Database Management System (DBMS)
Question #46
What is normalization in database design?
A. The process of increasing data duplication
B. The process of encrypting data
C. The process of indexing tables
D. The process of organizing data to reduce redundancy and improve integrity

Correct Answer: Option D


Explanation:
Normalization is the process of structuring a relational database to reduce data redundancy and dependency, typically by dividing large tables into smaller, related tables.

This question belongs to: Computer Database Management System (DBMS)
Question #47
Which normal form eliminates all transitive dependencies?
A. BCNF
B. 2NF
C. 1NF
D. 3NF

Correct Answer: Option D


Explanation:
Third Normal Form (3NF) eliminates transitive dependencies, where non-key attributes depend on other non-key attributes.

This question belongs to: Computer Database Management System (DBMS)
Question #48
In SQL, which clause is used to filter rows before grouping?
A. WHERE
B. HAVING
C. ORDER BY
D. GROUP BY

Correct Answer: Option A


Explanation:
WHERE is used to filter individual rows before aggregation and grouping.

This question belongs to: Computer Database Management System (DBMS)
Question #49
Which SQL clause is used to filter groups after grouping?
A. ORDER BY
B. GROUP BY
C. WHERE
D. HAVING

Correct Answer: Option D


Explanation:
HAVING is used to filter groups based on aggregate conditions, applied after GROUP BY.

This question belongs to: Computer Database Management System (DBMS)
Question #50
What is the purpose of the SQL 'GROUP BY' clause?
A. To group rows that have the same values in specified columns into summary rows
B. To filter rows
C. To sort the result set
D. To join tables

Correct Answer: Option A


Explanation:
GROUP BY organizes data into groups based on the values of one or more columns, often used with aggregate functions.

This question belongs to: Computer Database Management System (DBMS)
Question #51
Which aggregate function is used to count the number of rows in a table?
A. SUM
B. AVG
C. MAX
D. COUNT

Correct Answer: Option D


Explanation:
COUNT returns the number of rows in a table or group.

This question belongs to: Computer Database Management System (DBMS)
Question #52
What is the result of the SQL query: SELECT * FROM employees;?
A. An empty result
B. Only the first row
C. All rows and all columns from the employees table
D. Only the primary key column

Correct Answer: Option C


Explanation:
SELECT * retrieves all columns and rows from the specified table.

This question belongs to: Computer Database Management System (DBMS)
Question #53
What is a candidate key?
A. A column that allows duplicate values
B. A set of columns that uniquely identifies a row and can serve as a primary key
C. A foreign key
D. A column that can be used as a primary key but is not chosen

Correct Answer: Option B


Explanation:
A candidate key is an attribute or set of attributes that can uniquely identify a tuple; one is selected as the primary key.

This question belongs to: Computer Database Management System (DBMS)
Question #54
What is an alternate key?
A. A candidate key that is not chosen as the primary key
B. A super key with extra attributes
C. The primary key
D. A foreign key

Correct Answer: Option A


Explanation:
An alternate key is any candidate key that is not the primary key.

This question belongs to: Computer Database Management System (DBMS)
Question #55
Which type of database model organizes data in a tree-like structure?
A. Network model
B. Object-oriented model
C. Hierarchical model
D. Relational model

Correct Answer: Option C


Explanation:
The hierarchical model arranges data in a parent-child relationship, forming a tree structure.

This question belongs to: Computer Database Management System (DBMS)
Question #56
What is the difference between a DBMS and an RDBMS?
A. DBMS supports only flat files; RDBMS supports relational tables
B. DBMS does not support relationships; RDBMS does
C. There is no difference
D. DBMS is a subset of RDBMS

Correct Answer: Option B


Explanation:
RDBMS is a type of DBMS that organizes data in tables with relationships, enforcing referential integrity using primary and foreign keys, while a DBMS may not support such relationships.

This question belongs to: Computer Database Management System (DBMS)
Question #57
Which SQL command is used to modify the structure of an existing table?
A. MODIFY
B. CHANGE
C. ALTER
D. UPDATE

Correct Answer: Option C


Explanation:
ALTER TABLE is a DDL command used to add, delete, or modify columns and constraints in an existing table.

This question belongs to: Computer Database Management System (DBMS)
Question #58
What is a view in a database?
A. A physical table stored on disk
B. An index on a table
C. A backup of a table
D. A virtual table based on the result of a SELECT query

Correct Answer: Option D


Explanation:
A view is a logical representation of data, derived from one or more tables, but does not store data physically.

This question belongs to: Computer Database Management System (DBMS)
Question #59
Which of the following is a DML statement?
A. ALTER
B. UPDATE
C. DROP
D. CREATE

Correct Answer: Option B


Explanation:
UPDATE is a Data Manipulation Language (DML) command used to modify existing records in a table. CREATE, ALTER, DROP are DDL.

This question belongs to: Computer Database Management System (DBMS)
Question #60
What is the default sorting order when using ORDER BY without specifying ASC or DESC?
A. Descending
B. Random
C. Ascending
D. No order

Correct Answer: Option C


Explanation:
ORDER BY defaults to ascending (ASC) order.

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