If 50000 < commission < = 100000, enhance it by 4%
If commission > 100000, enhance it by 6%
T1 |
Update salesinfo Set commission = commission * 1.02 Where commission < = 50000; |
T2 |
Update salesinfo Set commission = commission * 1.04 Where commission > 50000 and commission is < = 100000; |
T3 |
Update salesinfo Set commission = commission * 1.06 Where commission > 100000; |
Which of the following options of running these transactions will update the commission of all salespersons correctly
(A)
Execute T1 followed by T2 followed by T3
(B)
Execute T2, followed by T3; T1 running concurrently throughout
(C)
Execute T3 followed by T2; T1 running concurrently throughout
(D)
Execute T3 followed by T2 followed by T1
Answer: (D)
Explanation:
T3 followed by T2 followed by T1
If this sequence is not followed then it may happen that the Officer of one slab gets benefited twice.
Say an officer is having commission as 99,999, He must get an updated commission according to T2. But then
99,999*1.04=1,03998 and he again becomes eligible for next slab of commission.
T3 followed by T2 followed by T1 will be check all border cases like above.So Answer is D
Quiz of this Question
Please comment below if you find anything wrong in the above post