Transactions & Concurrency
JKSSB Sub-Inspector (Telecommunication) · Database Management Systems · 18 practice questions with answers and explanations: 9 Easy, 9 Medium, 0 Hard.
Sample questions
Sample Easy question 1
A transaction is:
- A type of index
- A single table
- A logical unit of work made of one or more database operations
- A backup file
Show answer
Answer: C. For example, a bank transfer is one transaction made of a debit and a credit.
Sample Easy question 2
Which problem occurs when two transactions overwrite each other's updates to the same item?
- Dirty write protection
- Lost update
- Deadlock prevention
- Phantom row
Show answer
Answer: B. Without proper locking, one update is silently lost.
Sample Easy question 3
In the context of locks, which one allows several transactions to read an item but none to write it?
- Exclusive lock
- Intent lock alone
- Shared lock
- Gap lock alone
Show answer
Answer: C. A shared (read) lock is compatible with other shared locks, unlike an exclusive (write) lock.
Sample Medium question 4
What does a SAVEPOINT allow in a transaction?
- Saving the table as a file
- Committing every future change
- Rolling back to a chosen point without undoing the whole transaction
- Locking the entire database
Show answer
Answer: C. ROLLBACK TO savepoint undoes only the later work.
Sample Medium question 5
A schedule is 'serializable' if its result is equivalent to:
- Running alone the first transaction
- Running all transactions at the same instant
- Some serial (one-after-another) execution of the same transactions
- Running the transactions in random order, whatever the result
Show answer
Answer: C. Serializability is the standard correctness criterion for concurrent schedules.
Sample Medium question 6
What does the 'WAL' (write-ahead logging) rule require?
- Data pages must be written before the log
- Every write must be followed by a read
- Log records must be written to stable storage before the changed data pages
- No log is needed if backups exist
Show answer
Answer: C. WAL gives durability and the ability to undo or redo changes after a crash.