You are on page 1of 6

National University

Database Management System Laboratory


SAMPLE QUIZ #01

MCQ’s

1. Which of the following is not a primary function of a DBMS?


A. Data Retrieval
B. Data Storage
C. Data Analysis
D. Data Security
Answer: C. Data Analysis

2. What does SQL stand for?


A. Structured Query Language
B. Simple Question Language
C. System Query Language
D. Sequential Query Language
Answer: A. Structured Query Language

3. What is a foreign key in a relational database?


A. A key that uniquely identifies each record in a table
B. A key used for indexing tables
C. A key that references the primary key in another table
D. A key used for sorting records in a table
Answer: C. A key that references the primary key in another table
4. Which SQL clause is used to filter the results of a SELECT statement?
A. WHERE
B. HAVING
C. GROUP BY
D. ORDER BY
Answer: A. WHERE

5. What is normalization in the context of database design?


A. Reducing data redundancy and dependency
B. Increasing data redundancy
C. Improving data security
D. Adding more tables to a database
Answer: A. Reducing data redundancy and dependency

6. Which of the following is not a type of database model?


A. Relational
B. Hierarchical
C. NoSQL
D. Object-Oriented
Answer: C. NoSQL

7. In a relational database, what is a primary key used for?


A. To establish relationships between tables
B. To uniquely identify each record in a table
C. To enforce data integrity
D. To sort records in a table
Answer: B. To uniquely identify each record in a table
8. Which normal form deals with the elimination of partial dependencies?
A. First Normal Form (1NF)
B. Second Normal Form (2NF)
C. Third Normal Form (3NF)
D. Boyce-Codd Normal Form (BCNF)
Answer: C. Third Normal Form (3NF)

9. What is the purpose of the COMMIT statement in SQL?


A. To permanently save changes made in a transaction
B. To roll back changes made in a transaction
C. To begin a new transaction
D. To lock a table
Answer: A. To permanently save changes made in a transaction

10. Which SQL command is used to remove all records from a table without removing
the table itself?
A. DELETE
B. TRUNCATE
C. DROP
D. REMOVE
Answer: B. TRUNCATE

11. What does ACID stand for in the context of database transactions?
A. Atomicity, Consistency, Isolation, Durability
B. Authorization, Consistency, Isolation, Durability
C. Atomicity, Control, Isolation, Durability
D. Authorization, Control, Isolation, Durability
Answer: A. Atomicity, Consistency, Isolation, Durability
12. Which type of join returns all records when there is a match in either the left or
right table?
A. INNER JOIN
B. LEFT JOIN
C. RIGHT JOIN
D. FULL OUTER JOIN
Answer: D. FULL OUTER JOIN

13. What is the purpose of the GROUP BY clause in SQL?


A. To filter rows based on a condition
B. To sort the result set in ascending order
C. To group rows that have the same values in specified columns
D. To join two or more tables
Answer: C. To group rows that have the same values in specified columns

14. Which of the following is not a valid data type in SQL?


A. VARCHAR
B. BOOLEAN
C. DECIMAL
D. ENUM
Answer: B. BOOLEAN

15. What is the purpose of the INDEX in a database?


A. To enforce data integrity
B. To sort records in a table
C. To improve query performance
D. To create relationships between tables
Answer: C. To improve query performance
16. In SQL, which aggregate function is used to find the average value in a column?
A. SUM
B. AVG
C. MAX
D. COUNT
Answer: B. AVG

17. What is a stored procedure in the context of a database?


A. A temporary table
B. A set of precompiled SQL statements
C. A virtual table
D. A table that holds only computed values
Answer: B. A set of precompiled SQL statements

18. Which of the following is not a type of database constraint?


A. UNIQUE
B. CHECK
C. INDEX
D. FOREIGN KEY
Answer: C. INDEX

19. Which SQL command is used to add a new record to a table?


A. ADD
B. INSERT
C. UPDATE
D. MODIFY
Answer: B. INSERT
20. What is the purpose of the ROLLBACK statement in SQL?

A. To permanently save changes made in a transaction


B. To undo changes made in a transaction
C. To commit changes made in a transaction
D. To lock a table

Answer: B. To undo changes made in a transaction

You might also like