HomeSubjectsUniversityBlogAbout

Concurrency Control

Topic in Databases

210 total MCQsShowing 30 with explanations10 Easy10 Medium10 Hard

About This Topic

Concurrency control is the set of DBMS techniques that let transactions run at the same time without producing results that differ from some serial execution. Lock-based questions dominate: shared and exclusive locks, the lock compatibility matrix, the lock table, and the growing and shrinking phases of two-phase locking, including strict and rigorous 2PL. Deadlock handling follows, with wait-for graphs, the non-preemptive wait-die scheme and the preemptive wound-wait scheme. You should also understand timestamp ordering and the Thomas write rule, optimistic validation-based protocols, multiversion concurrency control, multiple-granularity locking with intention locks, and the phantom problem.

Below are 30 practice questions from a pool of 210 Concurrency Control MCQs, one of 17 topics in Databases. Each shows the correct answer with an explanation; when you are ready, take a timed quiz to test recall under exam conditions.

Practice Questions

Each question below shows the correct answer with a full explanation. Use these to build conceptual understanding before attempting a timed quiz.

Concurrency ControlEasy

Q1. Concurrency control ensures:

  1. A.Larger storage capacity on the disk drives
  2. B.Better network speed between client nodes
  3. C.Faster hardware performance for the system
  4. D.Correct execution of concurrent transactions✓ Correct

Explanation

Concurrency control manages simultaneous transaction execution to maintain data consistency.

Report an error in this question

Concurrency ControlEasy

Q2. A lock in database concurrency control is:

  1. A.A mechanism to control access to a data item✓ Correct
  2. B.A backup method for protecting against loss
  3. C.A type of query for retrieving stored data
  4. D.A type of index for speeding up data search

Explanation

A lock is a mechanism that restricts access to a data item during concurrent execution.

Report an error in this question

Concurrency ControlEasy

Q3. A shared lock allows:

  1. A.Writing by multiple transactions to the same data item
  2. B.No access at all to the locked data item by any party
  3. C.Only one transaction to read the data item at any time
  4. D.Multiple transactions to read the data item simultaneously✓ Correct

Explanation

A shared (read) lock allows multiple transactions to read the data item concurrently.

Report an error in this question

Concurrency ControlEasy

Q4. An exclusive lock allows:

  1. A.Multiple transactions to write to the same data item
  2. B.Multiple transactions to read from the same data item
  3. C.Only one transaction to read and write the data item✓ Correct
  4. D.No operations at all on the locked data item by anyone

Explanation

An exclusive (write) lock gives sole access to the data item for reading and writing.

Report an error in this question

Concurrency ControlEasy

Q5. A deadlock in database systems occurs when:

  1. A.All transactions commit at the same time without any conflicts found
  2. B.A single transaction is very slow in completing its data operations
  3. C.Two or more transactions are waiting for each other to release locks✓ Correct
  4. D.No transactions are running in the database system at the moment

Explanation

A deadlock occurs when transactions form a cycle of lock dependencies, each waiting for another.

Report an error in this question

Concurrency ControlEasy

Q6. The Two-Phase Locking (2PL) protocol has two phases:

  1. A.Lock phase and Unlock phase only
  2. B.Growing phase and Shrinking phase✓ Correct
  3. C.Read phase and Write phase only
  4. D.Start phase and End phase only

Explanation

2PL has a growing phase (acquiring locks, no releases) and a shrinking phase (releasing locks, no acquisitions).

Report an error in this question

Concurrency ControlEasy

Q7. Which of the following can break a deadlock?

  1. A.Adding more locks to the waiting transactions
  2. B.Creating more indexes on the locked data items
  3. C.Aborting one of the deadlocked transactions✓ Correct
  4. D.Increasing the buffer size for the data manager

Explanation

Breaking a deadlock typically requires aborting (rolling back) one or more of the involved transactions.

Report an error in this question

Concurrency ControlEasy

Q8. Starvation in concurrency control occurs when:

  1. A.All transactions complete quickly without any delays or blocking
  2. B.A transaction waits indefinitely because others keep getting priority✓ Correct
  3. C.The database runs out of storage space on the physical disk
  4. D.No locks are used by any of the transactions in the database

Explanation

Starvation occurs when a transaction is repeatedly denied access to resources it needs.

Report an error in this question

Concurrency ControlEasy

Q9. A lock manager is responsible for:

  1. A.Designing schemas for new data models
  2. B.Creating tables in the database schema
  3. C.Writing SQL queries for data retrieval
  4. D.Granting and releasing locks on data items✓ Correct

Explanation

The lock manager handles lock requests, grants, and releases for concurrent transactions.

Report an error in this question

Concurrency ControlEasy

Q10. The lock compatibility matrix shows:

  1. A.How to create new tables in the database schema now
  2. B.Which lock types can coexist on the same data item✓ Correct
  3. C.The execution plans for all queries in the database
  4. D.Index structures for optimizing data retrieval speed

Explanation

The lock compatibility matrix indicates which lock modes are compatible with each other.

Report an error in this question

Concurrency ControlMedium

Q11. Strict Two-Phase Locking requires that:

  1. A.No locks are needed for any transaction under this locking protocol
  2. B.Only shared locks are used and exclusive locks are never acquired
  3. C.All exclusive locks are held until the transaction commits or aborts✓ Correct
  4. D.Locks can be released at any time during the transaction processing

Explanation

Strict 2PL holds all exclusive locks until transaction commit/abort to prevent cascading rollbacks.

Report an error in this question

Concurrency ControlMedium

Q12. Rigorous Two-Phase Locking requires:

  1. A.Locks are released immediately after each individual use
  2. B.All locks (shared and exclusive) are held until commit or abort✓ Correct
  3. C.Only exclusive locks are held until the transaction commits
  4. D.No growing phase exists in this locking protocol at all

Explanation

Rigorous 2PL holds all locks until commit/abort, ensuring strict serializability.

Report an error in this question

Concurrency ControlMedium

Q13. A wait-die deadlock prevention scheme:

  1. A.Allows younger transactions to wait; older ones are rolled back
  2. B.Allows older transactions to wait; younger ones are rolled back✓ Correct
  3. C.Prevents all waiting by immediately aborting every transaction
  4. D.Kills all transactions to resolve and prevent deadlock situations

Explanation

Wait-die: older transaction waits for younger; younger transaction requesting a lock held by older is rolled back.

Report an error in this question

Concurrency ControlMedium

Q14. A wound-wait deadlock prevention scheme:

  1. A.All transactions wait without any preemption at all now
  2. B.No preemption occurs under any circumstances in the system
  3. C.Older transactions preempt younger ones; younger ones wait✓ Correct
  4. D.Younger transactions preempt older ones; older ones wait

Explanation

Wound-wait: older transaction preempts (wounds) younger; younger requesting lock held by older must wait.

Report an error in this question

Concurrency ControlMedium

Q15. A deadlock detection algorithm uses:

  1. A.A hash table index
  2. B.A wait-for graph✓ Correct
  3. C.An ER diagram model
  4. D.A B-tree structure

Explanation

The wait-for graph tracks which transactions are waiting for which; a cycle indicates a deadlock.

Report an error in this question

Concurrency ControlMedium

Q16. Timestamp-based concurrency control assigns:

  1. A.Random access to data items without any order
  2. B.Locks to all data items accessed by transactions
  3. C.A unique timestamp to each transaction for ordering✓ Correct
  4. D.Priority based on the size of each transaction

Explanation

Timestamp ordering assigns each transaction a unique timestamp and uses it to determine serialization order.

Report an error in this question

Concurrency ControlMedium

Q17. In timestamp ordering, if a transaction tries to write a data item with a later read timestamp:

  1. A.The data item gets deleted
  2. B.The transaction is rolled back✓ Correct
  3. C.The read timestamp is updated
  4. D.The write proceeds normally

Explanation

If a transaction's timestamp is earlier than the data item's read timestamp, the write is rejected and the transaction rolls back.

Report an error in this question

Concurrency ControlMedium

Q18. Optimistic concurrency control assumes that:

  1. A.Conflicts are frequent and locks must always be acquired
  2. B.All transactions conflict and none can proceed at once
  3. C.No validation is needed at any point during processing
  4. D.Conflicts are rare, so validation is done at commit time✓ Correct

Explanation

Optimistic protocols assume conflicts are rare and validate transactions only when they try to commit.

Report an error in this question

Concurrency ControlMedium

Q19. The three phases of optimistic concurrency control are:

  1. A.Start, Process, End
  2. B.Read, Validation, Write✓ Correct
  3. C.Read, Write, Commit
  4. D.Lock, Execute, Unlock

Explanation

Optimistic control has Read (execute without locks), Validation (check for conflicts), and Write (apply changes).

Report an error in this question

Concurrency ControlMedium

Q20. Lock granularity refers to:

  1. A.The number of transactions in the system
  2. B.The type of query being currently executed
  3. C.The size of the data item that is locked✓ Correct
  4. D.The speed of acquiring locks on the item

Explanation

Lock granularity determines the size of the lockable unit: row, page, table, or database level.

Report an error in this question

Concurrency ControlHard

Q21. Multiple Granularity Locking uses intention locks. An Intention Shared (IS) lock means:

  1. A.No lower-level locks exist on any of the descendant nodes in the tree
  2. B.The item cannot be locked by any transaction under any circumstances
  3. C.A transaction intends to acquire shared locks on finer-granularity items✓ Correct
  4. D.A transaction has exclusively locked the entire item and all subitems

Explanation

IS lock indicates the transaction intends to set shared locks on descendant nodes in the lock hierarchy.

Report an error in this question

Concurrency ControlHard

Q22. An Intention Exclusive (IX) lock means:

  1. A.A transaction currently has a shared lock on the item and its subitems
  2. B.No locks are needed for any data items under this locking protocol
  3. C.A transaction intends to acquire exclusive locks on finer-granularity items✓ Correct
  4. D.The transaction is aborted because it cannot acquire the needed lock

Explanation

IX lock indicates the transaction intends to set exclusive locks on descendant (finer granularity) nodes.

Report an error in this question

Concurrency ControlHard

Q23. A Shared Intention Exclusive (SIX) lock means:

  1. A.No intention locks exist on any node in the hierarchy and all nodes are freely open
  2. B.The node is shared-locked and the transaction intends to exclusively lock finer items✓ Correct
  3. C.The node is exclusively locked by the transaction and no other can access it at all
  4. D.The transaction is complete and all locks have been released from every node here

Explanation

SIX combines a shared lock on the node with an intention to set exclusive locks on descendants.

Report an error in this question

Concurrency ControlHard

Q24. In the Thomas Write Rule (modification to timestamp ordering):

  1. A.Obsolete writes are ignored instead of causing rollback✓ Correct
  2. B.All writes cause rollback regardless of timestamp order
  3. C.Reads are ignored and only writes are processed by it
  4. D.Timestamps are not used in this modified protocol

Explanation

The Thomas Write Rule skips obsolete writes (where a newer write already exists) instead of rolling back the transaction.

Report an error in this question

Concurrency ControlHard

Q25. The phantom problem in locking can be solved by:

  1. A.Allowing dirty reads between queries
  2. B.Using only row-level locks in tables
  3. C.Index locking or predicate locking✓ Correct
  4. D.Removing all indexes from the tables

Explanation

Index locking or predicate locking prevents phantom tuples by locking the index range or predicate space.

Report an error in this question

Concurrency ControlHard

Q26. In multi-version timestamp ordering (MVTO):

  1. A.Only one version of each data item is maintained
  2. B.Reads always block writes until they are completed
  3. C.No timestamps are used for ordering transactions
  4. D.Each write creates a new version of the data item✓ Correct

Explanation

MVTO maintains multiple versions of data items; writes create new versions tagged with the transaction timestamp.

Report an error in this question

Concurrency ControlHard

Q27. The wound-wait scheme is a preemptive protocol because:

  1. A.Younger transactions always preempt older ones holding locks on data items
  2. B.No rollback ever occurs because all transactions complete without conflict
  3. C.An older transaction can force a younger one holding a needed lock to roll back✓ Correct
  4. D.Only reads are preempted while writes always proceed without interruption

Explanation

Wound-wait is preemptive because the older transaction 'wounds' (forces rollback of) the younger transaction holding the lock.

Report an error in this question

Concurrency ControlHard

Q28. In tree locking protocol (for B+ tree indexes), a transaction must:

  1. A.Use no locks at all when accessing data through the index structure
  2. B.Lock children before parents when traversing the index tree structure
  3. C.Lock a node before locking its children, and unlock parent before child✓ Correct
  4. D.Lock all nodes simultaneously before accessing any data in the tree

Explanation

The tree protocol requires locking parent nodes before children, following the tree structure top-down.

Report an error in this question

Concurrency ControlHard

Q29. Lock escalation is the process of:

  1. A.Converting coarse-grained locks into many more fine-grained locks
  2. B.Converting many fine-grained locks into fewer coarse-grained locks✓ Correct
  3. C.Adding locks continuously without ever releasing any of them
  4. D.Removing all locks from the data items in the locked collection

Explanation

Lock escalation converts multiple fine-grained locks (e.g., row locks) into a single coarse-grained lock (e.g., table lock) to reduce overhead.

Report an error in this question

Concurrency ControlHard

Q30. Snapshot isolation provides each transaction with:

  1. A.Only read access to the data without any ability to write modifications
  2. B.No isolation at all between concurrently executing database transactions
  3. C.Access to the latest uncommitted data written by other active transactions
  4. D.A consistent snapshot of the database as of the transaction's start time✓ Correct

Explanation

Snapshot isolation gives each transaction a consistent view of the database from its start time.

Report an error in this question

Ready to test yourself on Concurrency Control?

Take a timed quiz drawn from 210+ questions on this topic. No signup required — your progress saves in your browser.

Start Concurrency Control Quiz