1.Easy
What does ROLLBACK do in a transaction?
- ASaves all changes of the transaction permanently to disk
- BDeletes the table
- CUndoes the changes made since the transaction began
- DRepeats the last statement
2.Easy
What is a primary key?
- AA column that may hold duplicate values but must never contain NULL
- BA password for the database
- CThe first column of every table
- DA column or set of columns that uniquely identifies each row
3.Easy
An INNER JOIN returns:
- AOnly rows with matching values in both tables
- BRows that do not match
- CAll rows from the left table, with NULLs where there is no match
- DAll rows from both tables
4.Medium
A view in SQL is:
- AA screen in the database client for browsing tables
- BAn index type
- CA copy of a table on disk
- DA stored query that behaves like a virtual table
5.Medium
Which ACID property guarantees that committed changes survive a system crash?
- AIsolation
- BConsistency
- CAtomicity
- DDurability
6.Medium
An employees table has a column manager_id that refers to another employee. How do you list each employee next to their manager's name?
- AUse GROUP BY manager_id only
- BCombine the table with itself using UNION ALL and a WHERE filter
- CCreate a second copy of the table on disk
- DJoin the employees table with itself using two aliases
7.Hard
Boyce–Codd normal form (BCNF) requires that for every non-trivial functional dependency X → Y:
- AX is a superkey
- BY is a primary key
- CY is atomic
- DX contains NULL
8.Hard
What does the write-ahead logging (WAL) rule require?
- AData pages must be written before the log
- BA change's log record must reach stable storage before the changed data page does
- CThe log is written only after a crash
- DEvery query must be logged before it is parsed
Answer key
- 1. C · Undoes the changes made since the transaction began
- 2. D · A column or set of columns that uniquely identifies each row
- 3. A · Only rows with matching values in both tables
- 4. D · A stored query that behaves like a virtual table
- 5. D · Durability
- 6. D · Join the employees table with itself using two aliases
- 7. A · X is a superkey
- 8. B · A change's log record must reach stable storage before the changed data page does
Full step-by-step solutions: practise this topic on examproblems.com.