1.Easy
Which constraint makes sure a column can never be left empty (NULL)?
- AUNIQUE
- BNOT NULL
- CCHECK NULL
- DDEFAULT
2.Easy
In a LIKE pattern, what does the _ (underscore) wildcard stand for?
- AA space character
- BZero or more characters
- CAny letter but no digits
- DExactly one character
3.Easy
Which SQL statement retrieves data from a table?
- ASELECT
- BUPDATE
- CINSERT
- DCREATE
4.Medium
Which ACID property means concurrent transactions do not see each other's unfinished changes?
- AAvailability
- BDurability
- CAtomicity
- DIsolation
5.Medium
What does SELECT SUM(amount) FROM orders return when the WHERE clause matches no rows?
- A0
- BAn error
- CAn empty string
- DNULL
6.Medium
Third normal form (3NF) removes:
- ATransitive dependencies between non-key attributes
- BComposite keys
- CAtomic values
- DRedundant indexes on columns that are not part of a key
7.Hard
What does EXPLAIN (or EXPLAIN ANALYZE in PostgreSQL) show for a query?
- AThe list of users who ran the query
- BThe execution plan chosen by the optimiser, such as scans and join methods
- CThe meaning of each SQL keyword in the query
- DA rewrite of the query in relational algebra notation only
8.Hard
What does the write-ahead logging (WAL) rule require?
- AThe log is written only after a crash
- BA change's log record must reach stable storage before the changed data page does
- CData pages must be written before the log
- DEvery query must be logged before it is parsed
Answer key
- 1. B · NOT NULL
- 2. D · Exactly one character
- 3. A · SELECT
- 4. D · Isolation
- 5. D · NULL
- 6. A · Transitive dependencies between non-key attributes
- 7. B · The execution plan chosen by the optimiser, such as scans and join methods
- 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.