0% found this document useful (0 votes)
66 views6 pages

Maulana Azad National Institute of Technology Bhopal Endterm Exam Nov 2021

The document provides instructions for a database management systems exam, including details about submitting answer sheets by email. It lists 4 questions with multiple sub-questions about relational databases, SQL queries, relational algebra, functional dependencies, and concurrency control. Students are asked to design an ER diagram, decompose relations, check for normal forms, transform queries to algebra, and identify concurrency issues. The exam is worth 50 marks and must be submitted within a specified time window.

Uploaded by

akshita gupta
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)
66 views6 pages

Maulana Azad National Institute of Technology Bhopal Endterm Exam Nov 2021

The document provides instructions for a database management systems exam, including details about submitting answer sheets by email. It lists 4 questions with multiple sub-questions about relational databases, SQL queries, relational algebra, functional dependencies, and concurrency control. Students are asked to design an ER diagram, decompose relations, check for normal forms, transform queries to algebra, and identify concurrency issues. The exam is worth 50 marks and must be submitted within a specified time window.

Uploaded by

akshita gupta
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/ 6

Name of the student…………………… Scholar No.

…………………………
MAULANA AZAD NATIONAL INSTITUTE OF TECHNOLOGY BHOPAL
ENDTERM EXAM NOV 2021
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

Course: B. Tech Semester: III Branch: CSE(Subject offered as Minor)


Subject: Database Management Systems Subject Code: CS5305
Date: 27th Nov. 2021 Max Marks: 50
Attempting Time: 2 to 5 PM Time: 3 Hours
Answer sheet Submission time: 5.00 PM to 5.15 PM (15 Minute)

Note: All questions are compulsory.


1. Don’t wait till the deadline to upload, do it as soon as you finish your paper.
2. Write your answers on the white pages with your scholar number and name on each
sheet.
3. Reply and upload the answer sheet in single pdf file with filename as your scholar
number(for example 171112001.pdf) and email your answer sheets to your respective
branch section email id as:
Email-id for CSE1- [email protected]
Email-id for CSE2- [email protected]
Email-id for CSE3- [email protected]
4. All questions are compulsory.

Q. No. Questions Marks


1. a) Consider an Employee relational table with a single record for each employee 03
of the company with the following attributes:
1. Unique employee id for each employee
2. Unique identity number, unique at the national level for each citizen
3. Unique account number at the bank. An employee can have multiple accounts
or joint accounts. This attribute stores the primary account number.
4. Name of the employee
5. Country of residence.
6. Department of the employee.
Which of the following can act as a candidate key: employee id, identity number
or bank account number? Can all of them act as candidate keys? Give reasons for
your answers.

b) Consider the following company schema: 04


Employee (Fname, MINIT, Lname, SSN, dateofbirth, address, sex, salary,
superSSN, Dno)
Department(DNumber, Dname, MgrSSN, Mgr_start_date)
Department_Locations (Dnumber, Dlocation)
Project (Pnumber, Pname, Plocation, DNum)
Works_on (ESSN, PNo, hours)
Dependent (ESSN, dependent_name, sex, bdate, relationship)
Considering the above Company schema express the following queries in SQL:
i. For each department, retrieve the total number of male and female employees
working in that department.
ii. Retrieve name of all employees who work on all projects located in Stanford.
iii. Find the name of employees who work on a project whose controlling
department is same as the department to which an employee belongs to (using
nested query).
iv. Find employees who work on three or more projects (without using aggregate
functions).

c) Consider the following MAILORDER relational schema:


PARTS (pno, pname, Qoh, price, Olevel)
05
CUSTOMERS (Cno, cname, street, city, phone)
EMPLOYEES (Eno, ename, city, hdate)
ORDERS (Ono, Cno, Eno, received, shipped)
ODETAILS (Ono, Pno, Qty)
Express the following queries in relational algebra:
i. Retrieve the names of customers who have ordered parts costing greater than
50$ and Olevel greater than 10.
ii. Retrieve the names of customers who have placed at least two orders with two
different employees.
iii. Retrieve the total number of orders placed by each customer.
iv. Retrieve customer numbers who have placed an order with the employee living
in the same city as the customer.
v. Retrieve order details of orders which contain all parts having Olevel greater
than 5.

2. a) Consider a company personnel database, following information is to be 06


recorded in a database:
The company has a set of sections. Each section has a set of employees, a set of
tasks, and a set of offices.
For each section, the section number(unique), its budget, and the section head’s
employee number(unique) needs to be recorded.
For each employee we need to record its employee number (unique), name, date
of birth, age, sex, address and email id. For each employee we also need to
record the section he belongs to, the current task number an employee is working
on, the current office number, and the current phone number.
For each task, we need to store its task id (unique), budget. A task can be
undertaken jointly by maximum three sections. Each task has an associated
employee as task head for two years after which the head may change. We need
to record the start date and end date of the period for which an employee has
taken charge as head of the task.
Each employee has a job history (set of jobs the employee has held). For each
such job, we need to record the title of the job the employee has held, and its
salary history (set of salaries received while employed on that job). The salary
history includes the date and salary for each distinct salary received in that job.
Each office has an office number (unique), an office manager, floor area, and also
a set of associated phones numbers (unique) for all phones in that office.
Design an ER diagram to represent the database described above. State any
assumptions you make while designing the ER diagram. 4

b) Consider an Entity-Relationship model in which entity sets E1 and E2 are


connected by a one to many 1:n relationship R12 (with E1 on the one side and
E2 on the many side of the relationship) and entities E2 and E3 are connected by
a m:n many to many relationship R23. E1 has two single valued attributes a11,
and a12 and one multivalued attributea13 and of which a11 is the key attribute.
E2 has x singled-valued attributes a21…a2x of which a21 is the key attribute.
The relationship R23 has y single valued attributes. Here x is the last two digits
of your roll number and y is the month of your birthdate.
If a relational model is derived from the above model, then what will be the
minimum number of relations that would be generated if all relations are in 3NF
and also what will be the schema of each relation.
3. a) Consider a relation R(A,B,C,D,E,G,H) with the following FD’s holding on it 5
{AC→B , AD→E, B→D, BC→ A, E→GH }.
i. Find the highest normal form of the above relation.
ii. If relation is not in BCNF decompose it into a collection of BCNF relations.
iii. Check if the decomposition is dependency preserving and lossless join or not.

b) Consider the following set of FD’s holding relation R (A, B, C, D, E, F):


{ A → B, CB → F, AB → C, D → AC, D → EF } 3
Find the closure of F.

c) Consider the relation R (P, Q, S, T, W, X, Y, Z) with the following functional


dependencies PQ →X, P→XY, Q→Y, Y→WZ. Decompose R into 3NF lossless
3
join dependency preserving relations.
4. a) Consider the B+ tree of order 5 as shown in below figure: 5

13, 17, 24, 30

2,3,5,7 13,14,16 17,20,22 24,27,29 30,34,38,39

Show the state of the tree after inserting the following keys: 18, 45, 46, 49, 52,
36, 32, and then deleting 17, 34 from the resultant tree. With reference to the B+
tree resulting after given insertions, what is the minimum number of nodes
(including the Root node) that must be fetched in order to satisfy the following
query. "Get all records with a search key greater than or equal to 18 and less than
49".

b) Create an instance of table FAMILY with fields Fid (Primary key), Full Name,
Age, Relation (Not Null), Mobile Number (Unique), City having at least ten
tuples in the table. Assume that these tuples are stored in a sorted file and the file 4
is stored on a disk and each disk block can contain at most three tuples. Give an
example of primary index and secondary index (on attribute age) that can be
created on this table. Show the data entries of each of the indexes.
5. a) Check whether the following two schedules are conflict serializable, 4
recoverable or not. Give reason for your answer.
i. T1: R(x), T2: W(x), T2:Commit, T1:W(x), T1:Commit, T3:R(x), T3:W(x),
T3:Commit.
ii. T2:R(x), T3:R(z), T3:W(x), T3:Commit, T1:W(y), T1:Commit, T2:R(y),
T2:W(z), T2:Commit.

b) Consider the following schedule: What all concurrency problems does this
4
schedule suffer from giving suitable reasons.
T1 T2
Read(X)
X= X-100
Write(X)
Read(X)
X= X+50
Sum= X+Y
Read(Y) .
Y=Y+10 .
Write(Y) .
Abort .
.
Commit

You might also like