CS FundamentalsVery hardGATE CS (PYQ pattern)
Three transactions each execute R(A) followed by W(A) on the same item A. Among all interleavings of the six operations (each transaction's own order preserved), how many are conflict-serializable?
- A. 24
- B. 12
- C. 6
- D. 5
Correct answer: C. 6
There are 6!/(2!2!2!) = 90 interleavings. For two transactions only the serial orders work; for three, each pair must be non-interleaved in the sense that no cyclic conflict arises, which only the 3! serial orders satisfy: 6.
More DBMS and SQL questions
- 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?
- 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…