CS FundamentalsVery hardGATE CS (PYQ pattern)
Three transactions each run x = x + 10 as an unprotected read followed by a write of (value read + 10), on a shared x that starts at 0, with arbitrary interleaving of the reads and writes and no locking. Which set is exactly the set of possible final values of x?
- A. {10, 20, 30}
- B. {30}
- C. {20, 30}
- D. {0, 10, 20, 30}
Correct answer: A. {10, 20, 30}
30 occurs when no updates are lost. A final value of 10 occurs when the last write overwrites with a stale read, e.g. all three read 0 and write 10, and 20 when two updates survive. 0 is impossible since every write stores at least 10.
More DBMS and SQL questions
- R(A, B, C, D, E, F) has the functional dependencies B → E, F → A, BC → F, AF → D, C → B. What is the highest normal form of R (1NF, 2NF…
- R(A, B, C, D, E) has the functional dependencies D → C, DC → B, A → B, AC → E, C → A, E → C, D → E. How many of the listed dependencies…
- R(A, B, C, D, E, F) has the functional dependencies A -> B, DB -> F, FB -> C, A -> C, A -> D, EF -> B. An attribute set X is closed if X+…
- R(A, B, C, D, E, F) has the functional dependencies AF → E, D → B, BF → D, ED → C, C → F. How many attributes belong to EVERY candidate…
- R(A, B, C, D, E) has the functional dependencies BD → A, B → E, AC → B, B → D, A → C. Which statement is correct?
- Table LV(id, v): (1,5), (2,9), (3,9), (4,3), (5,3). Let L be the sum over all rows of LASTVALUE(v) OVER (ORDER BY v) and F the sum of…