This section contains carefully selected MCQs and Previous Year Questions with explanations to help students understand concepts and prepare effectively for examinations, interviews, and competitive tests.
Q: 1ACID properties of a database transaction include:
Option D
ACID is a set of properties that ensure reliable processing of database transactions:
| PROPERTY | MEANING | EXAMPLE |
|---|---|---|
| Atomicity | A transaction is treated as a single unit, either all operations happen or none happen. | Money is debited and credited together, or not at all. |
| Consistency | A transaction brings the database from one valid state to another, maintaining all rules and constraints. | Account balance never becomes negative after a transaction. |
| Isolation | Multiple transactions do not affect each other while executing simultaneously. | Two users updating different accounts do not see incomplete data. |
| Durability | Once a transaction is committed, changes are permanent even after system failure. | After power failure, committed balance remains saved. |
Q: 2In context of transactions in DBMS, S is a schedule having T1, T2, T3 and T4 as participant transactions. A precedence graph (G) is constructed from S to determine its conflict serializability. Consider the following facts:
I. T1 executes write(Q) before T2 executes read(Q).
II. T2 executes read(Q) before T3 executes write(Q).
III. T3 executes write(Q) before T4 executes write(Q).
Which of the following statements is not true?
Option D
In the given schedule, we have the following operations, T1 writes Q before T2 reads Q, T2 reads Q before T3 writes Q, and T3 writes Q before T4 writes Q. These create directed edges T1 → T2, T2 → T3, and T3 → T4 in the precedence graph. Since this graph has no cycles (acyclic), the schedule is conflict serializable and equivalent to the serial order T1 → T2 → T3 → T4.
Q: 3In a particular database system, it is estimated that on an average (across many system crashes) the number of committed transactions is almost 5 times the number of uncommitted transactions in the log at the time of restart after the crash. In which of the following logging mechanisms, the recovery manager attends to the least number of transactions, after being given control after a crash?
Option B
The number of uncommitted transactions is the smallest, the UNDO mechanism requires the recovery manager to attend to the least number of transactions.
Q: 4Which one of the following is NOT a part of the ACID properties of database transaction?
Option A
The ACID properties define the key characteristics that ensure reliable database transactions. ACID stands for Atomicity, Consistency, Isolation, and Durability.
| PROPERTY | MEANING | EXAMPLE |
|---|---|---|
| Atomicity | A transaction is treated as a single unit, either all operations happen or none happen. | Money is debited and credited together, or not at all. |
| Consistency | A transaction brings the database from one valid state to another, maintaining all rules and constraints. | Account balance never becomes negative after a transaction. |
| Isolation | Multiple transactions do not affect each other while executing simultaneously. | Two users updating different accounts do not see incomplete data. |
| Durability | Once a transaction is committed, changes are permanent even after system failure. | After power failure, committed balance remains saved. |
Q: 5The concept of performing a sequence of steps / operations executed to completion as single step is called
Option C
Atomicity refers to the concept where a sequence of operations is executed as a single indivisible unit. This means either all operations are completed successfully or none are executed at all.
It is an important property in Transactions and Concurrent systems, ensuring consistency and preventing partial execution.
Q: 6Which one of the following is NOT a part of the ACID properties of database transaction?
Option D
In Database Management System (DBMS), ACID properties are a set of rules that ensure reliable and accurate database transactions.
These properties help maintain data correctness even in case of system failure or multiple user access.
| Property | Meaning |
|---|---|
| Atomicity | A transaction is treated as a single unit. Either all operations are completed or none are performed. |
| Consistency | The database must remain in a valid state before and after the transaction. |
| Isolation | Multiple transactions should not interfere with each other. |
| Durability | Once a transaction is committed, the changes remain permanently stored even after power failure or crash. |
Q: 7The property of a transaction in which all actions are executed completely, or in case of failure all partial effects are undone, is called:
Option B
Atomicity ensures that a transaction is treated as a single, indivisible unit. This means either all operations of the transaction are performed, or none of them are applied if a failure occurs.
For example, during a fund transfer, if money is debited from one account but crediting fails, atomicity ensures the debit is rolled back.
Q: 8In context of transactions in DBMS, choose a valid statement about deadlock prevention schemes.
Option A
Deadlock prevention schemes in databases use timestamp ordering to avoid cyclic waiting. Two popular timestamp-based methods are wait-die and wound-wait schemes.
In the wait-die scheme (non-preemptive), if an older transaction requests a resource held by a younger one, it is allowed to wait, otherwise, the younger transaction is rolled back.
The wound-wait scheme (preemptive) allows the older transaction to “wound” the younger one by forcing it to roll back immediately and release the resource. Because wait-die involves waiting (non-preemptive) and wound-wait involves forced rollback (preemptive).
Q: 9Consider following schedule with a sequence of operations on a data object Q having the initial value of 500:
| T1 | T2 |
|---|---|
| Read (Q) | |
| Read (Q) | |
| Q = Q + 100 | |
| Q = Q + 100 | |
| Write (Q) | |
| Write (Q) |
What will be the final value of Q after the last operation is completed?
Option A
The data item Q initially = 500.
Schedule Step by Step:
Because both transactions read the original value 500 and each computed 600, the second write simply overwrites the first with the same value. The final value of Q after the last operation is 600.
Q: 10A database transaction ends when which of the following events occurs?
Option D
A transaction in DBMS is a logical unit of work that ends when its changes are either made permanent or undone, or when it is implicitly terminated.
Thank you so much for taking the time to read my Computer Science MCQs section carefully. Your support and interest mean a lot, and I truly appreciate you being part of this journey. Stay connected for more insights and updates! If you'd like to explore more tutorials and insights, check out my YouTube channel.
Don’t forget to subscribe and stay connected for future updates.