You are on page 1of 17

Department of Computer Science & Engineering

Bhilai Institute of Technology, Durg

Course Name : DBMS [102404CS]

Session: 2022 - 2023

Assignment : 2

Name : ______________________________________

Class Roll Number : _________

University Roll Number : _____________________

Note : Take print out of this assignment worksheet and write the answer in appropriate
place. Attach extra sheet if you want. Try to write neat and clean.

Course Name: 102404CS – Database Management System


CO1 Describe the basic concepts of RDBMS and relational data model.
Discuss the relational database theory & be able to write relational algebra
CO2
expressions for queries.
Write queries using SQL by knowing the importance of data & its
CO3
requirements in any applications.
CO4 Design Databases and improvement through normalization.
Identify basic issues of transaction, its processing and concurrency control and
CO5 be familiar with basic database storage structures and access techniques,
indexing methods.

Grade : ________

Teacher I/ C

(Dinesh Kumar Bhawnani)


SNo. Question BL CO
1. Consider the relation R (ABCDEFGH) and set of FDs F = {AC  G, D 
EG, BC  D, CG  BD, ACD  B, CE  AG}. Find the canonical cover L3 CO4
of F?
2. Find the keys (Candidate Key/ Super Key) for the following.
(A) R (ABC), F = { A  B, B  C, C  A}
(B) R (ABCDE), F = { A  BC, BC  D} L3 CO4
(C) R (ABC), F = { AB  C, C  A}
(D) R (ABCDE), F = {AB  C, CD  E, DE  B}
3. Consider a relation R (ABCDEF) and F = {AB  C, BC  AD, D  E, CE
L3 CO4
 B}. Find (AB)+, (BC)+, (D)+, (CE)+, (CD)+ ?
4. Test Lossless and Dependency Preserving properties for each of the
decomposition given below?
(A) R (ABCDE), F = {B  C, D  A} and R1(BC) and R2(AD)
L3 CO4
(B) R (ABCDE), F = {AB  C, C  A, C  D} and R1(ACD) and R2 ( BC)
(C) R (ABCDE), F = {A  BC, C  AD} and R1(ABC) and R2 (AD)
(D) R (ABCDE), F = {A  B, B  C, C  D} and R1 (AB) and R2(ACD)
5. Consider the following relational schema along with FDs. Find the
highest normal form of the relation along with candidate keys.
(A) R (ABCD), F = {AB  D, C  D} L3 CO4
(B) R (ABCD), F = {B  D, D  AC}
(C) R (ABCD), F = {AC  D, AC  B, D  A}
6. Consider the following schedules :
S1 = R1(X), R2(Z), R1(Z), R3(X),R3(Y),W3(Y), R2(Y), W2(Z), W3(Y)
S2 = R1(X), R2(Z), R3(X), R1(Z),R2(Y),W1(X), W2(Z), W3(Y)
L3 CO5
(i) Create transaction table for each.
(ii) Draw precedence graph for S1 and S2.
(iii) Check whether S1 and S2 are conflict serializable or not.
7. Consider a B+ tree in which the maximum number of keys in a node is 5.
L3 CO5
What is the minimum number of keys in any non-root node?
8. Consider the following relational database schema consisting of the four
relation schemas:
passenger (pid, pname, pgender, pcity)
agency (aid, aname, acity)
flight (fid, fdate, time, src, dest)
booking (pid, aid, fid, fdate)
Answer the following questions using relational algebra queries;
(i) Get the complete details of all flights to New Delhi.
(ii) Get the details about all flights from Chennai to New Delhi.
(iii) Find only the flight numbers for passenger with pid 123 for flights L3 CO3
to Chennai before 06/11/2020.
(iv) Find the passenger names for passengers who have bookings on at
least one flight.
(v) Find the passenger names for those who do not have any bookings in
any flights.
(vi) Find the agency names for agencies that located in the same city as
passenger with passenger id 123.
(vii) Find the details of all male passengers who are associated with Jet
agency.
9. Let the following relation schemas be given:
R = (A, B, C)
S = (D, E , F)
Let relations r(R) and s(S) be given. Give an expression in SQL that is
equivalent to each of the following queries.
L3 CO3
10. Given the following schema:
AIRPORT (City, Country, NumberOfRunways)
FLIGHT (FlightID, Day, DepartCity, DepartTime, ArrCity, ArrTime,
PlaneType)
PLANE (PlaneType, NumberOfPassengers, Payload)
write the SQL queries with which we can find out:
1. The cities with airports for which the number of runways is not
known.
2. The arrival and departure countries of flight AZ-274.
3. The types of aircraft used for flights leaving Boston.
4. The types of aircraft and the corresponding number of passengers for
the types of aircraft used for flights leaving Boston. If the description of
the aircraft is not available, give only the type.
5. The cities from which international flights leave.
6. The cities from which direct flights to Sydney leave, in alphabetical
order. L3 CO3
7. The number of international flights that leave Paris on Thursdays.
8. The number of international flights that leave Canadian cities each
week (to be done in two ways, one showing the airports without
international flights and one not.)
9. The French cities from which more than twenty direct flights to
Germany leave each week.
10.The Belgian airports that have only domestic flights. Show this query
in four ways: (i) with set-theory operators, (ii) with a nested query with
the not in operator, (iii) with a nested query with the not exists operator,
(iv) with the outer join and the count operator.
11. The cities served by the type of aircraft able to carry the maximum
number of passengers.s
12.The maximum number of passengers who could arrive in a Greek
airport from Norway on Thursday. If there are several flights, the total
number of passengers must be found.
Sign of Student Submitted to
Name : Prof. Dinesh Kumar Bhawnani

You might also like