GATE 2016 (Session 2) Computer Science and Information Technology (CS) Questions with Solutions

GATE 2016 (Session 2)

65 questions

MCQ 38 · NAT 271-mark 30 · 2-mark 35

Questions 61–65 of 65

Q61Transaction2 marksMCQ−0.67 if wrong
Consider the following databases chedule with two transactions, T1 and T2.
S=r2(X);r1(X);r2(Y);w1(X);r1(Y);w2(X);a1;a2S=r_{2}(X);r_{1}(X);r_{2}(Y);w_{1}(X);r_{1}(Y);w_{2}(X);a_{1};a_{2}
where ri(Z)r_{i}(Z) denotes a read operation by transaction TiT_{i} on avariable Z, wi(Z)w_{i}(Z) denotes a write operation by TiT_{i} on avariable Z and aia_{i} denotes an abort by transaction TiT_{i}.
Which one of the following statements about the above schedule is TRUE?

Q62SQL2 marksNAT
Consider the following database table named water_schemes :
water_schemes scheme_no district_name capacity 1 Ajmer 20 1 Bikaner 10 2 Bikaner 10 3 Bikaner 20 1 Churu 10 2 Churu 20 1 Dungargarh 10
The number of tuples returned by the following SQL query is __________.
with total(name, capacity) as
    select district_name, sum(capacity)
    from water_schemes
    group by district_name
with total_avg(capacity) as
    select avg(capacity)
    from total
select name
    from total, total_avg
    where total.capacity ≥ total_avg.capacity