1.Easy
What is a composite key?
- AA key that allows duplicate values
- BA key stored in a separate table
- CA key that is generated by the database
- DA key made up of two or more columns
2.Easy
What does a UNIQUE constraint on a column guarantee?
- AThe column values are sorted
- BNo two rows have the same non-NULL value in that column
- CThe column automatically becomes the primary key of the table
- DThe column cannot be changed after insert
3.Easy
GRANT and REVOKE belong to which part of SQL?
- AData Control Language (DCL)
- BData Query Language (DQL)
- CData Definition Language (DDL)
- DData Manipulation Language (DML)
4.Medium
Third normal form (3NF) removes:
- ATransitive dependencies between non-key attributes
- BRedundant indexes on columns that are not part of a key
- CAtomic values
- DComposite keys
5.Medium
Which ACID property means concurrent transactions do not see each other's unfinished changes?
- AAtomicity
- BDurability
- CIsolation
- DAvailability
6.Medium
What does a common table expression (WITH name AS (...)) provide?
- AA named temporary result that can be used within one statement
- BA permanent table that stays stored on disk until it is dropped
- CA new database user
- DAn index on a column
7.Hard
Table b contains the values 1, 2 and NULL in column y. What does SELECT * FROM a WHERE x NOT IN (SELECT y FROM b) return?
- AOnly rows of a where x is NULL
- BEvery row of a
- CNo rows at all
- DRows of a where x is not 1 or 2
8.Hard
Two doctors on call each check that the other is still on call, then both sign off at the same time. Which anomaly can snapshot isolation still allow here?
- AWrite skew
- BNon-repeatable read within one transaction
- CDirty write
- DDirty read
Answer key
- 1. D · A key made up of two or more columns
- 2. B · No two rows have the same non-NULL value in that column
- 3. A · Data Control Language (DCL)
- 4. A · Transitive dependencies between non-key attributes
- 5. C · Isolation
- 6. A · A named temporary result that can be used within one statement
- 7. C · No rows at all
- 8. A · Write skew
Full step-by-step solutions: practise this topic on examproblems.com.