You are on page 1of 3

Birla Institute of Technology & Science, Pilani

Work-Integrated Learning Programmes Division


Second Semester 2020-2021
Comprehensive Examination (EC-3 Make-up)

Course No. : CSI ZG518


Course Title : Database Design and Applications
Nature of Exam : Open Book
Weightage : 45% No. of Pages =3
Duration : 2 Hours No. of Questions = 6
Date of Exam : Sunday, 16/05/2021 (AN)
Note:
1. Please follow all the Instructions to Candidates given on the cover page of the answer book.
2. All parts of a question should be answered consecutively. Each answer should start from a fresh page.
3. Assumptions made if any, should be stated clearly at the beginning of your answer.

Q.1 (a) Why do we create index on the database and what are its advantages? To every
advantage we need to pay some price. What is the price we need to pay when we
create an index?

Q.1 (b) Create a B tree and B+ tree of order 3 when the following elements are inserted in the
given sequence
5, 10, 12, 13, 14, 1, 2, 3, 4

Q.1 (c) a B+ tree is created with the following conditions. The block size is 1K bytes, data
record pointer is 7 bytes long, the value field is 9 bytes long and a block pointer is 6
bytes long. What can be the maximum order of the leaf node? [3 + 4 + 3 = 10]

Q.2 Given three schedules. Determine whether they are conflict serializable or not and show
your calculations. Justify with reasoning whether they are recoverable and have cascading
rollback. Based on your above logic, what can you say about view serializability?

Sl: rl (X); r2 (Z); rl (Z); r3 (X); r3 (Y); wl (X); cl ; w3 (Y); c3; r2 (Y); w2 (Z); w2 (Y); c2;
S2: rl (X); r2 (Z); rl (Z); r3 (X); r3 (Y); wl (X); w3 (Y); r2 (Y); w2 (Z); w2 (Y); cl; c2; c3;
S3: rl (X); r2 (Z); r3 (X); rl (Z); r2 (Y); r3 (Y); wl (X); cl; w2 (Z); w3 (Y); w2 (Y); c3; c2;
[6 + 3 + 1 = 10]
Q.3 Consider the following state of transactions

Which of the transactions need to be redone, undone and ignored and why? [3]

Q.4 (a) What is the usage of Relation Algebra when we can’t use it to program directly? What
is the motivation for studying Relation Algebra

The following relational schema contains three tables (relations) named EMPLOYEE,
WORKS, and COMPANY as detailed below:
EMPLOYEE(e_no Number(5), e_name Character(35), e_address Character(150), city
Character(35), mgr_cd Number(5))
Primary key (e_no), Foreign Key (mgr_cd) references EMPLOYEE(e_no) e_name Unique

WORKS(e_no Number(5), c_name Character(35), salary Number(6))


Primary key (e_no), Foreign Key (c_name) references COMPANY(c_name)
Foreign Key (e_no) references EMPLOYEE(e_no)

COMPANY(c_name Character(35), c_address Character(150), city Character(35))


Primary key (c_name)

Write SQL for the following:


Q.4 (b) Find all such employees’ e_no and e_name who live in the same city as city in which
the company where he/she works is located and that company has more than 10
employees working with it.
Q.4 (c) Find all employees’ e_no, e_name, c_name who earn less than every employee of
company ‘The Signature’.
Q.4 (d) Find those companies located in a city and all resident employees (irrespective of
company where they work) of that city earn higher salary than the average salary of
the employees not working in that company.
Q.4 (e) Modify the database so that ‘Radhika Electronics Pvt. Ltd.’ has now been shifted to
city ‘Surat’ from ‘Chandigarh’ and now it has a new employee named ‘Cheeranjiv
Patel’ residing in ‘Surat’ at ‘House#125, Ring Road, Near Railway Station’ and this
new employee now manages all the other employees of this company. [5 x 2 = 10]
Q.5 Convert the following ER diagram to Relation model [5]

Q.6 (a) One of your friends says that any relation schema with two single valued attributes is
always in 3NF. You claim and prove that such relation is always in BCNF. Take all
the scenarios and prove your valid argument.
Q.6 (b) Discuss the scenarios which compel us to normalize a relation. Upon normalization,
there are pitfalls which we need to be careful of. Elaborate these pitfalls.

[5 + 2 = 7]

*********

You might also like