DBMS 2016
DBMS 2016
DBMS 2016
Comprehensive Examination
(EC-3 Regular)
Q.1 (a) For a Library of a College, we need to design a database. The business
rules are as follows.
We have Library Users. A Library user can borrow Books from the
Library. Each book belongs to a category like-
Engg/Management/Arts/Science (only one category). Each book has title,
bookID (unique), ISBN#, price as attributes. Books are published by
Publishers. A Publisher will have name(unique), city, contact as attributes.
Each book is published by only one publisher. Each publisher in the
database will have one to many books published. One user can borrow up
to 5 books. We also capture date of issue, expected return date when a book
is borrowed. We store only the info of currently issued books, not for the
returned ones. Each library user will have a userID (unique), name, address,
and category as attributes.
i First draw an ER diagram for the above requirement. Assume
necessary data which is missing in the question. The model should
include- Entity types, relationships, min-max, cardinality,
participation, and other relevant constraints.
ii Then design relational schemas to capture the data represented in
the ER diagram you have drawn.
[3 + 2 = 5]
Q.3 (a) (i) For the following SQL query, give the query graph.
SELECT S.sid, S.age, C.cname, C.ceo, P.salary
FROM Student as S, Company as C, Placement as P
WHERE S.sid=P.sid and C.cid=P.cid and S.cgpa>8.0 and
C.city=’DELHI’;
(ii) With a simple example brief how pushing the selection and projection
operations as down as possible in the query tree, will improve the
performance.
[3
+2
=
5]
Q.3 (b) (i) In a certain concurrent schedule, we have four transactions T1, T2, T3
and T4. These transactions operate on data items A, B, and C. The
interleaving of operations of these transactions is given in the below.
Schedule :
{r2(A); r3(B); r1(C); w2(A); r3(C); r4(B); w3(B); w1(B); r2(C); r4(C); w1(C); }
Note: Here, r2(A); - means that the transaction-2 reads data item A
w2(C); - means that the transaction-2 updates data item C
Now, Determine whether the above schedule is conflict serializable, by
drawing a precedence graph.
Q.4 (a) Assume that we use Linear hashing technique in some situation and we
use the hash Functions- h0, h1, h2, ... as (K mod 2), (K mod 4), (K mod 8)
and so on.
Note: For both (i) and (ii) give answer using bulleted points.
Q.5 (b) Look at the following partial schedule involving four transactions T1, T2,
T3, and T4.
Now check, if this leads to a deadlock condition, with the help of a wait-for
graph.
Note: T2_lock_S(A) – means T2 locks data item A in Share mode.
T2_lock_X(A) – means T2 locks data item A in Exclusive mode.
T4_R(B)- means T4 reads data item B
T3_W(A) - means T3 writes data item A
Complete working is required.
[5]