100 MCQs on Databases
100 MCQs on Databases
30. If a relation has two candidate keys and violates 3NF but satisfies BCNF, what does it mean?
A) BCNF is weaker than 3NF
B) BCNF is stricter and may not preserve all dependencies
C) Both are same
D) Relation is invalid
Answer: B
46. Which SQL command removes all rows from a table but keeps the table structure?
A) DELETE
B) DROP
C) TRUNCATE
D) REMOVE
Answer: C
53. Which tree data structure is commonly used for indexing in databases?
A) Binary Tree
B) B+ Tree
C) AVL Tree
D) Trie
Answer: B
57. Which operator in SQL is used to combine the result of two SELECT queries?
A) UNION
B) JOIN
C) INTERSECT
D) MERGE
Answer: A
60. The process of ensuring database consistency after a system crash is called:
A) Rollback
B) Recovery
C) Backup
D) Commit
Answer: B
62. In SQL, which command is used to remove a table and all its data?
A) DELETE TABLE
B) DROP TABLE
C) REMOVE TABLE
D) TRUNCATE TABLE
Answer: B
63. What does the term “Tuple” mean in the relational model?
A) Column
B) Row
C) Table
D) Database
Answer: B
65. What type of join returns all rows from the left table and matched rows from the right table?
A) INNER JOIN
B) LEFT OUTER JOIN
C) RIGHT OUTER JOIN
D) FULL OUTER JOIN
Answer: B
66. What is the main function of a query optimizer?
A) To generate query results
B) To find the most efficient way to execute a query
C) To parse the query
D) To store query results
Answer: B
69. The minimal set of attributes that can uniquely identify a tuple is called:
A) Candidate key
B) Primary key
C) Foreign key
D) Super key
Answer: A
75. In SQL, which command is used to save all changes made during the current transaction?
A) SAVE
B) COMMIT
C) ROLLBACK
D) STORE
Answer: B
79. Which type of join returns all rows from both tables, matching rows where possible?
A) INNER JOIN
B) FULL OUTER JOIN
C) LEFT JOIN
D) RIGHT JOIN
Answer: B
90. What is the difference between a primary key and a candidate key?
A) Primary key is chosen candidate key
B) Candidate key is chosen primary key
C) They are the same
D) Candidate key is always composite
Answer: A
94. Which type of database backup captures only changes since last backup?
A) Full backup
B) Incremental backup
C) Differential backup
D) Snapshot
Answer: B
95. In SQL, which command is used to remove duplicates from the result set?
A) UNIQUE
B) DISTINCT
C) DIFFERENT
D) NO DUPLICATES
Answer: B
97. A foreign key in one table that references primary key in another table is used for:
A) Data integrity
B) Speeding up queries
C) Data backup
D) Data encryption
Answer: A
99. In SQL, which command removes all rows but retains table structure?
A) DELETE
B) TRUNCATE
C) DROP
D) REMOVE
Answer: B
100. Which property of transactions ensures partial completion does not occur?
A) Atomicity
B) Consistency
C) Isolation
D) Durability
Answer: A