1.Easy
Which aggregate function returns the average of a numeric column?
- AMEAN
- BAVG
- CMEDIAN
- DSUM
2.Easy
Which clause filters rows before grouping?
- AWHERE
- BHAVING
- CORDER BY
- DGROUP BY
3.Easy
Which keyword sorts the result of a query?
- AORDER BY
- BGROUP BY
- CSORT
- DARRANGE
4.Medium
First normal form (1NF) requires that:
- AThere are no foreign keys
- BEvery table has exactly one column
- CEach column contains atomic values and there are no repeating groups
- DEvery non-key column depends on the whole key and on nothing but the key
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
What does ROLLBACK TO SAVEPOINT s1 do?
- AUndoes the changes made after savepoint s1, keeping the transaction open
- BEnds the transaction and commits everything
- CUndoes the whole transaction from the beginning
- DDeletes the savepoint and all tables changed since then
7.Hard
Why might a query with WHERE YEAR(order_date) = 2025 not use an index on order_date?
- AIndexes never work with dates
- BYEAR is not valid SQL
- CApplying a function to the column prevents a simple index range lookup
- DAn index on order_date is only used for ORDER BY clauses, never for WHERE
8.Hard
What is a covering index for a query?
- AAn index that contains all columns the query needs, so the table itself need not be read
- BAn index that is rebuilt every night
- CAn index on the primary key only
- DAn index that covers every column of every table
Answer key
- 1. B · AVG
- 2. A · WHERE
- 3. A · ORDER BY
- 4. C · Each column contains atomic values and there are no repeating groups
- 5. A · Join the employees table with itself using two aliases
- 6. A · Undoes the changes made after savepoint s1, keeping the transaction open
- 7. C · Applying a function to the column prevents a simple index range lookup
- 8. A · An index that contains all columns the query needs, so the table itself need not be read
Full step-by-step solutions: practise this topic on examproblems.com.