By: Prof. Dr. Fazal Rehman | Last updated: September 23, 2024
MCQs on Database Transaction Management in DBMS
What is a transaction in the context of a DBMS?A. A single operation on the database
B. A sequence of operations performed as a single logical unit of work
C. A backup process of the database
D. A type of query execution
Answer: B. A sequence of operations performed as a single logical unit of work
Which property of a transaction ensures that all operations within the transaction are completed successfully or none at all?A. Consistency
B. Atomicity
C. Isolation
D. Durability
Answer: B. Atomicity
Which ACID property ensures that a transaction leaves the database in a valid state?A. Atomicity
B. Consistency
C. Isolation
D. Durability
Answer: B. Consistency
What does the Isolation property in transactions ensure?A. Transactions are executed all at once or not at all
B. The database remains in a consistent state
C. Transactions do not interfere with each other
D. All changes are permanent once committed
Answer: C. Transactions do not interfere with each other
Which property ensures that the changes made by a committed transaction are permanent?A. Atomicity
B. Consistency
C. Isolation
D. Durability
Answer: D. Durability
What is the purpose of the COMMIT statement in a transaction?A. To abort the transaction
B. To make all changes made in the transaction permanent
C. To start a new transaction
D. To undo all changes made in the transaction
Answer: B. To make all changes made in the transaction permanent
What is a ‘rollback’ in the context of a DBMS?A. Saving the changes made by a transaction
B. Undoing all changes made by a transaction
C. Starting a new transaction
D. Ending a transaction
Answer: B. Undoing all changes made by a transaction
Which of the following is used to ensure that a transaction has not been interrupted and is completed successfully?A. Rollback
B. Locking
C. Checkpoint
D. Commit
Answer: D. Commit
What is a ‘deadlock’ in database transaction management?A. A situation where a transaction is unable to proceed because it is waiting for a resource held by another transaction
B. A completed transaction that is waiting for commit
C. A process of backing up the database
D. A transaction that has been aborted
Answer: A. A situation where a transaction is unable to proceed because it is waiting for a resource held by another transaction
Which of the following is a concurrency control technique used in DBMS?A. Rollback
B. Two-phase locking
C. Commit
D. Checkpoint
Answer: B. Two-phase locking
What is the purpose of a ‘log’ in the context of transaction management?A. To store the results of a transaction
B. To keep a record of all transactions and changes to the database
C. To execute a transaction
D. To back up the database
Answer: B. To keep a record of all transactions and changes to the database
In the context of database transactions, what is ‘serializability’?A. The ability to execute multiple transactions simultaneously
B. Ensuring that transactions produce the same result as if they were executed in a serial order
C. The process of rolling back a transaction
D. The process of committing a transaction
Answer: B. Ensuring that transactions produce the same result as if they were executed in a serial order
What is the main purpose of using ‘lock’ mechanisms in transaction management?A. To increase transaction speed
B. To ensure database consistency and isolation
C. To execute transactions in parallel
D. To store transaction results
Answer: B. To ensure database consistency and isolation
Which of the following describes the ‘write-ahead logging’ protocol?A. Logging is done after the changes are written to the database
B. Changes are written to the log before they are applied to the database
C. Logs are written only if the transaction is successful
D. Logs are written at the end of the day
Answer: B. Changes are written to the log before they are applied to the database
What is the ‘two-phase commit protocol’ used for?A. Ensuring atomicity in distributed transactions
B. Enhancing database security
C. Improving transaction speed
D. Reducing the size of the transaction log
Answer: A. Ensuring atomicity in distributed transactions