Transaction: GATE CS Previous Year Questions

Transaction · Databases

38 questions · asked in 20 of 27 years (2000–2026)

MCQ 32 · MSQ 5 · NAT 11-mark 19 · 2-mark 19

2000Questions per year2026

Questions 31–35 of 38

Q31GATE 20071 markMCQ−0.33 if wrong
Consider the following schedules involving two transactions. Which one of the following statements is TRUE?
S1:r1(X);r1(Y);r2(X);r2(Y);w2(Y);w1(X)S_1 :r_1(X); r_1(Y); r_2(X); r_2(Y); w_2(Y); w_1(X)
S2:r1(X);r2(X);r2(Y);w2(Y);r1(Y);w1(X)S_2 :r_1(X); r_2(X); r_2(Y); w_2(Y); r_1(Y); w_1(X)

Q32GATE 20061 markMCQ−0.33 if wrong
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 new = 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?

Q33GATE 20051 markMCQ−0.33 if wrong
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 ≤50000\leq 50000, enhance it by 2%
If 50000 < commission ≤100000\leq 100000, 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 correctly

Q34GATE 20051 markMCQ−0.33 if wrong
Amongst the ACID properties of a transaction, the 'Durability' property requires that the changes made to the database by a successful transaction persist

Q35GATE 20041 markMCQ−0.33 if wrong
Consider the following schedule S of transactions T1 and T2:
T1T2Read(A)A = A - 10Read(A) Temp = 0.2*AWrite(A)Read(B)Write(A)Read(B)B = B + 10Write(B)B = B + TempWrite(B){\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 ?

Keep practising

Topics in Databases

All CS topics ›