Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

DDA EC3 Regular

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Question 1

Please answer this question only by typing your answers in the typing space available for
this question.

i) Consider the following classes of schedules: serializable, conflict-serializable, view-


serializable, recoverable, avoids-cascading-aborts, and strict. For each of the following
schedules, state which of the preceding classes it belongs to. If you cannot decide whether a
schedule belongs in a certain class based on the listed actions, explain briefly. Draw the
precedence graph.
a) T1:W(X), T2:R(X), T1:W(X), T2:Commit, T1:Commit (1 mark)
b) T1:W(X), T2:R(X), T1:W(X), T2:Commit, T1:Abort (1 mark)
c) T2: R(X), T3:W(X), T3:Commit, T1:W(Y), T1:Commit, T2:R(Y),
T2:W(Z), T2:Commit (1 mark)
d) T1:R(X), T2:W(X), T1:W(X), T3:R(X), T1:Commit,
T2:Commit, T3:Commit (1 mark)

ii) Consider the following schedules :


S1: r1(w), w1(x), r1(y) , w1(y), r1(x), w2(x), c2, c1
S2: r1(x), w1(x), r2(x), r1(y), w2(x), w1(y), c1, c2
Which schedule is recoverable explain in steps and graphs if needed? (6
marks)

Total marks: 10

Q2

Please answer this question only by typing your answers in the typing space available for
this question.

a). Consider the transactions t1, t2 and t3 and a schedule S given below.
S : read1(A); read2 (B); write1(C); read3(B); read3(C); write2 (B); write3(A) Where the
subscript denotes the transaction number. Assume that the time stamp of t1<t2<t3.
Using time-stamp ordering scheme for concurrency control find out if the schedule will go
through. If there is to be a rollback, which transaction(s) will be rolled back?
(3marks)

b). The following represents the sequence of events in a schedule involving transactions T1,T2,
T3, T4 and T5. A,B, C, D, E, F are items in the database. Draw a wait-for-graph for the data above
and find whether the transactions are in a deadlock or not? (3 marks)
c). Consider the following code:

Is there is any deadlock? If so how do you modify it to avoid deadlock? (4 marks)


Total marks:10

Q3

Please answer this question only by typing your answers in the typing space available for
this question.

a) We have the scenario as follows :


cust(cid, cname, amt) and key is cid, with the following two concurrent transactions.

T1:
Begin Transaction
B1: update cust set amt= 13.5 *amt where name = 'Bob'
B2: update cust set amt = 13.5 * amt where name = 'Bob'
Commit

T2:
Begin Transaction
C1: update cust set amt = amt * 0.5 where name = 'Bob'
C2: update cust set amt = amt * 1.2 where name = 'Bob'
Commit

Assume that the individual statements B1, B2, C1, and C2 always execute atomically. Bob's amt
is 2000 before either transaction begins
execution.
(i) Suppose both transactions T1 and T2 execute to completion with isolation level Serializable.
What are the possible values for Bob's final amt? (2 marks)
(ii) Suppose both transactions T1 and T2 execute to completion with isolation level Read-
Committed. What are the possible values for Bob's final amt? (2 marks)
(iii) Suppose transaction T1 executes with isolation level Read-Committed, transaction T2
executes with isolation level Read-Uncommitted, and both transactions execute to completion.
What are the possible values for Bob's final amt? (2marks)

b) Consider the following contents of a LOG file and determine the:


i) redo and undo list contents (1.5 marks)
ii) each data item value. (1.5 marks)
iii) order of Transactions to recover. (1 marks)

(Start, T0)
(Write, T0, Interest, 6,8)
--------------------x1 crashed
(Commit, T0)
(Start, T1)
(Write, T1, Principle, 200, 400)
(Write, T1, Amount, 500, 600)
(Commit, T1)
(Start , T2)
(Write, T2, Interest, 6, 9)
--------------------x2 crashed
(commit, T2)
(Start , T3)
(Write, T3, Interest, 6, 11)
(Abort, T3)

Total marks:10

Q4:

Please answer this question only by typing your answers in the typing space available for
this question.

DataShare are designing backend for an Customer systems at JK ISP company which has huge
client base and they cater to broadband, mobile phone connections .
They have to maintain customer records, different packages for each service , Bill reminders,
technical issues and complaints and generate monthly bill. There are some people who would
use the DB and they are manager, senior tech, supervisor and customer service person of JK.
You should implement these:

What all database objects are required like SP, Triggers, forms and others.
i). Design the access matrix. (5 marks)
ii). Implement the access matrix. (5 marks)
Total marks: 10 marks.

You might also like