Transactions & Concurrency Control MCQs with Answers
What is the primary purpose of a transaction in a database system?
a) To store data
b) To ensure data consistency
c) To improve query performance
d) To manage backup schedules
Which of the following is a key property of transactions in a database system?
a) Atomicity
b) Redundancy
c) Data compression
d) Normalization
What does the “Consistency” property of a transaction ensure?
a) A transaction will complete or not complete at all
b) Data will remain in a consistent state before and after the transaction
c) A transaction will be isolated from others
d) A transaction will execute without any errors
What is the “Isolation” property of a transaction?
a) It ensures a transaction is independent of other concurrent transactions
b) It ensures a transaction is always in a consistent state
c) It ensures a transaction will be logged
d) It ensures a transaction will be committed only if it succeeds
Which of the following is a consequence of violating the “Durability” property of a transaction?
a) Data can be modified by other transactions
b) A transaction’s changes may be lost after a system failure
c) Data consistency is compromised
d) Transactions cannot be rolled back
Which isolation level provides the highest level of concurrency control?
a) Serializable
b) Read Uncommitted
c) Repeatable Read
d) Read Committed
Which of the following is an example of concurrency control in a database?
a) Indexing
b) Locking mechanisms
c) Data normalization
d) Query optimization
What is the primary purpose of locking in a database?
a) To improve query performance
b) To prevent multiple transactions from modifying the same data simultaneously
c) To backup data during transactions
d) To increase the database size
Which of the following types of locks allows multiple transactions to read data but prevents any transaction from modifying it?
a) Shared lock
b) Exclusive lock
c) Read lock
d) Write lock
Which concurrency issue occurs when two transactions are executed concurrently and both access the same data item?
a) Dirty read
b) Lost update
c) Non-repeatable read
d) Phantom read
Which type of concurrency control guarantees that no transaction can interfere with the operations of another transaction?
a) Lock-based control
b) Optimistic control
c) Timestamp-based control
d) Two-phase locking
What is the purpose of the “READ COMMITTED” isolation level?
a) To allow dirty reads
b) To ensure data consistency without locking data
c) To prevent non-repeatable reads
d) To ensure that only committed data is read
Which of the following is an advantage of using the “Serializable” isolation level?
a) High concurrency
b) Maximum isolation of transactions
c) Faster transaction processing
d) Minimal locking overhead
What is a “dirty read” in the context of database transactions?
a) A transaction reading data that has not been committed yet
b) A transaction reading data that has already been committed
c) A transaction writing data to the database
d) A transaction that fails to execute properly
Which of the following is a disadvantage of the “Repeatable Read” isolation level?
a) It allows dirty reads
b) It results in lower concurrency
c) It guarantees no lost updates
d) It prevents phantom reads
Which of the following is an effect of a non-repeatable read?
a) A transaction reads the same data multiple times and gets different results
b) A transaction reads data that is never updated
c) A transaction reads the same data multiple times without any issue
d) A transaction cannot access any data until it is fully committed
What is the role of “two-phase locking” in concurrency control?
a) To ensure that transactions are not executed concurrently
b) To ensure transactions are isolated by acquiring locks before and releasing them after
c) To reduce the complexity of database transactions
d) To prevent transactions from being rolled back
Which of the following is true for the “Read Uncommitted” isolation level?
a) It prevents dirty reads
b) It allows dirty reads
c) It prevents non-repeatable reads
d) It guarantees transaction isolation
Which concurrency problem occurs when a transaction reads the same data multiple times and gets different results?
a) Lost update
b) Dirty read
c) Non-repeatable read
d) Phantom read
Which of the following is a property of the “Optimistic Concurrency Control” technique?
a) It assumes no conflict will occur during transaction execution
b) It locks data to prevent other transactions from accessing it
c) It prevents any data changes until all transactions are completed
d) It uses timestamps to maintain transaction order
What is the main disadvantage of the “Read Uncommitted” isolation level?
a) High concurrency
b) Allows dirty reads
c) Lower performance
d) Restricts data modifications
Which of the following is the main objective of concurrency control in databases?
a) To allow transactions to access the same data concurrently without affecting correctness
b) To speed up transaction processing
c) To minimize the use of indexes
d) To reduce the storage requirements of the database
What happens in a “phantom read” situation?
a) A transaction reads data that has not yet been committed
b) A transaction reads new rows inserted by other transactions after the initial read
c) A transaction reads the same data multiple times and gets different results
d) A transaction reads the same data multiple times without any issues
Which of the following is an advantage of “Serializable” isolation level?
a) High performance
b) Low concurrency
c) Prevents both dirty reads and non-repeatable reads
d) Minimizes lock contention
Which of the following isolation levels provides the least strict control over concurrent transactions?
a) Read Committed
b) Repeatable Read
c) Serializable
d) Read Uncommitted
What does the term “ACID” stand for in the context of transactions?
a) Atomicity, Consistency, Isolation, Durability
b) Access Control, Integration, Duplication, Serialization
c) Accuracy, Consistency, Integrity, Durability
d) Atomicity, Compression, Isolation, Duplication
Which of the following is NOT part of a transaction’s ACID properties?
a) Durability
b) Isolation
c) Normalization
d) Consistency
Which concurrency issue can be avoided by using “two-phase locking”?
a) Dirty read
b) Non-repeatable read
c) Lost update
d) Phantom read