Problem 1 Consider a database consisting of a single relation M: 10 0 2 a) The f
ID: 3736433 • Letter: P
Question
Problem 1 Consider a database consisting of a single relation M: 10 0 2 a) The following two transactions T1 and T2 run concurrently on this database: T1 BEGIN TRANSACTION S1: update M set B -B-10 where A-1 S2: update M set B = B+10 where A-2 COMMIT T2 BEGIN TRANSACTION S3: select sum(B) from M COMMIT Indicate at least one isolation level (if exist) that may make possible to see zero as output for T2. The following two transactions run concurrently on this database: T1 BEGIN TRANSACTION b) S1: insert into M values (3,100) COMMIT T2 BEGIN TRANSACTION S2: select sum(B) from M S3: select sum(B) from M; COMMIT For what isolation levels, T2 may see a different value as the output of the select sum(B) from M statements?Explanation / Answer
Solution:
a)
When in T1, S1 gets executed then B= B-10 = 0
and just after that T2 reads then the sum(B) will be 0
the T1 doesn't complete the work and T2 finishes
b)
Different values will be seen when
I hope this helps if you find any problem. Please comment below. Don't forget to give a thumbs up if you liked it. :)
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.