1.Easy
In a LIKE pattern, what does the _ (underscore) wildcard stand for?
- AAny letter but no digits
- BZero or more characters
- CExactly one character
- DA space character
2.Easy
In PostgreSQL and MySQL, which clause returns only the first 10 rows of a result?
- ATOP ROWS 10
- BMAX 10
- CFIRST 10 ONLY
- DLIMIT 10
3.Easy
Which aggregate function counts rows?
- AAVG
- BMAX
- CSUM
- DCOUNT
4.Medium
In relational algebra, the projection operator (π) corresponds to:
- ASorting the result
- BCombining two tables on a key
- CChoosing which columns appear in the result
- DChoosing which rows satisfy a given condition
5.Medium
Which statement about HAVING is correct?
- AIt sorts the results
- BIt cannot be used with GROUP BY
- CIt can use aggregate functions to filter groups
- DIt must come before WHERE in the SELECT statement
6.Medium
A column holds the values 10, 20 and NULL. What does AVG(col) return?
- A10
- B30
- C15
- DNULL
7.Hard
What is the result of SELECT COUNT(col) FROM t if all values in col are NULL and the table has 10 rows?
- ANULL
- B0
- CAn error
- D10
8.Hard
Why do many DBMSs use strict two-phase locking, holding exclusive locks until commit?
- AIt makes deadlocks impossible
- BIt prevents cascading aborts, because nobody can read uncommitted writes
- CIt allows transactions to read dirty data safely
- DIt removes the need for a transaction log
Answer key
- 1. C · Exactly one character
- 2. D · LIMIT 10
- 3. D · COUNT
- 4. C · Choosing which columns appear in the result
- 5. C · It can use aggregate functions to filter groups
- 6. C · 15
- 7. B · 0
- 8. B · It prevents cascading aborts, because nobody can read uncommitted writes
Full step-by-step solutions: practise this topic on examproblems.com.