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 key used to uniquely identify records in the same table
B. A key that allows null values
C. A column that references the primary key of another table
D. A key that is always indexed

Correct Answer: Option C


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. All of the above
B. One-to-many
C. One-to-one
D. Many-to-many

Correct Answer: Option A


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 rows from two or more tables based on a related column
B. To delete records from a table
C. To create a new table
D. To combine columns from multiple tables into a single table

Correct Answer: Option A


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. DROP
D. REMOVE

Correct Answer: Option C


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. Updates existing rows
B. Creates a table
C. Deletes rows
D. Adds a new row to a table

Correct Answer: Option D


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 organizing data to reduce redundancy and improve integrity
B. The process of indexing tables
C. The process of increasing data duplication
D. The process of encrypting data

Correct Answer: Option A


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. 2NF
B. 3NF
C. BCNF
D. 1NF

Correct Answer: Option B


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. HAVING
B. GROUP BY
C. WHERE
D. ORDER BY

Correct Answer: Option C


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. GROUP BY
B. HAVING
C. WHERE
D. ORDER BY

Correct Answer: Option B


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. COUNT
B. SUM
C. MAX
D. AVG

Correct Answer: Option A


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. Only the first row
B. All rows and all columns from the employees table
C. An empty result
D. Only the primary key column

Correct Answer: Option B


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 can be used as a primary key but is not chosen
B. A set of columns that uniquely identifies a row and can serve as a primary key
C. A column that allows duplicate values
D. A foreign key

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. The primary key
C. A foreign key
D. A super key with extra attributes

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

Correct Answer: Option D


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 does not support relationships; RDBMS does
B. DBMS is a subset of RDBMS
C. DBMS supports only flat files; RDBMS supports relational tables
D. There is no difference

Correct Answer: Option A


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. ALTER
B. UPDATE
C. CHANGE
D. MODIFY

Correct Answer: Option A


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 virtual table based on the result of a SELECT query
D. A backup of a table

Correct Answer: Option C


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. UPDATE
B. ALTER
C. CREATE
D. DROP

Correct Answer: Option A


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. No order
D. Ascending

Correct Answer: Option D


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

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