1.Easy
GRANT and REVOKE belong to which part of SQL?
- AData Manipulation Language (DML)
- BData Definition Language (DDL)
- CData Control Language (DCL)
- DData Query Language (DQL)
2.Easy
Which statement deletes a whole table, including its structure?
- AREMOVE TABLE
- BTRUNCATE ROWS
- CDELETE FROM
- DDROP TABLE
3.Easy
Which rows does WHERE price BETWEEN 10 AND 20 select?
- ARows with price equal to 10 or 20 only
- BRows with price outside the range 10 to 20
- CRows with price from 10 to 20, including 10 and 20
- DRows with price above 10 and below 20, excluding 10 and 20
4.Medium
Which statement about HAVING is correct?
- AIt must come before WHERE in the SELECT statement
- BIt cannot be used with GROUP BY
- CIt sorts the results
- DIt can use aggregate functions to filter groups
5.Medium
What does ROLLBACK TO SAVEPOINT s1 do?
- AUndoes the changes made after savepoint s1, keeping the transaction open
- BDeletes the savepoint and all tables changed since then
- CEnds the transaction and commits everything
- DUndoes the whole transaction from the beginning
6.Medium
What is a dirty read?
- AReading the same row twice and getting the same value
- BReading data without a WHERE clause
- CReading data from a corrupted disk
- DReading data written by another transaction that has not yet committed
7.Hard
What is a phantom read?
- AA repeated query returns new rows inserted by another committed transaction
- BReading data that was never written
- CReading uncommitted changes
- DA query that returns no rows
8.Hard
What does the write-ahead logging (WAL) rule require?
- AA change's log record must reach stable storage before the changed data page does
- BEvery query must be logged before it is parsed
- CData pages must be written before the log
- DThe log is written only after a crash
Answer key
- 1. C · Data Control Language (DCL)
- 2. D · DROP TABLE
- 3. C · Rows with price from 10 to 20, including 10 and 20
- 4. D · It can use aggregate functions to filter groups
- 5. A · Undoes the changes made after savepoint s1, keeping the transaction open
- 6. D · Reading data written by another transaction that has not yet committed
- 7. A · A repeated query returns new rows inserted by another committed transaction
- 8. A · 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.