1.Easy
What is a primary key?
- AA column or set of columns that uniquely identifies each row
- BA column that may hold duplicate values but must never contain NULL
- CThe first column of every table
- DA password for the database
2.Easy
What does GROUP BY do in a query?
- APuts rows with the same values into groups so aggregates are computed per group
- BRemoves rows with NULL values
- CSorts the rows of the result alphabetically
- DJoins two tables on their common columns
3.Easy
GRANT and REVOKE belong to which part of SQL?
- AData Control Language (DCL)
- BData Query Language (DQL)
- CData Manipulation Language (DML)
- DData Definition Language (DDL)
4.Medium
A table has rows where col is NULL. Which rows does WHERE col = NULL return?
- AAn error in every database
- BAll rows of the table
- CNo rows, because the comparison is unknown
- DOnly the rows where col is NULL, as with IS NULL
5.Medium
A foreign key is declared with ON DELETE CASCADE. What happens when a parent row is deleted?
- AThe foreign key in the child rows is set to NULL automatically
- BThe delete is always rejected
- CThe child rows that reference it are deleted automatically
- DThe parent row is copied to an archive table
6.Medium
Which ACID property means concurrent transactions do not see each other's unfinished changes?
- AIsolation
- BAvailability
- CAtomicity
- DDurability
7.Hard
Two-phase locking (2PL) ensures:
- AConflict-serializable schedules
- BThat transactions never wait
- CThat no locks are needed
- DThat deadlocks can never happen
8.Hard
When is decomposing R into R1 and R2 guaranteed to be lossless?
- AWhen R1 and R2 have no attributes in common
- BWhen R1 and R2 have the same number of columns
- CWhen the common attributes of R1 and R2 form a superkey of R1 or of R2
- DWhen every attribute of R appears in both R1 and R2
Answer key
- 1. A · A column or set of columns that uniquely identifies each row
- 2. A · Puts rows with the same values into groups so aggregates are computed per group
- 3. A · Data Control Language (DCL)
- 4. C · No rows, because the comparison is unknown
- 5. C · The child rows that reference it are deleted automatically
- 6. A · Isolation
- 7. A · Conflict-serializable schedules
- 8. C · When the common attributes of R1 and R2 form a superkey of R1 or of R2
Full step-by-step solutions: practise this topic on examproblems.com.