1.Easy
What does WHERE country IN ('NL', 'BE', 'DE') do?
- ASorts rows in the order of the list
- BKeeps rows whose country value contains all three codes at once
- CKeeps rows whose country is not in the list
- DKeeps rows whose country equals any value in the list
2.Easy
Which aggregate function counts rows?
- ASUM
- BCOUNT
- CAVG
- DMAX
3.Easy
In a LIKE pattern, what does the _ (underscore) wildcard stand for?
- AExactly one character
- BA space character
- CAny letter but no digits
- DZero or more characters
4.Medium
Which statement about HAVING is correct?
- AIt cannot be used with GROUP BY
- BIt must come before WHERE in the SELECT statement
- CIt sorts the results
- DIt can use aggregate functions to filter groups
5.Medium
An employees table has a column manager_id that refers to another employee. How do you list each employee next to their manager's name?
- AJoin the employees table with itself using two aliases
- BCombine the table with itself using UNION ALL and a WHERE filter
- CCreate a second copy of the table on disk
- DUse GROUP BY manager_id only
6.Medium
The orders table has 5 rows, each referring to an existing customer. The customers table has 3 rows. How many rows does an INNER JOIN on customer_id return?
- A8
- B3
- C5
- D15
7.Hard
What does the following return: SELECT name FROM students WHERE grade > (SELECT AVG(grade) FROM students)?
- AStudents with a grade above the average grade
- BStudents with the highest grade only
- CThe average grade of all students
- DAn error because subqueries are not allowed in WHERE
8.Hard
What is a known drawback of decomposing tables into BCNF compared with 3NF?
- ABCNF allows more redundancy than 3NF
- BBCNF tables cannot have primary keys
- CThe decomposition always loses data when joined back
- DSome functional dependencies may no longer be checkable within a single table
Answer key
- 1. D · Keeps rows whose country equals any value in the list
- 2. B · COUNT
- 3. A · Exactly one character
- 4. D · It can use aggregate functions to filter groups
- 5. A · Join the employees table with itself using two aliases
- 6. C · 5
- 7. A · Students with a grade above the average grade
- 8. D · Some functional dependencies may no longer be checkable within a single table
Full step-by-step solutions: practise this topic on examproblems.com.