CS FundamentalsVery hardGATE CS (PYQ pattern)
T1: R(A), W(A), R(B) and T2: R(B), W(B), R(A), each in that order. Of the C(6,3) = 20 interleavings, how many are conflict-serializable?
- A. 8
- B. 2
- C. 20
- D. 10
Correct answer: A. 8
T1 -> T2 needs T1's W(A) before T2's R(A) or T1's R(B) before T2's W(B); T2 -> T1 is the reverse. A cycle arises when T2's W(B) precedes T1's R(B) while T1's W(A) precedes T2's R(A) (or the mirror case). Enumerating the 20 interleavings leaves 8 acyclic ones; the two serial schedules are only part of them.
More DBMS and SQL questions
- T1: W(A) W(B) and T2: W(B) W(A) run under strict 2PL (exclusive locks held until the transaction ends; a schedule counts only if no…
- Table T(x) holds the values 1, 2, 3, NULL and table U(y) holds 2, NULL. Let Q1 = SELECT COUNT() FROM T WHERE x NOT IN (SELECT y FROM U)…
- DEPT(d, name) has rows (10,A), (20,B), (30,C), (40,D) and EMP(id, dept) has 3 employees in dept 10, 2 in dept 20, 1 in dept 30 and none in…
- EMP has salaries 300, 200, 200, 200, 150, 100 for six employees. Let QR select employees whose RANK() OVER (ORDER BY sal DESC) equals 3…
- R(A, B, C, D, E) has the functional dependencies A → B, BC → D, D → E and E → A. The number of candidate keys of R and its highest normal…
- Consider the schedule S: r1(A) r3(B) r2(C) w2(A) r4(C) w4(B) r1(D) r3(D), where ri/wi is a read/write by transaction Ti. How many distinct…