1.Easy
In a LIKE pattern, what does the % wildcard stand for?
- AExactly one character in that position of the string
- BAny single digit
- CThe end of the string
- DAny sequence of zero or more characters
2.Easy
Which aggregate function returns the average of a numeric column?
- AAVG
- BMEDIAN
- CSUM
- DMEAN
3.Easy
How does UNION ALL differ from UNION?
- AUNION ALL removes duplicate rows
- BUNION ALL sorts the result
- CUNION ALL only works on one table
- DUNION ALL keeps duplicate rows
4.Medium
A column holds the values 10, 20 and NULL. What does AVG(col) return?
- A10
- BNULL
- C15
- D30
5.Medium
In relational algebra, the selection operator (σ) corresponds to which SQL clause?
- AWHERE
- BGROUP BY
- CSELECT list
- DORDER BY
6.Medium
Third normal form (3NF) removes:
- AAtomic values
- BRedundant indexes on columns that are not part of a key
- CTransitive dependencies between non-key attributes
- DComposite keys
7.Hard
Transaction T1 locks row A and waits for row B, while T2 locks row B and waits for row A. What does a typical DBMS do?
- AMerges the two transactions into one
- BLets both transactions wait until one of them commits normally
- CDetects the deadlock and aborts one transaction as the victim
- DCommits both transactions at once
8.Hard
What does the write-ahead logging (WAL) rule require?
- AThe log is written only after a crash
- BData pages must be written before the log
- CA change's log record must reach stable storage before the changed data page does
- DEvery query must be logged before it is parsed
Answer key
- 1. D · Any sequence of zero or more characters
- 2. A · AVG
- 3. D · UNION ALL keeps duplicate rows
- 4. C · 15
- 5. A · WHERE
- 6. C · Transitive dependencies between non-key attributes
- 7. C · Detects the deadlock and aborts one transaction as the victim
- 8. C · A change's log record must reach stable storage before the changed data page does
Full step-by-step solutions: practise this topic on examproblems.com.