Transactions
Q31.
Which of the following contains complete record of all activity that affected the contents of a database during a certain period of time?Q32.
Consider the following three schedules of transactions T1, T2 and T3. [Notation: In the following NYO represents the action Y (R for read, W for write) performed by transaction N on object O.]\begin{array}{lllllllllll} \hline(S 1) & 2 R A & 2 W A & 3 R C & 2 W B & 3 W A & 3 W C & 1 R A & 1 R B & 1 W A & 1 W B \\ \hline(S 2) & 3 R C & 2 R A & 2 W A & 2 W B & 3 W A & 1 R A & 1 R B & 1 W A & 1 W B & 3 W C \\ \hline(S 3) & 2 R A & 3 R C & 3 W A & 2 W A & 2 W B & 3 W C & 1 R A & 1 R B & 1 W A & 1 W B \\ \hline \end{array}Which of the following statements is TRUE?Q34.
Consider the following log sequence of two transactions on a bank account, with initial balance 12000,that transfer 2000 to a mortgage payment and, then apply a 5% interest. 1. T1 start 2. T1 B old = 12000 new = 10000 3. T1 M old = 0 ne = 2000 4. T1 commit 5. T2 start 6. T2 B old = 10000 new = 10500 7. T2 commit Suppose the database system crashed just before log record 7 is written. When the system is restarted, which one statement is true of the recovery procedure?Q35.
A company maintains records of sales made by its salespersons and pays them commission based on each individual's total sales made in a year. This data is maintained in a table with following schema: salesinfo = (salespersonid, totalsales, commission) In a certain year, due to better business results, the company decides to further reward its salespersons by enhancing the commission paid to them as per the following formula: If commission \leq 50000, enhance it by 2% If 50000 < commission [latex]\leq 100000[/latex], enhance it by 4% If commission > 100000, enhance it by 6% The IT staff has written three different SQL scripts to calculate enhancement for each slab, each of these scripts is to run as a separate transaction as follows: 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 correctlyQ36.
Amongst the ACID properties of a transaction, the 'Durability' property requires that the changes made to the database by a successful transaction persistQ37.
Consider the following schedules involving two transactions. Which one of the following statements is TRUE? S_1 :r_1(X); r_1(Y); r_2(X); r_2(Y); w_2(Y); w_1(X) S_2 :r_1(X); r_2(X); r_2(Y); w_2(Y); r_1(Y); w_1(X)Q38.
Consider the following two transactions : T1 and T2. T1:read (A); read (B); if A = 0 then B \leftarrow B + 1; write (B); T2 : read (B); read (A); if B \neq 0 then A \leftarrow A - 1; write (A); Which of the following schemes, using shared and exclusive locks, satisfy the requirements for strict two phase locking for the above transactions?Q39.
Consider the following schedule S of transactions T1 and T2:{\begin{array}{l|l} \textbf{T1}& \textbf{T2} \\\hline \text{Read(A)} \\ \text{A = A ? 10}\\ & \text{Read(A) }\\ & \text{Temp = 0.2*A} \\ & \text{Write(A)} \\ & \text{Read(B)} \\ \text{Write(A)}\\ \text{Read(B)}\\ \text{B = B + 10}\\ \text{Write(B)} \\ & \text{B = B + Temp} \\ & \text{Write(B)}\\ \end{array}}Which of the following is TRUE about the schedule S ?Q40.
Which of the following scenarios may lead to an irrecoverable error in a database system?