CD BSRpeb J2 W T96
CD BSRpeb J2 W T96
Max. Marks 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 5 5
4. Consider the relation REFRIG(MODEL#, YEAR, PRICE,
CO No. 1 1 2 4 3 1,2 3,4 2 3 3 1 2,3 4 3 2 2,4 2 1,4
MANUF_PLANT, COLOR), which is abbreviated as REFRIG (M, Y, P, MP,
Cognitive Level U, R R Ap, C Ap, C E An Ap E R Ap R E R An R An, Ap R
E C), and the following set F of functional dependencies: F = {M ->MP, {M,
Section/Chapter/Unit 3 1 2 4 5 4 5 6 4 6 6 7 8 6 8 7 4 1-10
Y} -> P, MP -> C}
a) Evaluate each of the following as a candidate key for REFRIG, giving
Note: reasons why it can or cannot be a key: {M}, {M, Y}, {M, C}. (2)
1. Attempt all the questions. b) Based on the above key determination, state whether the relation
REFRIG is in 3NF and BCNF, giving proper reasons. (3)
1. a) Consider the following transaction involving two bank accounts x and y.
read (x); x := x – 50 ; write (x)
5. a) What is Join? Differentiate between natural join and full join with example.
read (y) ; y≔ y + 50 ; write (y)
What constraint (ACID) ensures that the total amount across accounts x and (2)
y remains unchanged during the given transaction? (2) b) Consider the following relations for a database that keeps track of student
b) How do Data Definition Language (DDL) and Data Manipulation enrolment in courses and the books adopted for each course:
Language (DML) differ in their roles within a retail company's STUDENT(SSN, Name, Major, Bdate)
implementation of a database management system (DBMS) for online sales COURSE(Course#, Cname, Dept)
expansion? Provide at least two most suitable examples of each of the DDL ENROLL(SSN, Course#, Quarter, Grade)
BOOK_ADOPTION(Course#, Quarter, Book_ISBN)
and DML commands to illustrate their respective functions. (3)
TEXT(Book_ISBN, Book_Title, Publisher, Author)
Specify the foreign keys for this schema, stating any assumptions you make.
2. A comprehensive database system is being developed for a hospital to Next, populate the relations with a few examples of tuples, and then give an
manage patient care, staff information, and administrative processes example of an insertion in the ENROLL and BOOK_ADOPTION relations
efficiently. The system should handle patient admissions, medical records, that violates the referential integrity constraints and of another insertion that
staff scheduling, inventory management, and billing seamlessly. does not. (3)
a) Design an E-R schema diagram illustrating the relationships and entities
involved in this application, emphasizing the dynamic interactions 6. a) What is the system log used for? What are the typical kinds of records in
between patients, doctors, nurses, medical procedures, medications, and a system log? (2)
administrative entities. (2) b) Consider the three transactions T1, T2, and T3, and the schedules S1 and
b) Map the E-R diagram into a relational model, delineating the tables, S2 given below.
attributes, and relationships required to support the functionalities of the T1: r1 (X); r1 (Z); w1 (X);
hospital database. Ensure the relational model captures data integrity T2: r2 (Z); r2 (Y); w2 (Z); w2 (Y);
through appropriate constraints and reflects the complex nature of T3: r3 (X); r3 (Y); w3 (Y);
S1: r1 (X); r2 (Z); r1 (Z); r3 (X); r3 (Y); w1 (X); w3 (Y); r2 (Y); w2 (Z); w2 (Y);
healthcare operations effectively. (3) S2: r1 (X); r2 (Z); r3 (X); r1 (Z); r2 (Y); r3 (Y); w1 (X); w2 (Z); w3 (Y); w2 (Y);
Draw the serializability (precedence) graphs for S1 and S2 and state whether Suppose that we use the immediate update protocol with check pointing.
each schedule is serializable or not. If a schedule is serializable, write down Describe the recovery process from the system crash. Specify which
the equivalent serial schedule(s). (2+1) transactions are rolled back, which operations in the log are redone which (if
any) are undone, and whether any cascading rollback takes place. (3)
7. a) What is meant by cascading rollback? Why do practical recovery methods
use protocols that do not permit cascading rollback? (2) 9. Write SQL queries on the database schema shown in Figure.
b) Consider the following ordering Schedule – ‘S’ of transactions:
T1: R(A); T1 : A: =A+5; T1 ; commit;
T2: R(B); T2 : B: = B+5; T3 : R(C);
T3: C:= C+5; T3 : C: = C+5; T4 : R(A);
T4: A:= A+5; T4 : R(D); T4 : D:=D+5;
T4: commit; T2: commit; T3: commit;
Let the initial value of A=B=C=D=0. The system follows a log-based
recovery process of immediate database modification. The assumption is the
concurrency control system uses strict 2PL, and all the transactions share a
common disk buffer and single log. Explain what happens during the
recovery process, if failure occurs at the ‘T2: commit’ statement. (3)
8. a) What are some variations of the two-phase locking protocol? Why is strict a) Retrieve the names of all employees in department 5 who work more than 10
two-phase locking often preferred? (2) hours per week on the 'ProductX' project.
b) The following figure shows the log corresponding to a particular schedule b) Find the names of all employees who are directly supervised by Piyush.
c) For each department, retrieve the department name and the average salary of all
at the point of a system crash for four transactions T1, T2, T3, and T4.
employees working in that department.
d) Retrieve the average salary of all female employees.
e) Find the names and addresses of all employees who work on at least one project
located in Jalandhar but whose department has no location in Jalandhar. (1×5=5)