10 multiple-choice questions related to synchronization in DBMS:

Here are 10 multiple-choice questions related to synchronization in DBMS with their answers:


Question 1: Synchronization Definition

Q1: Synchronization in DBMS is primarily concerned with:

  • A) Improving the speed of transactions
  • B) Ensuring data consistency and integrity when multiple transactions are executed concurrently
  • C) Optimizing storage space
  • D) Enhancing the user interface

Answer: B) Ensuring data consistency and integrity when multiple transactions are executed concurrently


Question 2: Race Condition

Q2: A race condition in DBMS occurs when:

  • A) Multiple transactions compete for CPU time
  • B) The outcome of transactions depends on the non-deterministic timing of events
  • C) Transactions are executed in a sequential manner
  • D) The system runs out of memory

Answer: B) The outcome of transactions depends on the non-deterministic timing of events


Question 3: Lock-Based Protocols

Q3: Which of the following is a lock-based protocol used for synchronization?

  • A) Two-Phase Locking (2PL)
  • B) Timestamp Ordering
  • C) Snapshot Isolation
  • D) Multiversion Concurrency Control (MVCC)

Answer: A) Two-Phase Locking (2PL)


Question 4: Two-Phase Locking (2PL)

Q4: In Two-Phase Locking (2PL), the two phases are:

  • A) Lock Acquisition and Lock Release
  • B) Read and Write
  • C) Commit and Rollback
  • D) Shared and Exclusive

Answer: A) Lock Acquisition and Lock Release


Question 5: Deadlock Avoidance

Q5: Which of the following is a method to avoid deadlocks in a DBMS?

  • A) Timeout Mechanism
  • B) Data Replication
  • C) Write-Ahead Logging
  • D) Normalization

Answer: A) Timeout Mechanism


Question 6: Shared Lock

Q6: A shared lock (S-lock) in DBMS allows:

  • A) Only one transaction to read the data item
  • B) Multiple transactions to read the data item
  • C) Multiple transactions to write to the data item
  • D) No transactions to access the data item

Answer: B) Multiple transactions to read the data item


Question 7: Exclusive Lock

Q7: An exclusive lock (X-lock) in DBMS allows:

  • A) Only one transaction to write to the data item
  • B) Multiple transactions to write to the data item
  • C) Only one transaction to read the data item
  • D) Multiple transactions to read the data item

Answer: A) Only one transaction to write to the data item


Question 8: Timestamp Ordering

Q8: In the Timestamp Ordering protocol, the system assigns timestamps to:

  • A) Data items
  • B) Transactions
  • C) Users
  • D) Tables

Answer: B) Transactions


Question 9: Serializable Schedule

Q9: A schedule is considered serializable if:

  • A) It can be completed without any locks
  • B) It results in the same state as some serial schedule
  • C) It includes only read operations
  • D) It avoids deadlocks

Answer: B) It results in the same state as some serial schedule


Question 10: Multiversion Concurrency Control (MVCC)

Q10: Multiversion Concurrency Control (MVCC) improves concurrency by:

  • A) Using multiple versions of data items
  • B) Locking data items more frequently
  • C) Reducing the number of transactions
  • D) Avoiding the use of timestamps

Answer: A) Using multiple versions of data items

Comments