0% found this document useful (0 votes)
3 views5 pages

Transaction & Concurrency Control - DPP 02 (Of Lec 06)

The document contains multiple-choice questions (MCQs) related to transaction and concurrency control in database management systems. It includes questions on serialization of schedules, conflict serializability, and various concurrency problems such as dirty reads and lost updates. An answer key is provided at the end, along with hints and solutions for selected questions.

Uploaded by

kalashri1111
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views5 pages

Transaction & Concurrency Control - DPP 02 (Of Lec 06)

The document contains multiple-choice questions (MCQs) related to transaction and concurrency control in database management systems. It includes questions on serialization of schedules, conflict serializability, and various concurrency problems such as dirty reads and lost updates. An answer key is provided at the end, along with hints and solutions for selected questions.

Uploaded by

kalashri1111
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

1

Branch : CSE & IT Batch : English


Database Management System
Transaction & Concurrency Control DPP 02

[MCQ] [MCQ]
1. Consider the following schedule S of transaction T1, T2 4. Consider the following transactions T1 and T2:
and T3. T1 T2
S: r1(x); r2(x); r3(y); w1(x); r2(z); r2(y); w2(y); w1(z); Read(A); Read(A);
Which one of the schedule below is the correct Update A = A + 100;
serialization of the above. Update A = A – 50;
(a) T2  T1  T3 Write(A);
(b) T3  T2  T1 Write(A);
(c) T3  T1  T2 The above transaction has _____.
(d) T2  T3  T1 (a) Lost update problem
(b) Dirty read problem
(c) Unrepeatable read problem
[MCQ]
(d) Incorrect summary problem
2. Consider the transactions T1, T2 and T3 and the
schedules S1 and S2 given below.
[MCQ]
T1: r1(A); r1(C); w1(A); w1(C)
5. Consider the following schedule.
T2: r2(B); r2(C); w2(C) Time T1 T2
T3: r3(B); r3(A); w3(B) t0 Read Item(A);
S1: r1(A); r3(B); r3(A); r2(B); r2(C); w3(B); w2(C); t1 Read Item(A);
r1(C); w1(A); w1(C) t2 A = A + X;
S2: r1(A); r3(B); r2(B); r3(A); r1(C); r2(C); w3(B); t3 Write Item(A);
w1(A); w2(C); w1(C) t4 Read Item(A);
Which one of the following statements about the
Which of the following concurrency problem exists in
schedule is TRUE?
the above given schedule?
(a) Only S1 is conflict serializable. (a) Dirty read (b) Unrepeatable read
(b) Only S2 is conflict serializable. (c) Lost update (d) Both a and b
(c) Both S1 and S2 are conflict serializable.
(d) Neither S1 nor S2 is conflict serializable. [MCQ]
6. ______Problem occurs when a transaction reads data
from a database, then another transaction reads the
[MCQ] same database data, and this particular data is deleted
3. Which of the following schedule is view serializable by an operation of the first transaction.
but not conflict serializable. (a) Dirty read
(a) r1(P); r2(P); w1(P); r2(Q) (b) Unrepeatable read problem
(b) r1(P); w1(P); r2(P); w2(Q) (c) Phantom read
(c) w1(P); w2(P); w1(P); w2(P); w1(P) (d) Lost update problem
(d) None of these.
2

[MCQ] (c) S may or may not be view serializable schedule.


7. Consider a schedule S: (d) None of these
r1(x), r2(y), w2(x), w3(z), r4(z), r3(x), w3(y), r4(x), w4(y)
[MSQ]
Choose the correct statements for the above schedule
S. 9. Choose the correct statements from the following.
(a) To test view serializability we make use of
(a) The schedule S is not serializable.
precedence graph
(b) The schedule S is conflict serializable with (b) To test conflict serializability we make use of
schedule S as T1T2T3T4. precedence graph.
(c) The schedule S is not view serializable. (c) If there exists no blind write and the schedule is
(d) None of the above. not conflict serializable then we can conclude that
it is not view serializable.
(d) All of the above.
[MCQ]
8. Consider the below schedule.
S: r1(A), r2(B), w2(A), r3(A), w1(B) w3(A)
choose the correct statement from the following.
(a) S is conflict serializable schedule.
(b) S is not conflict serializable schedule.
3

Answer Key
1. (b) 6. (c)
2. (a) 7. (b)
3. (c) 8. (b)
4. (a) 9. (b, c)
5. (b)
4

Hints & Solutions


1. (b) T1 T2
Conflict operation are W1(P)
R2(X); W1(X); R3(Y); W2(Y), R2(Z); W1(Z) W2(P)
W1(P)
W2(P)
W1(P)

From precedence graph, the correct serialization order We check for order of read in view serializability. In
is T3  T2 T1 order T2 T1, the schedule is view serializable.

4. (a)
2. (a)
The Transaction T1 first reads data A from the database
S1: r1(A); r3(B); r3(A); r2(B); r2(C); w3(B); w2(C); then transaction T2 reads the same data from the
r1(C); w1(A); w1(C) database. Then T1 Performs an operation to add 100 to
A. Then transaction T2 Performs an operation to
subtract 50 from the data read by T2. i.e., A. T1
performs a write operation to save the value of A
according to changes made to T1. Then T2 performs a
write operation to update the value of A again in the
As there is no cycle is precedence graph DB. This situation causes changes to A made by T1 to
be lost because T2 overwrites A again after T1 update
 S1 is conflict serializable. A. you could also say that the update of T1 is lost.
S2: r1(A); r3(B); r2(B); r3(A); r1(C); r2(C); w3(B); Hence a is correct option.
w1(A); w2(C); w1(C)
5. (b)
In above schedule, T1 reads value of A and then again
reads the value of A. The Ist value of A is different from
other value in 2nd read.
Hence this is called unrepeatable read.
There exists a cycle hence it is not conflict serializable.
Hence, S1 is conflict serializable but S2 is not conflict 6. (c)
serializable. The phantom read problem arises when a transaction
reads a variable once but when it tries to read the same
variable again which was already deleted by other
3. (c) transaction, this problem known as phantom read
A : False problem.

It is conflict serializable, hence it is also view


7. (b)
serializable.
B : False

It is conflict serializable, hence it is also view


serializable.
C : True

It is not conflict serializable, hence checking for view


serializable. for conflict serializability, we check precedence graph.
5

Conflict serial schedule  T1  T2  T3  T4 Cycle in the precedence graph, therefore not conflict
serializable.

9. (b, c)
For checking conflict serializability we make use of
precedence graph. For checking view serializability we
check for 3 conditions.
1. Initial read
2. Updated read
8. (b) 3. Final write
If a schedule is not conflict serializable and there exists
no blind write then we can conclude the schedule is not
view serializable too.

Precedence graph.

Any issue with DPP, please report by clicking here:- https://forms.gle/t2SzQVvQcs638c4r5


For more questions, kindly visit the library section: Link for web: https://smart.link/sdfez8ejd80if

PW Mobile APP: https://smart.link/7wwosivoicgd4

You might also like