PRACTICE • LEARN • GROW
Module 8 Final Quiz: Concurrency Control & Locking MCQs
Solve topic-wise placement questions and improve your skills.
Module 8 Final Quiz: Concurrency Control & Locking Progress
0 of 11 completed
0%
Topic Track
You are viewing MCQs in preview mode. Log in to select options, submit answers, and track your progress.
Log In to Answer
1
What is a Dirty Read anomaly?
A.
Reading data from a corrupted disk drive
B.
Transaction A modifies a row without committing; Transaction B reads that uncommitted modified row; Transaction A then ABORTS (rolls back)
C.
Reading a row that has a NULL value
D.
Reading data over an unencrypted WiFi connection
Explanation & Key
Correct Answer:
2
What is a Non-Repeatable Read (Fuzzy Read) anomaly?
A.
A query that returns an error when executed twice
B.
Transaction A reads a row; Transaction B modifies or deletes that row and COMMITS; Transaction A reads the row again and observes a different value
C.
A transaction inserting duplicate rows
D.
A server running out of RAM buffer space
Explanation & Key
Correct Answer:
3
What is a Phantom Read anomaly?
A.
Reading data deleted 10 years ago
B.
Transaction A executes a range query (e.g. salary > 50k); Transaction B INSERTS a new row satisfying that predicate and COMMITS; Transaction A re-runs the range query and sees new 'phantom' rows
C.
A crash caused by ghost memory pointers
D.
A read that takes 0 milliseconds
Explanation & Key
Correct Answer:
4
Which ANSI SQL isolation level prevents Dirty Reads and Non-Repeatable Reads, but may still permit Phantom Reads?
A.
Read Uncommitted
B.
Read Committed
C.
Repeatable Read
D.
Serializable
Explanation & Key
Correct Answer:
5
Which SQL isolation level guarantees complete freedom from all concurrency anomalies by making execution equivalent to serial execution?
A.
Read Committed
B.
Serializable
C.
Repeatable Read
D.
Snapshot Isolation
Explanation & Key
Correct Answer:
6
What are the rules of Shared (S) and Exclusive (X) lock compatibility?
A.
S locks conflict with S locks; X locks do not
B.
Multiple transactions can concurrently hold Shared (S) locks on an item; but an Exclusive (X) lock conflicts with both S and X locks (strictly 1 holder)
C.
X locks can only be held by the DBA
D.
S locks can only be used on primary keys
Explanation & Key
Correct Answer:
7
What is the defining rule of the Two-Phase Locking (2PL) protocol?
A.
Transactions must execute in two separate database servers
B.
A transaction executes in two distinct phases: a Growing Phase (where locks are acquired and NO lock can be released) and a Shrinking Phase (where locks are released and NO lock can be acquired)
C.
Every transaction must be committed twice
D.
Locks are held for exactly 2 seconds
Explanation & Key
Correct Answer:
8
What is the difference between Strict 2PL and Rigorous 2PL?
A.
Strict 2PL only locks tables; Rigorous 2PL locks columns
B.
Strict 2PL holds all Exclusive (X) locks until transaction termination (COMMIT/ABORT); Rigorous 2PL holds ALL locks (both S and X) until transaction termination
C.
Rigorous 2PL does not prevent cascading aborts; Strict 2PL does
D.
Strict 2PL does not use locks
Explanation & Key
Correct Answer:
9
In the Wait-Die deadlock prevention scheme (where older transactions have smaller timestamps), what happens if an Older transaction requests a resource held by a Younger transaction?
A.
The older transaction dies
B.
The older transaction is allowed to WAIT ($TS(T_{old}) < TS(T_{young})$)
C.
The younger transaction is killed immediately
D.
Both transactions commit
Explanation & Key
Correct Answer:
10
In the Wound-Wait deadlock prevention scheme, what happens if an Older transaction requests a resource held by a Younger transaction?
A.
The older transaction waits
B.
The older transaction 'wounds' (preempts/aborts) the younger transaction, taking the resource immediately ($TS(T_{old}) < TS(T_{young})$)
C.
Both transactions are suspended
D.
The younger transaction ignores the request
Explanation & Key
Correct Answer:
11
How does Thomas' Write Rule modify the standard Timestamp Ordering protocol?
A.
It requires all writes to be timestamped with UTC time
B.
If transaction $T_i$ attempts to write data item $Q$ but its timestamp is older than $Q$'s write timestamp ($TS(T_i) < W\text{-}timestamp(Q)$), the write is simply IGNORED rather than aborting $T_i$
C.
It eliminates read timestamps completely
D.
It forces transactions to write in reverse chronological order
Explanation & Key
Correct Answer:
Question Palette
Answered
Current
Not Attempted
Wrong