Q1.Which of the following concurrency control protocols ensure both conflict
serializability and freedom from deadlock?
I. 2-phase locking II. Time-stamp ordering
Answer : Option AExplaination / Solution: No Explaination.
Q3.Consider the alphabet ∑ = {0.1},
the null/empty string λ and the sets of strings
X0 , X1 , and
X2 generated by the corresponding non-terminals of regular grammar. X0, X1, and X2 are
related as follows:
X0 = 1X1
X1 = 0X1 + 1X2
X2 = 0X1 + {λ}
Which one of the following choices precisely represents the strings in X0?
Answer : Option CExplaination / Solution: No Explaination.
Q5. Consider the following transactions with data items P and Q initialized to zero:
T1 : read (P) ;
read (Q) ;
if P = 0 then Q : = Q + 1 ;
write (Q).
T2 : read (Q) ;
read (P)
if Q = 0 then P : = P + 1 ;
write (P).
Any non-serial interleaving of T1 and T2 for concurrent execution leads to
Answer : Option BExplaination / Solution:
Let S be a non-serial schedule, without loss of generality assume that T1 has started earlier
than T2. The first instruction of T1 is read(P) and the last instruction of T2 is write(P), so the
precedence graph for S has an edge from T1 to T2, now since S is a non-serial schedule the
first instruction of T2(read(Q)) should be executed before last instruction of T1(write(Q)) and
since read and write are conflicting operations, the precedence graph for S also contains an
edge from T2 to T1, So we will have a cycle in the precedence graph which implies that any
non serial schedule with T1 as the earliest transaction will not be conflict serializable.
In a similar way we can show that if T2 is the earliest transaction then also the schedule is not
conflict serializable.
Q7.The program below uses six temporary variables a, b, c, d, e, f.
a = 1
b = 10
c = 20
d = a + b
e = c + d
f = c + e
b = c + e
e = b + f
d = 5 + e
return d + f
Assuming that all operations take their operands from registers, what is the
minimum number of registers needed to execute thi s program without spilling?
Answer : Option CExplaination / Solution: No Explaination.
Which is the weakest normal form that the new database satisfies, but the old one does not?
Answer : Option AExplaination / Solution:
candidate key is (volume, number, start page, end page)
(Volume number) → year is a partial dependency. So original table is in 1NF but not in 2NF
Q10.Consider an undirected random graph of eight vertices. The probability that there is an edge
between a pair of vertices is ½. What is the expected number of unordered cycles of length
three?