1.Easy
Which rows does WHERE price BETWEEN 10 AND 20 select?
- ARows with price outside the range 10 to 20
- BRows with price from 10 to 20, including 10 and 20
- CRows with price above 10 and below 20, excluding 10 and 20
- DRows with price equal to 10 or 20 only
2.Easy
What does GROUP BY do in a query?
- APuts rows with the same values into groups so aggregates are computed per group
- BSorts the rows of the result alphabetically
- CRemoves rows with NULL values
- DJoins two tables on their common columns
3.Easy
What does WHERE country IN ('NL', 'BE', 'DE') do?
- AKeeps rows whose country equals any value in the list
- BKeeps rows whose country is not in the list
- CSorts rows in the order of the list
- DKeeps rows whose country value contains all three codes at once
4.Medium
Which ACID property guarantees that committed changes survive a system crash?
- AIsolation
- BDurability
- CConsistency
- DAtomicity
5.Medium
A foreign key is declared with ON DELETE CASCADE. What happens when a parent row is deleted?
- AThe delete is always rejected
- BThe child rows that reference it are deleted automatically
- CThe parent row is copied to an archive table
- DThe foreign key in the child rows is set to NULL automatically
6.Medium
What is a database trigger?
- AA query that a user runs by hand
- BCode that runs automatically when a specified event such as INSERT, UPDATE or DELETE occurs on a table
- CA type of index that speeds up searches
- DA scheduled backup of the database
7.Hard
A reporting database copies customer names into the orders table to avoid joins. What is the main cost of this denormalisation?
- ARedundant copies must be kept consistent whenever customer data changes
- BThe database cannot use indexes any more
- CPrimary keys can no longer be used
- DQueries on the orders table become slower
8.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 BCNF and therefore in 3NF
- BIt is not in 1NF
- CIt is in 2NF but not in 3NF
- DIt is not in 2NF
Answer key
- 1. B · Rows with price from 10 to 20, including 10 and 20
- 2. A · Puts rows with the same values into groups so aggregates are computed per group
- 3. A · Keeps rows whose country equals any value in the list
- 4. B · Durability
- 5. B · The child rows that reference it are deleted automatically
- 6. B · Code that runs automatically when a specified event such as INSERT, UPDATE or DELETE occurs on a table
- 7. A · Redundant copies must be kept consistent whenever customer data changes
- 8. C · It is in 2NF but not in 3NF
Full step-by-step solutions: practise this topic on examproblems.com.