UCS310
UCS310
b) Differentiate between lossy and lossless decomposition used in Normalization with a suitable
example.
a) Consider the following four schedules using read and write operation on a data item X, denoted 2+2+4
by r(x) and w(x) respectively. Find the following schedules are conflict serializable or not, with
explanation.
S I : ri(X); r2(X); wi(X); r3(X); w2(X)
S2: r2(X); ri(X); w2(X); r3(X); wi(X);
S3: r3(X); r2(X); ri (X); w2(X); wi (X);
S4: r2(X); w2(X); r3(X); ri(X); wi(X);
Read(Z)
Write(X)
Commit
Re od(Z)
Write(X)
Commit
WLite(Y)
Read(Z)
Commit
Read(X)
Read(Y)
Commit
Using precedence graph, describe whether the above Schedule is conflict serializable, view
serializable or both.
c) Explain Cascadeless Recoverable schedule. Find out whether the given schedule S is Cascadeless
schedule or not. Justify your answer.
S: Ri(A) R2 (C) R3(A) RAC) R2(B) 113(B) W,(A) CI W2(C) W3(B) W2(B) C.3 C2.
Where, Ri(X) and W,(X) represent read and write operations on data item X by transaction T,
respectively and C, is commit of transaction Ti.
Page 1 of 2
a) Explain Strict Two-Phase Locking (Strict 2PL) protocol and its advantages with respect to basic 5+3
Q3
2PL. For the given schedule below, explain whether Basic 2PL and Strict 2PL can be applicable
or not.
T1 T2
Read(A)
WrIte(A)
Read(B)
Read(A)
Read(C)
Write(B)
b) Consider a database with objects X and Y and assume that there are two transactions T1
and 77.
Transaction TI reads objects X and Y and then writes object X. Transaction T2 reads objects X
and Y and then writes objects X and Y. Using the given operations of transactions T1 and T2,
construct the schedules which show the following conflicts. Also justify how conflicts occur.
(I) write-read conflict
(ii) read-write conflict
(iii) write-write conflict
6+2
Q4 a) Consider the table Emp (empno, ename, deptno, salary) to write a PL/SQL program to increase the
salary of an employee according to the following rule:
• Salary of the department number 10 employees increased by 1000.
• Salary of the department number 20 employees increased by 500.
• Salary of the department number 30 employees increased by 500.
• Store the employee number, old salary and new salary in another table named temp having
three columns empno, old_ salary, new_ salary.
b) Write the PL/SQL program to define and raise a user defined exception named invalid id. for
above table Emp, if [ empno <----- 0].
5+3
Q5 a) Convert the following E-R diagram to Tables. Explicitly mention primary and foreign keys for
each of the table.
°Co Re TREE.
)
T. 4320, cs)
4csi. COURSE ID
S T UD ENT _NAME ADDRESS
. _I 0
COURSE
1 COL/RSE_NAME
STUDENT ID
hi N
STUDENT Attends COURSE
AGE .
.. .'
1
1
EIC
C7557)
04
Teaches
009
LF.CTURER11)
4`
M Al
41=011*
EMU* r.R ID ISCTIAT.R_NAME COUR SEJO
Page 2 of 2