250+ TOP MCQs on Lock-Based Protocols and Answers

Database Multiple Choice Questions on “Lock-Based Protocols”.

1. In order to maintain transactional integrity and database consistency, what technology does a DBMS deploy?
a) Triggers
b) Pointers
c) Locks
d) Cursors

Answer: c
Clarification: Locks are used to maintain database consistency.

2. A lock that allows concurrent transactions to access different rows of the same table is known as a
a) Database-level lock
b) Table-level lock
c) Page-level lock
d) Row-level lock

Answer: d
Clarification: Locks are used to maintain database consistency.

3. Which of the following are introduced to reduce the overheads caused by the log-based recovery?
a) Checkpoints
b) Indices
c) Deadlocks
d) Locks

Answer: a
Clarification: Checkpoints are introduced to reduce overheads caused by the log-based recovery.

4. Which of the following protocols ensures conflict serializability and safety from deadlocks?
a) Two-phase locking protocol
b) Time-stamp ordering protocol
c) Graph based protocol
d) None of the mentioned

Answer: b
Clarification: Time-stamp ordering protocol ensures conflict serializability and safety from deadlocks.

5. Which of the following is the block that is not permitted to be written back to the disk?
a) Dead code
b) Read only
c) Pinned
d) Zapped

Answer: c
Clarification: A block that is not permitted to be written back to the disk is called pinned.

6. If transaction Ti gets an explicit lock on the file Fc in exclusive mode, then it has an ­­­­­­__________ on all the records belonging to that file.
a) Explicit lock in exclusive mode
b) Implicit lock in shared mode
c) Explicit lock in shared mode
d) Implicit lock in exclusive mode

Answer: d
Clarification: If transaction Ti gets an explicit lock on the file Fc in exclusive mode, then it has an implicit lock in exclusive mode on all the records belonging to that file.

7. Which refers to a property of computer to run several operation simultaneously and possible as computers await response of each other
a) Concurrency
b) Deadlock
c) Backup
d) Recovery

Answer: a
Clarification: Concurrency is a property of systems in which several computations are executing simultaneously, and potentially interacting with each other.

8. All lock information is managed by a __________ which is responsible for assigning and policing the locks used by the transactions.
a) Scheduler
b) DBMS
c) Lock manager
d) Locking agent

Answer: c
Clarification: A distributed lock manager (DLM) provides distributed software applications with a means to synchronize their accesses to shared resources.

9. The ____ lock allows concurrent transactions to access the same row as long as they require the use of different fields within that row.
a) Table-level
b) Page-level
c) Row-level
d) Field-level

Answer: d
Clarification: Lock is limited to the attributes of the relation.

10. Which of the following is a procedure for acquiring the necessary locks for a transaction where all necessary locks are acquired before any are released?
a) Record controller
b) Exclusive lock
c) Authorization rule
d) Two phase lock

Answer: d
Clarification: Two-phase lock is a procedure for acquiring the necessary locks for a transaction where all necessary locks are acquired before any are released.

Leave a Reply

Your email address will not be published. Required fields are marked *