1.Easy
Which clause filters rows before grouping?
- AGROUP BY
- BHAVING
- CORDER BY
- DWHERE
2.Easy
A foreign key is:
- AA key that is always encrypted
- BA column that refers to the primary key of another table
- CA key used by foreign users
- DA column whose values must be unique across all rows of the table
3.Easy
What is a surrogate key?
- AA key that is only used in views
- BA key made from real-world data such as an email address
- CA key that refers to another table
- DAn artificial identifier with no business meaning, such as an auto-increment id
4.Medium
In relational algebra, the selection operator (σ) corresponds to which SQL clause?
- AGROUP BY
- BWHERE
- CORDER BY
- DSELECT list
5.Medium
What does a common table expression (WITH name AS (...)) provide?
- AA permanent table that stays stored on disk until it is dropped
- BAn index on a column
- CA new database user
- DA named temporary result that can be used within one statement
6.Medium
Third normal form (3NF) removes:
- AAtomic values
- BTransitive dependencies between non-key attributes
- CRedundant indexes on columns that are not part of a key
- DComposite keys
7.Hard
What is a known drawback of decomposing tables into BCNF compared with 3NF?
- AThe decomposition always loses data when joined back
- BSome functional dependencies may no longer be checkable within a single table
- CBCNF tables cannot have primary keys
- DBCNF allows more redundancy than 3NF
8.Hard
The query FROM customers c LEFT JOIN orders o ON o.customer_id = c.id WHERE o.status = 'paid' unexpectedly drops customers with no orders. Why?
- Astatus is a reserved word
- BThe WHERE condition on o rejects the NULL-filled rows, turning it into an inner join
- CThe join should use USING instead of ON
- DLEFT JOIN never keeps unmatched rows
Answer key
- 1. D · WHERE
- 2. B · A column that refers to the primary key of another table
- 3. D · An artificial identifier with no business meaning, such as an auto-increment id
- 4. B · WHERE
- 5. D · A named temporary result that can be used within one statement
- 6. B · Transitive dependencies between non-key attributes
- 7. B · Some functional dependencies may no longer be checkable within a single table
- 8. B · The WHERE condition on o rejects the NULL-filled rows, turning it into an inner join
Full step-by-step solutions: practise this topic on examproblems.com.