CodeStudy.net
Toggle Menu
Home
Online Java Compiler
Tutorials
Java Tutorial
Python Tutorial
SQL Database Design
Blog
All Posts
Transactions and Concurrency Control
Assess your understanding of ACID properties and locking mechanisms.
1. Which ACID property ensures that a transaction is either fully executed (committed) or, if it fails, completely undone (rolled back)?
Atomicity
Consistency
Isolation
Durability
2. Which of the following are concurrency anomalies that can occur when transactions execute concurrently without proper control?
Dirty read
Non-repeatable read
Phantom read
Cache hit
3. The Serializable isolation level is the highest level defined by the SQL standard, preventing all concurrency anomalies.
True
False
4. What is the acronym for the four key properties that ensure reliable database transactions? (all caps)
5. A transaction reads a data item, another transaction modifies and commits that item, and the first transaction re-reads the item to find a different value. What concurrency problem is this?
Dirty read
Non-repeatable read
Phantom read
Deadlock
6. Which of the following are concurrency control protocols used to manage concurrent transactions?
Two-Phase Locking (2PL)
Timestamp Ordering
Optimistic Concurrency Control
Binary Search Tree
7. Optimistic concurrency control assumes that conflicts between transactions are frequent and thus acquires locks early.
True
False
8. What does the acronym '2PL' stand for in the context of concurrency control protocols?
9. Which isolation level allows a transaction to read uncommitted changes made by another transaction, potentially leading to dirty reads?
Read Uncommitted
Read Committed
Repeatable Read
Serializable
10. Select all the properties that are part of the ACID properties of database transactions.
Atomicity
Consistency
Isolation
Durability
Availability
11. A deadlock occurs when a transaction holds a lock and waits for another lock, while another transaction holds the second lock and waits for the first, causing both to stall indefinitely.
True
False
12. Name the concurrency problem where a transaction executes a query, another transaction inserts new rows that match the query, and the first transaction re-executes the query to find additional rows.
13. Which concurrency control protocol involves two distinct phases: a growing phase where locks are acquired and no locks are released, followed by a shrinking phase where locks are released and no new locks are acquired?
Two-Phase Locking
Timestamp Ordering
Optimistic Concurrency Control
Multiversion Concurrency Control
14. Which of the following isolation levels typically prevent phantom reads, according to the SQL standard?
Read Uncommitted
Read Committed
Repeatable Read
Serializable
15. The Consistency property in ACID ensures that a transaction preserves all defined database constraints, transforming the database from one valid state to another.
True
False
Reset
Answered 0 of 0 — 0 correct