0% found this document useful (0 votes)
91 views5 pages

SS ZG518

This document provides instructions for a database design and applications comprehensive examination for a course at Birla Institute of Technology & Science, Pilani. It includes details of the exam such as the course information, date, duration, number of questions and pages. The exam contains 8 questions assessing relational algebra expressions, transaction scheduling analysis, concurrency control protocols, functional dependency and normalization, entity-relationship modeling, and B+ tree generation.

Uploaded by

Avinash Pandey
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
91 views5 pages

SS ZG518

This document provides instructions for a database design and applications comprehensive examination for a course at Birla Institute of Technology & Science, Pilani. It includes details of the exam such as the course information, date, duration, number of questions and pages. The exam contains 8 questions assessing relational algebra expressions, transaction scheduling analysis, concurrency control protocols, functional dependency and normalization, entity-relationship modeling, and B+ tree generation.

Uploaded by

Avinash Pandey
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Birla Institute of Technology & Science, Pilani

Work-Integrated Learning Programmes Division


First Semester 2019-2020

Comprehensive Examination
(EC-3 Make-up)

Course No. : SS ZG518


Course Title : DATABASE DESIGN AND APPLICATIONS
Nature of Exam : Open Book
Weightage : 45% No. of Pages =5
Duration : 3 Hours No. of Questions = 8
Date of Exam : Sunday, 01/12/2019 (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. Consider the given relational database schema, where the primary keys are underlined.
Give an expression in the relational algebra to express each of the following queries:
[2 + 2 + 2 + 2 + 2 = 10]
person(name, city)
works_for (name, employed_in, salary)
CEO (name, CEO-name, city)
bank (bank-name, city)

(a) Find the names of all employees who earn more than every employee of the bank
B.
(b) Find all banks located in every city in which bank B is located.
(c) Find the bank with the most employees.
(d) Find the bank with the smallest payroll.
(e) Find those banks whose employees earn a higher salary, on average, than the
average salary at bank B.

Q.2. Consider the following schedule: [3 + 2 = 5]

T1 T2 T3 T4
Read(A)
Read(A)
Read(A)
Write(B)
Write(A)
Read(B)
Write(B)

(a) Write down all the conflicting operations, draw the precedence graph and identify
whether the schedule is conflict-serializable or not. Justify your answer.
(b) Identify whether the schedule is view-serializable or not. Justify your answer.

SS ZG518 (EC-3 Make-up) First Semester 2019-2020 Page 1 of 5


SS ZG518 (EC-3 Make-up) First Semester 2019-2020 Page 2
Q.3. Consider the following schedule: [3]

T1 T2 T3

Read(A)
Read(A)
Read(B)
Write(A)
Read(B)
Write(B)
Read(A)

If the scheduler is following a strict 2PL for concurrency control, then:


(a) Insert appropriate lock commands in the schedule.
(b) Draw the wait-for-graph of the schedule and check whether a deadlock has
occurred or not. Justify your answer.

Q.4. Consider a directed graph G = (V, E) consisting of following edges: {(A, B), (A, C), (B,
D), (B, E), (B, F), (D, G), (D, H), (H, J), (E, I)}. If the scheduler is following graph
based protocol for the concurrency control, then identify the locks those are not permitted
in the above schedule. Justify your answer. [2]

T1 T2 T3 T4
x-lock(B)
x-lock(D)
lock-x(H)
unlock(D)
lock-x(E)
lock-x(D)
unlock-x(B)
unlock-x(E)
lock-x(B)
lock-x(E)
unlock-x(H)
lock-x(B)
unlock-x(D)
lock-x(D)
lock-x(H)
unlock-x(D)
unlock-x(H)
unlock-x(E)
unlock-x(B)
unlock-x(G)

SS ZG518 (EC-3 Make-up) First Semester 2019-2020 Page 2 of 5


SS ZG518 (EC-3 Make-up) First Semester 2019-2020 Page 3

Q.5. On the relational schema r(A,B,C,D,E) following are the functional dependencies:
AB
ABC
DABE
Find the canonical cover. Use this to have dependency preserving-lossless join
decomposition of relation into 3NF. [5]

Q.6. Figure 1 shows the incorrect ER representation of organization schema. The cardinality,
participation and other characteristics of entity/relationship sets are incorrect and
incomplete. Answer the following questions based on the text provided in the question.
[1+1+0.5+1+0.5+1+1+1+1+2=10]

Figure 1. Incorrect ER diagram of Organization

SS ZG518 (EC-3 Make-up) First Semester 2019-2020 Page 3 of 5


SS ZG518 (EC-3 Make-up) First Semester 2019-2020 Page 4

(a) Many employees can be related to one department but each employee must be related to
only one single department. All employees must be related to at least one department and
all departments must have at least one employee. Represent the simple ER model with
“Employee”, and “Department” entity sets; and “Emp_Dept” relationship set. (refer figure
1)
(b) An employee is working on a project to supply a customer. Assume employee and
customer pair can work on one single project. The participation of all the entity sets in
“Proj_Emp_Cust” relationship set is partial. Represent the simple ER model with
“Employee”, “Customer” and “Project” entity sets; and “Proj_Emp_Cust” relationship set.
(refer figure 1)
(c) What would be the equivalent reduction of proj_emp_cust relationship set from ER data
model to Relational schema? Clearly underline the primary key of the derived
proj_emp_cust relation. Mention the foreign keys and their reference. (refer figure 1)
(d) Address attribute in “Employee” (so as with “Customer”, and “Supplier”) entity set is
composite attribute having house number, area, and city attributes. Area is also a
composite attribute with area number and area name attributes. phone_number is a
multivalued attribute. Along with the other attributes show pictorially how would you
represent employee entity set in ER model.
(e) Depict the correct pictorial representation of “Project” entity set with ID, name, start_date,
end_date, total_run_time as the attributes in ER model.
(f) There is a relationship (with relationship set “Dept_Proj_Emp_Cust”) between
“Department” with “Employee”, “Project” and “Customer” for the fulfillment of a project.
The new relationship set “Dept_Proj_Emp_Cust” has one attribute report associated. With
the knowledge provided in part (ii) and using Extended ER features represent the
relationship set pictorially.
(g) Reduce the relationship set formed in previous question to a relationship schema. Mention
the primary key of the relation. Also write the foreign keys in relation with complete
reference to relations.
(h) Another entity set “Manager” is related to employee. Managers are employees with their
IDs represented in “Employee” entity set. They have special rooms for them and can share
room with other managers. Represent the “Manager”, and “Employee” entity sets; and
represent the relationship set “Emp_manager” using ER representation.
(i) Reduce the relationship set “Emp_manager” and entity set “Manager” using relational
schema. Remove the redundancy (if any).
(j) We need to represent the “Employee”, “Supplier” and “Customer” entity sets as
specialization of person entity set (with attributes ID, name, address, and contact number).
The extra attribute in employee is salary, in supplier is turnover and for customer entity
set is paying_capacity. Assuming they are overlapping and partial specialization, draw the
ER diagram and write the corresponding relational schema.

Q.7. A B+- tree with space for maximum 4 pointers is built by 10 successive insertions. What
is the maximum number of node splitting operations that may take place if we wish to
insert the following 9, 19, 29, 38, 25, 16, 4, 2, 8, 1? Show each step of the B+ tree
generation. [5]

SS ZG518 (EC-3 Make-up) First Semester 2019-2020 Page 4 of 5


SS ZG518 (EC-3 Make-up) First Semester 2019-2020 Page 5

Q.8. Suppose that we need to create a dynamic hash structure on relational schema “Customer”
with search key as the attribute “customer_name” and the following tuples: [5]

Customer_ID Customer_name Phone_no. Email


256 John 9998102000 [email protected]
312 John 8760981432 [email protected]
123 Anna 1222343241 [email protected]
111 Anna 9098745987 [email protected]
432 Anna 0918228200 [email protected]
567 Williams 9897197265 [email protected]
887 Brown 1782653092 [email protected]
119 Dan 1615718998 [email protected]
876 Suzan 8759342987 [email protected]
765 Suzan 7863309000 [email protected]
234 Mary 2546338272 [email protected]
878 Suzan 7363864487 [email protected]
871 Suzan 9836386447 [email protected]

The 32 bit hash values on “customer_id” are h(customer_id):

Customer_name h(customer_name)
John 0011 1001 1000 0001 0110 1110 1111 0001
Anna 1011 0110 1110 0001 1010 0101 1101 0101
Williams 1100 0001 1100 1101 0001 1010 0101 0001
Brown 0011 1110 0001 1010 0001 0101 1110 0011
Dan 0111 1001 1111 0000 0101 1010 0011 1001
Suzan 0101 0001 1111 0101 1010 0010 1001 1111
Mary 0110 0001 1111 1001 0101 0001 1000 0011

Assuming the maximum bucket size is 3 tuples, clearly draw the step by step insertion of
the tuples of the Customer relation in the dynamic hash table.

******

SS ZG518 (EC-3 Make-up) First Semester 2019-2020 Page 5 of 5

You might also like