1.Easy
What does WHERE country IN ('NL', 'BE', 'DE') do?
- AKeeps rows whose country value contains all three codes at once
- BKeeps rows whose country equals any value in the list
- CKeeps rows whose country is not in the list
- DSorts rows in the order of the list
2.Easy
What is a surrogate key?
- AAn artificial identifier with no business meaning, such as an auto-increment id
- BA key made from real-world data such as an email address
- CA key that refers to another table
- DA key that is only used in views
3.Easy
Which SQL statement adds new rows to a table?
- AINSERT
- BALTER
- CUPDATE
- DSELECT
4.Medium
In relational algebra, the selection operator (σ) corresponds to which SQL clause?
- AORDER BY
- BSELECT list
- CWHERE
- DGROUP BY
5.Medium
What does the functional dependency A → B mean?
- AEach value of A is associated with exactly one value of B
- BA and B are both primary keys
- CEach value of B is associated with exactly one value of A
- DA is a foreign key referencing B
6.Medium
What does GRANT SELECT ON employees TO alice do?
- AAllows the user alice to read the employees table
- BAllows alice to update and delete rows in the employees table
- CMakes alice the owner of the database
- DCopies the employees table to alice
7.Hard
Table employee(emp_id, dept_id, dept_name) has the key emp_id, and dept_id → dept_name. Which statement is correct?
- AIt is in 2NF but not in 3NF
- BIt is not in 2NF
- CIt is not in 1NF
- DIt is in BCNF and therefore in 3NF
8.Hard
After customers LEFT JOIN orders, why use COUNT(o.id) rather than COUNT(*) to count orders per customer?
- ACOUNT(o.id) counts only distinct customers
- BCOUNT(*) counts the NULL-filled row as 1 for customers without orders
- CCOUNT(*) is not allowed after a join
- DCOUNT(*) ignores rows with NULL values
Answer key
- 1. B · Keeps rows whose country equals any value in the list
- 2. A · An artificial identifier with no business meaning, such as an auto-increment id
- 3. A · INSERT
- 4. C · WHERE
- 5. A · Each value of A is associated with exactly one value of B
- 6. A · Allows the user alice to read the employees table
- 7. A · It is in 2NF but not in 3NF
- 8. B · COUNT(*) counts the NULL-filled row as 1 for customers without orders
Full step-by-step solutions: practise this topic on examproblems.com.