Order PDF of any content from our website with a little minor Fee to donate for hard work. Online MCQs are fully free but PDF books are paid. For details: contact whatsapp +923028700085 Important notes based PDF Books are available in very little price, starting from 500/-PKR; Order Now: contact whatsapp +923028700085

Concurrency Control MCQs

Q#1: Concurrency control in DBMS is used to:
(A) Allow multiple transactions to execute simultaneously without inconsistency
(B) Delete old transactions
(C) Encrypt data
(D) Normalize tables
Answer: (A) Allow multiple transactions to execute simultaneously without inconsistency

Q#2: Which problem occurs when two transactions try to update the same data concurrently?
(A) Lost update
(B) Dirty read
(C) Phantom problem
(D) Deadlock
Answer: (A) Lost update

Q#3: Dirty read occurs when:
(A) A transaction reads uncommitted changes made by another transaction
(B) A transaction deletes data
(C) A transaction commits twice
(D) Data is lost
Answer: (A) A transaction reads uncommitted changes made by another transaction

Q#4: The phantom problem occurs when:
(A) New rows are inserted by another transaction and appear in a query
(B) Data is deleted
(C) Transaction fails
(D) Data is consistent
Answer: (A) New rows are inserted by another transaction and appear in a query

Q#5: Which protocol prevents lost updates, dirty reads, and uncommitted dependencies?
(A) Two-Phase Locking (2PL)
(B) Timestamp ordering
(C) Commit protocol
(D) Recovery protocol
Answer: (A) Two-Phase Locking (2PL)

Q#6: Two-Phase Locking has how many phases?
(A) One
(B) Two
(C) Three
(D) Four
Answer: (B) Two

Q#7: The two phases of Two-Phase Locking are:
(A) Growing phase and shrinking phase
(B) Lock phase and unlock phase
(C) Commit and rollback
(D) Read and write
Answer: (A) Growing phase and shrinking phase

Q#8: In growing phase of 2PL:
(A) Transactions can acquire locks but cannot release any
(B) Transactions can release locks but cannot acquire any
(C) Transactions commit
(D) Transactions rollback
Answer: (A) Transactions can acquire locks but cannot release any

Q#9: In shrinking phase of 2PL:
(A) Transactions can release locks but cannot acquire new ones
(B) Transactions acquire new locks
(C) Transactions rollback
(D) Transactions start
Answer: (A) Transactions can release locks but cannot acquire new ones

Q#10: Deadlock occurs when:
(A) Two or more transactions wait indefinitely for resources held by each other
(B) Transaction commits
(C) Database crashes
(D) Transaction reads uncommitted data
Answer: (A) Two or more transactions wait indefinitely for resources held by each other

Q#11: Deadlock prevention can be achieved by:
(A) Ordering resources
(B) Using timeouts
(C) Both A and B
(D) None
Answer: (C) Both A and B

Q#12: Timestamp ordering protocol assigns:
(A) Unique timestamps to transactions
(B) Locks to rows
(C) Commit signals
(D) Recovery points
Answer: (A) Unique timestamps to transactions

Q#13: In timestamp ordering, a transaction with smaller timestamp:
(A) Has higher priority
(B) Has lower priority
(C) Is ignored
(D) Is always rolled back
Answer: (A) Has higher priority

Q#14: Concurrency control ensures:
(A) Consistency of database
(B) Isolation of transactions
(C) Serializability of schedule
(D) All of the above
Answer: (D) All of the above

Q#15: Serializability ensures:
(A) The final database state is same as if transactions were executed serially
(B) Transactions commit immediately
(C) Transactions rollback
(D) Deadlock occurs
Answer: (A) The final database state is same as if transactions were executed serially

Q#16: Strict Two-Phase Locking ensures:
(A) Serializability and recoverability
(B) Only serializability
(C) Only concurrency
(D) Only atomicity
Answer: (A) Serializability and recoverability

Q#17: Shared locks (S-lock) allow:
(A) Multiple transactions to read but not write
(B) Only one transaction to write
(C) Transactions to delete
(D) Transactions to update
Answer: (A) Multiple transactions to read but not write

Q#18: Exclusive locks (X-lock) allow:
(A) Only one transaction to write or read
(B) Multiple transactions to read
(C) Multiple transactions to write
(D) None
Answer: (A) Only one transaction to write or read

Q#19: Optimistic concurrency control assumes:
(A) Conflicts are rare
(B) Conflicts are frequent
(C) Transactions never commit
(D) Transactions are serial
Answer: (A) Conflicts are rare

Q#20: Pessimistic concurrency control assumes:
(A) Conflicts are frequent
(B) Conflicts are rare
(C) Transactions never rollback
(D) Transactions are always serial
Answer: (A) Conflicts are frequent

Q#21: Rollback is required in concurrency control when:
(A) Deadlock is detected
(B) Dirty read occurs
(C) Transaction violates serializability
(D) All of the above
Answer: (D) All of the above

Q#22: Cascading rollback can be prevented by:
(A) Using strict 2PL
(B) Using optimistic protocol
(C) Ignoring locks
(D) Using timestamps
Answer: (A) Using strict 2PL

Q#23: Phantom read occurs in which isolation level?
(A) Read uncommitted
(B) Read committed
(C) Repeatable read
(D) Serializable
Answer: (C) Repeatable read

Q#24: Concurrency control improves:
(A) Data consistency
(B) Transaction throughput
(C) Both A and B
(D) Only database size
Answer: (C) Both A and B

Q#25: Deadlock detection algorithm includes:
(A) Wait-for graph
(B) Timestamps
(C) Locking protocol
(D) Recovery log
Answer: (A) Wait-for graph

Q#26: Wait-for graph helps to:
(A) Detect cycles indicating deadlock
(B) Commit transactions
(C) Create locks
(D) Rollback transactions
Answer: (A) Detect cycles indicating deadlock

Q#27: Concurrency control is necessary in:
(A) Multi-user database environment
(B) Single-user database
(C) Offline database
(D) Read-only database
Answer: (A) Multi-user database environment

Q#28: Phantom problem can be solved by:
(A) Serializable isolation
(B) Repeatable read
(C) Read committed
(D) Read uncommitted
Answer: (A) Serializable isolation

Q#29: Timestamp-based protocol ensures:
(A) Serializability
(B) No deadlocks
(C) Both A and B
(D) Only atomicity
Answer: (C) Both A and B

Q#30: Main goal of concurrency control is:
(A) Ensure data consistency and transaction isolation
(B) Reduce storage space
(C) Encrypt database
(D) Increase redundancy
Answer: (A) Ensure data consistency and transaction isolation

Contents Copyrights Reserved By T4Tutorials