1.
Transaction Properties (ACID)
Q1. A transaction modifies two accounts: it debits ₹500 from Account A and credits ₹500 to
Account B. Due to a system crash after debiting Account A but before crediting Account B, the
database is left inconsistent. Which ACID property is violated?
● A) Atomicity
● B) Consistency
● C) Isolation
● D) Durability
Answer: A) Atomicity
Explanation: Atomicity ensures that all operations within a transaction are completed; if not, the
transaction is aborted.
2. Concurrency Control and Schedules
Q2. Given the following schedule:Courses at Washington University+1Sanfoundry+1
● T1: Read(A), Write(A)
● T2: Read(A), Write(A)Courses at Washington University+3Testbook+3Testbook+3
Assuming no concurrency control, what anomaly can occur?
● A) Lost Update
● B) Dirty Read
● C) Non-repeatable Read
● D) Phantom Read
Answer: A) Lost Update
Explanation: Both transactions read and write the same data item without isolation, leading to
one update being overwritten.
3. Serializability
Q3. Which of the following schedules is conflict-serializable?
● A) T1: Read(A), Write(A); T2: Read(B), Write(B)
● B) T1: Read(A), Write(A); T2: Read(A), Write(A)
● C) T1: Read(A), Write(B); T2: Read(B), Write(A)
● D) T1: Read(A), Write(B); T2: Read(B), Write(C)
Answer: A) T1: Read(A), Write(A); T2: Read(B), Write(B)
Explanation: Since T1 and T2 operate on different data items, their operations do not conflict,
making the schedule conflict-serializable.
4. Two-Phase Locking (2PL)
Q4. In the Two-Phase Locking protocol, which phase allows the release of locks?
● A) Growing Phase
● B) Shrinking Phase
● C) Both Phases
● D) Neither Phase
Answer: B) Shrinking Phase
Explanation: In 2PL, a transaction releases locks only during the shrinking phase after
acquiring all needed locks in the growing phase.5. Deadlock Detection
Q5. Which of the following is a necessary condition for a deadlock to occur?
● A) Mutual Exclusion
● B) Preemption
● C) Circular Wait
● D) All of the above
Answer: D) All of the above
Explanation: Deadlock requires mutual exclusion, hold and wait, no preemption, and circular
wait conditions.
6. Timestamp-Based Concurrency Control
Q6. In timestamp ordering, if a transaction T1 has a timestamp TS(T1) and attempts to write to
data item Q, but TS(T1) < read_TS(Q), what action is taken?
● A) The write is allowed
● B) The transaction is aborted
● C) The transaction is delayed
● D) The transaction is committed
Answer: B) The transaction is aborted
Explanation: If TS(T1) < read_TS(Q), it indicates that a younger transaction has already read
the data, so T1 must be aborted to maintain consistency.
7. Recovery Techniques
Q7. In deferred update recovery technique, when are the changes written to the database?
● A) Immediately after each operation
● B) After the transaction starts
● C) After the transaction commits
● D) At scheduled intervals
Answer: C) After the transaction commits
Explanation: In deferred update, all changes are recorded in the log and applied to the
database only after the transaction commits.
8. Immediate Update Recovery
Q8. Which of the following is true about immediate update recovery technique?
● A) Changes are applied to the database after commit
● B) Undo and redo operations may be required
● C) Only redo operations are needed
● D) No logging is necessary
Answer: B) Undo and redo operations may be required
Explanation: Since changes are applied before commit, both undo (for uncommitted
transactions) and redo (for committed transactions) may be necessary.
9. Shadow Paging
Q9. What is the primary advantage of shadow paging in recovery?
● A) Requires complex logging
● B) Eliminates the need for undo operations
● C) Increases transaction throughput
● D) Simplifies concurrency control
Answer: B) Eliminates the need for undo operations
Explanation: Shadow paging maintains two page tables, allowing the system to revert to the
shadow copy in case of failure, thus avoiding undo operations.
10. Schedule Recoverability
Q10. Which of the following schedules is recoverable?
● A) T1 commits before T2 reads data written by T1
● B) T2 reads data written by T1, then T1 commits
● C) T2 commits before T1, which it read from, commits
● D) T2 reads data written by T1, then T1 aborts
Answer: B) T2 reads data written by T1, then T1 commits
Explanation: A schedule is recoverable if transactions commit only after the transactions whose
changes they read have committed.
11.
If T1 reads X and then T2 writes X before T1 completes, what kind of anomaly can occur?
● A) Lost Update
● B) Dirty Read
● C) Inconsistent Retrieval
● D) Write Skew
Answer: B) Dirty Read
12.
A schedule where T2 reads a value written by T1, but T1 later aborts, is considered:
● A) Recoverable
● B) Non-recoverable
● C) Serializable
● D) Strict
Answer: B) Non-recoverable
13.
Which locking protocol ensures serializability but does not guarantee deadlock freedom?
● A) Basic Two-Phase Locking
● B) Wait-die
● C) Timeout-based
● D) Timestamp ordering
Answer: A) Basic Two-Phase Locking
14.
Transaction T1 acquires a shared lock on data item A and T2 requests an exclusive lock on A.
What will happen?
● A) T2 gets the lock immediately
● B) T2 is blocked until T1 releases the lock
● C) T1 is aborted
● D) Both execute simultaneously
Answer: B) T2 is blocked until T1 releases the lock
15.
Which of the following is true for the Wait-Die scheme?
● A) Older transaction waits for younger
● B) Older transaction is aborted
● C) Younger transaction waits for older
● D) Deadlock is not avoided
Answer: A) Older transaction waits for younger
16.
Which type of schedule is always serializable?
● A) Cascadeless
● B) Conflict-serializable
● C) Strict
● D) View-serializable
Answer: C) Strict
17.
If a transaction must release all its locks only after it finishes, it follows:
● A) Conservative 2PL
● B) Strict 2PL
● C) Basic 2PL
● D) Rigorous 2PL
Answer: D) Rigorous 2PL
18.
If a transaction writes to a data item and another transaction reads it before the first one
commits, it’s called:
● A) Dirty Read
● B) Non-repeatable Read
● C) Phantom Read
● D) Write Skew
Answer: A) Dirty Read
19.
Which concurrency control method assigns a unique timestamp to each transaction to maintain
serializability?
● A) Wait-die
● B) Timestamp Ordering
● C) Graph-based protocol
● D) Deadlock Prevention
Answer: B) Timestamp Ordering
20.
Which condition is not required for a deadlock?
● A) Circular Wait
● B) Hold and Wait
● C) Resource Preemption
● D) Mutual Exclusion
Answer: C) Resource Preemption
21.
If two transactions are holding locks and waiting for each other's data items, the system is said
to be in:
● A) Starvation
● B) Deadlock
● C) Race Condition
● D) Serial Execution
Answer: B) Deadlock
22.
Which recovery method uses before and after images in the log?
● A) Shadow Paging
● B) Deferred Update
● C) Immediate Update
● D) Write-Ahead Logging
Answer: C) Immediate Update
23.
In which technique is a new page table created during the transaction, and the original remains
unchanged?
● A) Deferred Update
● B) Shadow Paging
● C) Undo Logging
● D) Redo Logging
Answer: B) Shadow Paging
24.
Which concurrency anomaly occurs when a transaction reads the same row twice and gets
different values?
● A) Dirty Read
● B) Non-repeatable Read
● C) Phantom Read
● D) Lost Update
Answer: B) Non-repeatable Read
25.
Which schedule avoids cascading aborts?
● A) Non-recoverable schedule
● B) Recoverable schedule
● C) Cascadeless schedule
● D) Serializable schedule
Answer: C) Cascadeless schedule
26.
In timestamp ordering, what happens if a transaction tries to write to a data item that has
already been read by a newer transaction?
● A) The write proceeds
● B) The transaction waits
● C) The transaction is rolled back
● D) Timestamp is updated
Answer: C) The transaction is rolled back
27.
If a transaction fails after some of its changes have been made to the database, what must the
recovery manager do?
● A) Perform redo only
● B) Perform undo only
● C) Perform redo and undo
● D) Ignore the failure
Answer: C) Perform redo and undo
28.
Which of the following is a disadvantage of Shadow Paging?
● A) No atomicity
● B) Poor concurrency
● C) High overhead for page copying
● D) Requires undo/redo
Answer: C) High overhead for page copying
29.
Which lock is required before reading a data item?
● A) Exclusive lock
● B) Shared lock
● C) Write lock
● D) Phantom lock
Answer: B) Shared lock
30.
A transaction reads a set of rows that satisfy a WHERE clause. Another transaction inserts a
new row that would have satisfied that clause. This is:
● A) Dirty Read
● B) Phantom Read
● C) Lost Update
● D) Write Skew
Answer: B) Phantom Read
31.
Which of the following schedules is both conflict-serializable and recoverable?
● A) T1 reads A, T2 writes A, T1 commits
● B) T2 reads A, T1 writes A, T1 commits, T2 commits
● C) T1 writes A, T2 reads A, T1 commits, T2 commits
● D) T1 reads A, T2 writes A, T2 commits, T1 commits
Answer: C) T1 writes A, T2 reads A, T1 commits, T2 commits
32.
Which of the following protocols avoids deadlock by not acquiring any locks?
● A) Timestamp ordering
● B) Two-phase locking
● C) Wait-die
● D) Wound-wait
Answer: A) Timestamp ordering
33.
In wound-wait scheme, what happens when a younger transaction requests a lock held by an
older one?
● A) The older one waits
● B) The younger is aborted
● C) The younger waits
● D) Deadlock occurs
Answer: B) The younger is aborted
34.
A transaction performing only read operations doesn't require:
● A) Shared locks
● B) Exclusive locks
● C) Timestamp
● D) Deadlock avoidance
Answer: B) Exclusive locks
35.
Which of the following ensures no dirty reads, non-repeatable reads, or phantom reads?
● A) Read Uncommitted
● B) Read Committed
● C) Repeatable Read
● D) Serializable
Answer: D) Serializable
36.
In which case does a redo operation become necessary during recovery?
● A) Transaction has not committed
● B) Log has only before images
● C) After images are present in log
● D) Deferred update technique is used
Answer: C) After images are present in log
37.
Which lock mode allows multiple transactions to access the same data item simultaneously?
● A) Exclusive
● B) Shared
● C) Intent Exclusive
● D) Recursive
Answer: B) Shared
38.
The principle of write-ahead logging ensures:
● A) Undo is done before redo
● B) Redo is done before undo
● C) Log is written before database is updated
● D) All locks are released before commit
Answer: C) Log is written before database is updated
39.
In strict 2PL, when are all locks released?
● A) Before commit
● B) During execution
● C) After commit
● D) After acquiring all locks
Answer: C) After commit
40.
Which technique guarantees atomicity but has poor performance for long transactions?
● A) Deferred Update
● B) Shadow Paging
● C) Write-Ahead Logging
● D) 2PL
Answer: B) Shadow Paging
41.
Transaction T1 writes to X. Before T1 commits, T2 reads X. What property is violated?
● A) Atomicity
● B) Isolation
● C) Durability
● D) Consistency
Answer: B) Isolation
Explanation: T2 reading uncommitted data from T1 violates isolation, leading to a dirty read
anomaly.
42.
Which recovery mechanism avoids undo operations altogether?
● A) Immediate Update
● B) Shadow Paging
● C) Write-ahead Logging
● D) Checkpointing
Answer: B) Shadow Paging
Explanation: Shadow Paging preserves the original database page; if failure occurs, no undo
is needed since changes are only written upon commit.
43.
A schedule where every transaction reads only committed data and commits only after all others
it depends on have committed is:
● A) Cascading
● B) Strict
● C) Recoverable
● D) Serializable
Answer: C) Recoverable
Explanation: In a recoverable schedule, transactions commit only after the transactions they
read from commit.
44.
Which protocol guarantees both serializability and deadlock freedom?
● A) Strict 2PL
● B) Basic 2PL
● C) Timestamp Ordering
● D) Graph-based Locking
Answer: C) Timestamp Ordering
Explanation: Timestamp ordering uses logical timestamps to ensure transactions execute in
a serializable and deadlock-free manner.
45.
In the deferred update technique, when are changes applied to the database?
● A) As soon as the transaction executes
● B) After log writing
● C) Only after the transaction commits
● D) Before validation
Answer: C) Only after the transaction commits
Explanation: In deferred update, changes are delayed until commit, simplifying undo during
failure.
46.
Which of the following prevents phantom reads?
● A) Exclusive locks
● B) Strict 2PL
● C) Predicate locking
● D) Shared locks
Answer: C) Predicate locking
Explanation: Predicate locks lock the result of a query condition, preventing other
transactions from adding/removing matching rows (phantoms).
47.
Which statement is true about Strict 2PL?
● A) All locks are released after the transaction ends
● B) Read locks are released earlier than write locks
● C) Locks are never released
● D) Only read locks are used
Answer: A) All locks are released after the transaction ends
Explanation: In Strict 2PL, locks are held until the transaction either commits or aborts.
48.
Which of the following does not cause a schedule to be unrecoverable?
● A) T2 reads data written by uncommitted T1
● B) T1 aborts after T2 reads its write
● C) T2 commits before T1 commits
● D) T2 reads unmodified data from T1
Answer: D) T2 reads unmodified data from T1
Explanation: Reading unmodified data does not create dependency or violate recoverability.
49.
When two transactions conflict on a data item and their operations are not reordered to match a
serial execution, the schedule is:
● A) Serializable
● B) Conflict-serializable
● C) Non-serializable
● D) View-serializable
Answer: C) Non-serializable
Explanation: If operations cannot be reordered without violating dependency, the schedule is
non-serializable.
50.
Which of the following best describes durability in transactions?
● A) Changes are never lost once transaction starts
● B) Changes are visible to other transactions immediately
● C) Changes persist after commit even during a crash
● D) Transaction can be undone anytime
Answer: C) Changes persist after commit even during a crash
Explanation: Durability ensures committed changes survive system crashes.
51.
Which component is responsible for transaction recovery?
● A) Scheduler
● B) Buffer Manager
● C) Transaction Manager
● D) Recovery Manager
Answer: D) Recovery Manager
Explanation: The Recovery Manager tracks logs and ensures atomicity/durability after
crashes.
52.
Which schedule violates consistency but still appears conflict-serializable?
● A) Dirty read
● B) Lost update
● C) Write skew
● D) Non-repeatable read
Answer: C) Write skew
Explanation: Write skew can occur in conflict-serializable schedules, breaking consistency.
53.
In timestamp ordering, a transaction T issues a read(X), but TS(T) < WTS(X). What happens?
● A) Read proceeds
● B) T is aborted
● C) X is locked
● D) X is updated
Answer: B) T is aborted
Explanation: Since T is older and X has been written by a newer transaction, T must abort to
avoid inconsistency.
54.
Which type of locking strategy can be used to detect rather than prevent deadlock?
● A) Timeout-based
● B) Wait-for graph
● C) Wound-wait
● D) Wait-die
Answer: B) Wait-for graph
Explanation: Wait-for graph detects cycles to detect deadlocks after they occur.
55.
Which isolation level allows dirty reads?
● A) Read Committed
● B) Read Uncommitted
● C) Repeatable Read
● D) Serializable
Answer: B) Read Uncommitted
Explanation: Read Uncommitted allows a transaction to read data from uncommitted
transactions.
56.
A system uses undo logging. After a crash, what must be done?
● A) Redo all committed transactions
● B) Undo uncommitted transactions
● C) Redo uncommitted transactions
● D) Clear the log
Answer: B) Undo uncommitted transactions
Explanation: In undo logging, uncommitted updates are rolled back.
57.
Which of the following is not ensured by the two-phase locking protocol?
● A) Serializability
● B) Deadlock freedom
● C) Isolation
● D) Concurrency control
Answer: B) Deadlock freedom
Explanation: 2PL ensures serializability but does not prevent deadlocks.
58.
Transaction T is older and tries to write to a locked data item held by a younger transaction. In
wound-wait, what will happen?
● A) T waits
● B) Younger transaction is aborted
● C) Deadlock
● D) Timeout
Answer: B) Younger transaction is aborted
Explanation: In wound-wait, the older transaction "wounds" the younger one to prevent
deadlock.
59.
In immediate update systems, which operation must occur before updating the database?
● A) Release of locks
● B) Log record written
● C) Checkpointing
● D) Undo all previous operations
Answer: B) Log record written
Explanation: Write-ahead logging requires log records be written before database updates in
immediate update systems.
60.
Which recovery approach simplifies crash handling but has high space overhead?
● A) Immediate Update
● B) Deferred Update
● C) Shadow Paging
● D) Undo-Redo Logging
Answer: C) Shadow Paging
Explanation: Shadow Paging eliminates undo/redo but requires page copies, increasing
space usage.
61.
Which operation sequence violates conflict serializability?
● A) T1: R(X), T2: R(X)
● B) T1: W(X), T2: R(X)
● C) T1: R(X), T2: W(X)
● D) T1: W(X), T2: W(X)
Answer: D) T1: W(X), T2: W(X)
Explanation: Two write operations on the same item by different transactions create a
conflict and can violate serializability if the order is not preserved.
62.
Which of the following is most likely to cause a write skew?
● A) Two-phase locking
● B) Serializable isolation
● C) Snapshot isolation
● D) Read committed isolation
Answer: C) Snapshot isolation
Explanation: Snapshot isolation can lead to write skew, a phenomenon where concurrent
transactions see consistent snapshots but their combined effect breaks integrity.
63.
In strict schedules, what is always true?
● A) Read and write locks are acquired before use
● B) Unlocking happens after transaction ends
● C) All reads are allowed before writes
● D) Transactions do not use locks
Answer: B) Unlocking happens after transaction ends
Explanation: In strict schedules, locks are held until commit/abort, preventing cascading
aborts.
64.
Which of the following is a non-conflicting operation?
● A) T1: W(X), T2: W(X)
● B) T1: R(X), T2: W(X)
● C) T1: R(X), T2: R(X)
● D) T1: W(X), T2: R(X)
Answer: C) T1: R(X), T2: R(X)
Explanation: Read-read operations on the same data item do not conflict and can execute
concurrently.
65.
Which property ensures that a failure during a transaction doesn't leave the database in an
inconsistent state?
● A) Durability
● B) Isolation
● C) Consistency
● D) Atomicity
Answer: D) Atomicity
Explanation: Atomicity ensures that either all or none of the transaction executes, avoiding
partial changes.
66.
A transaction reads the same item twice but gets different values. This violates:
● A) Durability
● B) Repeatable Read
● C) Serializable
● D) Deadlock
Answer: B) Repeatable Read
Explanation: Repeatable read ensures that once a transaction reads an item, it sees the
same value throughout.
67.
Which anomaly occurs when two transactions read the same data and both update based on
the original value?
● A) Lost update
● B) Dirty read
● C) Phantom read
● D) Inconsistent read
Answer: A) Lost update
Explanation: In a lost update, one transaction’s update gets overwritten by another due to
lack of synchronization.
68.
Which one of the following is a prevention-based deadlock handling strategy?
● A) Wait-for graph
● B) Timeout
● C) Wait-die
● D) Deadlock detection
Answer: C) Wait-die
Explanation: Wait-die is a deadlock prevention technique using timestamps. Younger
transactions abort rather than wait for older ones.
69.
In which case will a transaction be rolled back in timestamp ordering?
● A) TS(T) > WTS(X)
● B) TS(T) < RTS(X) for a write
● C) TS(T) > RTS(X) for a read
● D) TS(T) = TS(X)
Answer: B) TS(T) < RTS(X) for a write
Explanation: A write by an older transaction after a newer transaction has read the data is
not allowed. Hence, rollback.
70.
Which is a major drawback of the two-phase locking protocol?
● A) Allows dirty reads
● B) May lead to starvation
● C) Can cause deadlock
● D) Not serializable
Answer: C) Can cause deadlock
Explanation: Though 2PL ensures serializability, it may cause deadlock due to waiting
dependencies.
71.
Which technique ensures both serializability and recoverability?
● A) Strict 2PL
● B) Read committed
● C) Shadow Paging
● D) Snapshot Isolation
Answer: A) Strict 2PL
Explanation: Strict 2PL enforces both conflict serializability and recoverability by holding
locks until the end.
72.
Which type of schedule permits cascading rollbacks?
● A) Recoverable schedule
● B) Strict schedule
● C) Cascadeless schedule
● D) Non-recoverable schedule
Answer: A) Recoverable schedule
Explanation: Recoverable schedules allow cascading rollbacks but ensure that no
transaction commits if it reads from uncommitted ones.
73.
In a serial schedule, the transactions are executed:
● A) Concurrently
● B) Overlapping with some delay
● C) One after the other without interleaving
● D) Randomly
Answer: C) One after the other without interleaving
Explanation: A serial schedule executes transactions in a strict sequence — no interleaving.
74.
The write-ahead logging protocol ensures:
● A) Logs are written after data pages
● B) Logs are written only on commit
● C) Logs are written before data is updated
● D) No logging is needed if rollback occurs
Answer: C) Logs are written before data is updated
Explanation: WAL guarantees that the system can recover using logs in case of failure.
75.
What is the checkpoint in transaction recovery?
● A) A command to start a transaction
● B) A point to restart log scanning after crash
● C) A temporary data buffer
● D) Undo buffer flush
Answer: B) A point to restart log scanning after crash
Explanation: Checkpointing reduces recovery time by marking a safe point in logs.
76.
Which statement about phantom reads is true?
● A) They involve reading stale values
● B) They involve duplicate reads
● C) They occur when new rows satisfy the WHERE clause
● D) They occur during dirty writes
Answer: C) They occur when new rows satisfy the WHERE clause
Explanation: Phantom reads occur when a query returns a different set of rows due to inserts
by another transaction.
77.
Which one is NOT a valid serializable schedule?
● A) One that results in same final DB state as a serial one
● B) One where all operations can be reordered into a serial order
● C) One with no conflicts between any operations
● D) One where reads always happen before writes
Answer: D) One where reads always happen before writes
Explanation: Serializable schedules are not defined by read-before-write ordering but by
conflict-free reordering.
78.
Which one of the following is least likely to lead to a deadlock?
● A) Circular waits
● B) Waiting due to exclusive locks
● C) Transactions locking resources without releasing
● D) Read-only transactions
Answer: D) Read-only transactions
Explanation: Read-only transactions use shared locks and typically don't block others, so
deadlocks are rare.
79.
Which concurrency control mechanism supports greater concurrency but risks
inconsistencies?
● A) Serializable
● B) Repeatable Read
● C) Read Committed
● D) Read Uncommitted
Answer: D) Read Uncommitted
Explanation: Read Uncommitted allows maximum concurrency but also dirty reads and
anomalies.
80.
What’s the key difference between view serializability and conflict serializability?
● A) Conflict serializability is stricter
● B) View serializability requires locking
● C) Conflict serializability allows more schedules
● D) Both are identical
Answer: A) Conflict serializability is stricter
Explanation: All conflict-serializable schedules are view-serializable, but not vice versa.
81.
Which schedule below may be non-recoverable?
● A) T1: W(X), T2: R(X), T1: Commit, T2: Commit
● B) T1: W(X), T2: R(X), T2: Commit, T1: Abort
● C) T1: R(X), T2: W(X), T1: Commit, T2: Commit
● D) T1: W(X), T2: R(Y), T1: Commit, T2: Commit
Answer: B) T1: W(X), T2: R(X), T2: Commit, T1: Abort
Explanation: T2 reads uncommitted data from T1 and commits before T1, violating
recoverability.
82.
Which of the following ensures no cascading rollbacks?
● A) Recoverable schedule
● B) Cascadeless schedule
● C) View-serializable schedule
● D) Deadlock-free schedule
Answer: B) Cascadeless schedule
Explanation: In cascadeless schedules, transactions read only committed data, avoiding
cascading aborts.
83.
Which operation leads to a dirty read?
● A) A transaction reading committed data from another
● B) A transaction reading from its own writes
● C) A transaction reading data written by an uncommitted transaction
● D) A transaction writing without checking locks
Answer: C) A transaction reading data written by an uncommitted transaction
Explanation: This can lead to incorrect decisions and rollback propagation.
84.
In deferred update recovery, changes are:
● A) Written immediately to disk
● B) Kept in memory until commit
● C) Reflected in log after every write
● D) Applied partially on abort
Answer: B) Kept in memory until commit
Explanation: Deferred update avoids writing to the DB until commit, making undo
unnecessary.
85.
In which situation is UNDO necessary?
● A) All updates are deferred
● B) The transaction commits
● C) A failure occurs before commit
● D) A checkpoint is created
Answer: C) A failure occurs before commit
Explanation: UNDO is needed to rollback uncommitted changes after a crash or abort.
86.
What’s the impact of phantom reads?
● A) Same row read multiple times
● B) Row value changes during a transaction
● C) New rows appear in re-executed queries
● D) Old row values are restored on rollback
Answer: C) New rows appear in re-executed queries
Explanation: Phantom reads are inserts by other transactions causing different query results.
87.
Which is true about strict two-phase locking?
● A) All locks are released after growing phase
● B) Read and write locks can be released separately
● C) No lock is released until commit or abort
● D) Shared locks are always released first
Answer: C) No lock is released until commit or abort
Explanation: This ensures serializability and recoverability.
88.
A transaction is rolled back by the system. This is most likely due to:
● A) Deadlock prevention
● B) Completion of execution
● C) Log truncation
● D) Phantom reads
Answer: A) Deadlock prevention
Explanation: To resolve deadlock, one of the transactions may be aborted and rolled back.
89.
Which ensures that a transaction reads the latest committed value?
● A) Read Uncommitted
● B) Read Committed
● C) Repeatable Read
● D) Serializable
Answer: B) Read Committed
Explanation: It allows reading only committed data, preventing dirty reads.
90.
Which condition is not necessary for deadlock to occur?
● A) Mutual exclusion
● B) Hold and wait
● C) Preemption
● D) Circular wait
Answer: C) Preemption
Explanation: Preemption is the absence of a condition required for deadlock. It's a solution,
not a cause.
91.
In timestamp ordering, what happens if TS(T) < RTS(X) during a write?
● A) Transaction writes
● B) Transaction reads
● C) Transaction is aborted
● D) RTS(X) is updated
Answer: C) Transaction is aborted
Explanation: A younger transaction has already read the value, so older one cannot write.
92.
Which recovery method requires no undo?
● A) Deferred update
● B) Immediate update
● C) Shadow paging
● D) Write-ahead logging
Answer: C) Shadow paging
Explanation: Old pages are preserved, and new pages replace only upon commit—no undo
needed.
93.
What is the role of log-based recovery?
● A) Tracking transaction order
● B) Tracking user sessions
● C) Recording changes for recovery
● D) Managing locks and timestamps
Answer: C) Recording changes for recovery
Explanation: Logs store transaction actions for rollback or redo in case of crash.
94.
A transaction reads X and writes to Y. Another writes X. What schedule type could this lead to?
● A) View equivalent
● B) Cascading rollback
● C) Phantom anomaly
● D) Deadlock
Answer: B) Cascading rollback
Explanation: If T1 reads uncommitted X from T2 and T2 aborts, T1 must rollback too.
95.
Which lock mode combination on same item leads to a conflict?
● A) S & S
● B) X & X
● C) S & Intent-S
● D) S & X
Answer: D) S & X
Explanation: A shared and exclusive lock on the same item causes a conflict, blocking
access.
96.
In serial schedules, which is true?
● A) They always result in higher throughput
● B) They reduce concurrency
● C) They allow dirty reads
● D) They allow deadlocks
Answer: B) They reduce concurrency
Explanation: Serial schedules execute one transaction at a time, reducing concurrency but
avoiding anomalies.
97.
Which anomaly is avoided by Repeatable Read but not by Read Committed?
● A) Dirty Read
● B) Non-repeatable Read
● C) Phantom Read
● D) Lost Update
Answer: B) Non-repeatable Read
Explanation: Repeatable Read prevents changes to rows already read, but not phantoms.
98.
What’s the first action after system crash recovery?
● A) Clear buffer pool
● B) Restore from last checkpoint
● C) Reboot log manager
● D) Abort all transactions
Answer: B) Restore from last checkpoint
Explanation: The system starts log scanning from the last checkpoint for efficient recovery.
99.
Which of these reduces log scanning time during recovery?
● A) Log compression
● B) Checkpointing
● C) Buffer flushing
● D) Page swapping
Answer: B) Checkpointing
Explanation: Checkpoints provide a known good state and reduce the amount of log to
process.
100.
Which is not guaranteed by Read Committed isolation level?
● A) No dirty reads
● B) No lost updates
● C) No non-repeatable reads
● D) Greater concurrency
Answer: C) No non-repeatable reads
Explanation: Read Committed allows different values on re-read of same item, hence
non-repeatable reads are possible.