Q: 1 ACID properties of a database transaction include:
Atomicity
Durability
Consistency and Isolation
All of the above
[ 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: 2 In 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?
The graph G contains a directed edge from T1 to T2.
The graph G contains a directed edge from T2 to T3.
The graph G contains a directed edge from T3 to T4.
The schedule S is not conflict serializable
[ 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: 3 In 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?
REDO
UNDO
UNDO-REDO
Equal in all logging mechanisms
[ 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: 4 Which one of the following is NOT a part of the ACID properties of database transaction?
Applicability
Consistency
Isolation
Durability
[ 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: 5 The property of a transaction in which all actions are executed completely, or in case of failure all partial effects are undone, is called:
Durability
Atomicity
Consistency
Isolation
[ 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: 6 In context of transactions in DBMS, choose a valid statement about deadlock prevention schemes.
wait-die is a nonpreemptive and wound-wait is a preemptive technique.
wait-die is a preemptive and wound-wait is a nonpreemptive technique.
Both wait-die and wound-wait schemes are nonpreemptive techniques.
Both wait-die and wound-wait schemes are preemptive techniques.
[ 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: 7 Consider 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?
600
700
550
500
[ 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: 8 A database transaction ends when which of the following events occurs?
COMMIT or ROLLBACK is issued
DDL or DCL statement executed
The user exits or the session ends abnormally
All of the above
[ 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.
Q: 9 Consider the schedule S:
Which of the following statements is correct regarding S?
S : w1(A); w1(B); w2(A); r2(B); c2; c1;
Serializable but not recoverable
Both Serializable and Recoverable
Recoverable but not Serializable
Neither Serializable nor Recoverable
[ Option A ]
The schedule S: w1(A); w1(B); w2(A); r2(B); c2; c1; involves two transactions T1 and T2. Checking for Recoverability, T2 reads data written by T1 and commits before T1 commits, which violates recoverable schedule rules. Hence, the schedule is Not Recoverable.
For Serializability, analyzing conflicting operations shows that T1’s writes on A and B conflict with T2’s operations, resulting in a precedence graph with a single edge from T1 to T2. Since the graph is acyclic, the schedule is conflict serializable. Therefore, the schedule is serializable but not recoverable.
Q: 10 Which statement(s) is/are correct from the following?
S1: If multiple transactions are allowed to execute concurrently, then shadow-paging technique is not applicable.
S2: Log-based techniques can be used, if multiple transactions are allowed to execute concurrently.
S1 only
S2 only
Both S1 and S2
Neither S1 nor S2
[ Option C ]
Shadow Paging keeps a copy of the old page table and replaces it at commit, which makes it incompatible with multiple concurrent transactions because changes cannot be merged safely.
On the other hand, Log-Based Techniques maintain a log of all changes and can safely support multiple concurrent transactions, providing both undo and redo capabilities during recovery.
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.