#dbms #dbmslectures #dbmstutorials #db #rdbms #erd
Previous year GATE questions on Transactions.
Let ri(z) and wi(z) denote read and write operations respectively on a data item z by a transaction Ti. Consider the following two schedules.
S1: r1(x) r1(y) r2(x) r2(y) w2(y) w1(x)
S2: r1(x) r2(x) r2(y) w2(y) r1(y) w1(x)
Which one of the following options is correct?
(A) S1 is conflict serializable, and S2 is not conflict serializable
(B) S1 is not conflict serializable, and S2 is conflict serializable
(C) Both S1 and S2 are conflict serializable
(D) Neither S1 nor S2 is conflict serializable
Let S be the following schedule of operations of three transactions T1, T2 and T3 in a relational database system:
R2(Y),R1(X),R3(Z),R1(Y)W1(X),R2(Z),W2(Y),R3(X),W3(Z)
Consider the statements P and Q below:
P : S is conflict-serializable.
Q : If T3 commits before T1 finishes, then S is recoverable.
Which one of the following choices is correct?
(A) Both P and Q are true
(B) P is true and Q is false
(C) P is false and Q is true
(D) Both P and Q are false
Two transactions T1 and T2 are given as:
T1 : r1(X), w1(X), r1(Y), w1(Y)
T2 : r2(Y), w2(Y), r2(Z), w2(Z)
where ri(V) denotes a read operation by transaction Ti on a variable V and wi(V) denotes a write operations by transaction Ti on a variable V. The total number of conflict serializable schedules that can be formed by T1 and T2 is _____________.
Which one of the following is NOT a part of the ACID properties of database transactions?
(A) Atomicity
(B) Consistency
(C) Isolation
(D) Deadlock-freedom
Suppose a database schedule S involves transactions T1, . . . , Tn. Construct the precedence graph of S with vertices representing the transactions and edges representing the conflicts. If S is serializable, which one of the following orderings of the vertices of the precedence graph is guaranteed to yield a serial schedule?
(A) Topological order
(B) Depth-first order
(C) Breadth-first order
(D) Ascending order of transaction indices
Consider the following database schedule with two transactions, T1 and T2.
S = r2(X); r1(X); r2(Y); w1(X); r1(Y); w2(X); a1; a2
Where ri (Z) denotes a read operation by transaction Ti on a variable Z, wi (Z) denotes a write operation by Ti on a variable Z and ai denotes an abort by transaction Ti.
Which one of the following statements about the above schedule is TRUE?
(A) S is non-recoverable
(B) S is recoverable, but has a cascading abort
(C) S does not have a cascading abort
(D) S is strict
Consider the following transaction involving two bank account x and y.
read (x) ; x : = x – 50; write (x) ; read (y); y : = y + 50 ; write (y)
The constraint that the sum of the accounts x and y should remain constant is that of
Atomicity
(B) Consistency
(C) Isolation
(D) Durability
Consider the following four schedules due to three transactions (indicted by the subscript) using read and write on a data item x, denoted r (x) and w (x) respectively. Which one of them is conflict serializable?
(A) r1 (x) ; r2 (x) ; w1 (x) ; r3 (x) ; w2 (x)
(B) r2 (x) ; r1 (x) ; w2 (x) ; r3 (x) ; w1 (x)
(C) r3 (x) ; r2 (x) ; r1 (x) ; w2 (x) ; w1 (x)
(D) r2 (x) ; w2 (x) ; r3 (x) ; r1 (x) ; w1 (x)