You are on page 1of 3

Reg. No.

:
Name

VIT®
BHOPAL
www.vitbhopal.ac.in

TERM END EXAMINATIONS (TEE)-February-March 2023


Pro2ramme : B.Tech. Semester : Winter 2022-23
Course Title/ . Database Management Systems
/CSE3001 Slot : Dll +D12+D13
Course Code .
Time : 1½ hours Max.Marks : 50

Answer ALL the Questions

Q.No. Question Description Marks

PART-A ( 30 Marks)
1. (a) Consider the following ER diagram.

The above diagram represents bank database.


1. Determine all strong entity types in the ER diagram.
11. Provide the name and partial-key of weak entity type.
m. Determine the constraints specified by partial-key and the identifying
relationship of the weak entity type.
1v. Suppose that every customer must have at least one account but is restricted to
at most two loans at a time, and that a bank branch cannot have more than 1000
loans. How does this show up on the (min,max) constraints?

OR

Page 1 of3
1. (b) Consider following relational database schema shown in the figure:

EMPLOYEE
I Fname I Mini! I Lname I Ssn Bdate Address I Sex I Salary Super_ssn I Ono
DEPARTMENT
I Dname I Dnumber Mgr ssn I Mgr start datel

DEPT_LOCATIONS
I Dnurnber I Dlocation
PROJECT
I Pname I Pnumber I Plocation Dnum

WORKS_ON

I I E!!Q. I Hours I
DEPENDENT
I Essn I Dependent_name I Sex I Bdate Relationship

Write relational algebra queries to:

1. Find the names of employees that are directly supervised by 'ABC'.


11. Retrieve the names of employees who do not work on any project.
m. For each department, retrieve the department name, and the average salary of
employees working in that department.
1v. List the last names of department managers who have no dependents.

2. (a) Consider following relational database schema shown in the figure:


EMPLOYEE
I Fname I Mini! I Lnarne I Ssn I Bdate ! Address ! Sex ! Salary Super_ssn I Ono

DEPARTMENT
I Dname I Dnumber Mgr_ssn I Mgr_start_datel

DEPT_LOCATIONS
I Dnumber I Dlocation I
PROJECT
I Pname I I Plocation Dnum

WORKS_ON
I I Pno Hours I
DEPENDENT
I Essn I Dependent name Sex I Bdate Relationship

Write and explain SQL query to list the managers who have at least one dependent.

OR
2. (b) Write a program (PL/SQL code) to calculate the value of 'a' using following formula:
a= b + cd"-2 - e / 4
Display only the result (i.e. the value of a).

Page 2 of3
3. (a) Consider following relational database schema shown in the figure:

EMPLOYEE
I Fname I Mini! I Lname I Ssn I Bdate I Address I Sex I Salary Super_ssn I Dno

DEPARTMENT
I Dname I Dnumber I Mgr ssn I Mgr start datel

DEPT_LOCATIONS

1 1 1
PROJECT

I Pname I I Plocation Dnum

WORKS_ON

I I I Hours I
DEPENDENT
I Essn I Dependent name I Sex I Bdate I Relationship I
Compare the cost of two different query plans for the following query:
O"salary<4oooo(EMPLOYEE l><lvno=Dnumber DEPARTMENT )
OR
3.
(b) Let Rn(X) = Read operation on item X of n transaction. th

Wn(X) = Write operation on item X of nth transaction.

Check whether the following schedule S is conflict serializable or not using precedence
graph:
S: = R4(A), R2(A), R3(A), W1(B), W2(A), R3(B), W2(B)
Time
If yes, then determine all the possible serialized schedules.

PART- B (20 Marks)


4.
Describe Two Phase locking (2PL) mechanism with the help of an example . In the
example provided by you explain in the detail, how 2PL is ensuring/ guaranteeing
serializability.

5.
Consider a given relation R with four attributes ABCD. For the given set of attributes
consider following sets of FDs:
AB C
FD= AB D
C A
{ D B

Assuming those are the only dependencies that hold for R, do the following:
1. Identify the candidate key(s) for R.
11. Identify the best normal form that R satisfies (INF, 2NF, 3NF, or BCNF).
m. IfR is not in BCNF, decompose it into a set ofBCNF relations that preserve the
dependencies.

Page 3 of3

You might also like