KIIT Deemed to be University
Online End Semester Examination(Spring Semester-2021)
Subject Name & Code: Database Management Systems (CS 2004)
Applicable to Courses: B.Tech (CSE, IT, CSSE & CSCE)
Full Marks=50 Time:2 Hours
SECTION-A(Answer All Questions. Each question carries 2 Marks)
Time:30 Minutes (7×2=14 Marks)
Question Question Question CO Answer Key
No Type Mapping (For MCQ
(MCQ/S Questions
AT) only)
Q.No:1 Let R(m, n) and S(o,p) be two relations,
then the outcome of the following SQL
MCQ query
select distinct m,n
from R, S CO2 B
will be identical to R, if:
(a) S has no duplicates and R is non-empty
(b) R has no duplicates & S is non-empty
(c) R and S have no duplicates
(d) R & S have the identical tuples
Which of the following statement is
equivalent to the 'SELECT' statement of
SQL?
MCQ
a) selection operation in relational algebra CO2 D
b) projection operation in relational
algebra
c) selection operation in relational algebra,
except that SELECT in SQL retains
duplicates
d) projection operation in relational
algebra, except that SELECT in SQL
retains duplicates
Let R (A, B, C) be a relation as follows:
A B C
10 20 30
70 20 80
MCQ 10 20 50
What is the correct output of the following CO2
SQL query?
D
SELECT COUNT(*) FROM (SELECT
r1.A, r1.B, r1.C FROM R r1, R r2 WHERE
r1.A = r2.A AND r1.B = r2.B);
(a) 8
(b) 7
(c) 6
(d) 5
Which of the following statement is true
regarding TRUNCATE, DELETE and
DROP commands?
I. DELETE is a DML statement, but
TRUNCATE and DROP are DDL
MCQ statements.
II. DELETE operation can be rolled back
but TRUNCATE and DROP operations CO2
cannot be rolled back.
III. TRUNCATE and DROP operations can D
be rolled back but DELETE operations
cannot be rolled back.
IV. All are an example of DDL.
a) I and III
b) II and III
c) II and IV
d) I and II
Q.No:2 In an Entity-Relationship (ER) model,
let S is a many-to-one relationship from
entity set R1 to entity set R2. Assume
that R1 and R2 participate totally in S and
that the cardinality of R1 is more than the
MCQ cardinality of R2. Which one among the
following is true about S?
CO3 B
(a) Every entity in R1 is related to at least
one entity in R2.
(b) Every entity in R1 is related to exactly
one entity in R2.
(c) Every entity in R2 is related to
maximum one entity in R1.
(d) Every entity in R2 is related to exactly
one entity in R1.
Let us consider an ER diagram with
following assumptions:
(i) Let P, Q and S be three different entities
in that ER diagram comprising
MCQ single-valued attributes, except for S, which
has only one multi-valued attribute.
(ii) Let R1 and R2 be two relationships
between P and Q, where R1 is one-to-many
while R2 is many-to-many. CO3 A
(iii) Let R3 and R4 be two relationships
between Q and S, where R3 is many-to-one
while R4 is a many-to-many.
(iv) Relationships R1, R2, R3 and R4 do not
have any attributes of their own.
How many minimum number of tables
required to map this scenario into relational
model?
(a) 6
(b) 3
(c) 5
(d) 7
Consider the relations schema of the
following STUDENT table:
STUDENT( Roll_No, S_Name, Mail_id,
Bank_Account_No,Hostel_Room_No)
The attributes are described as follow:
Roll_No: Roll number of each registered
student, which is unique.
Mail_id : Each students must have a unique
mail-id. C
Bank_Account_No: Unique account number CO4
at the bank. A student can have multiple
accounts or even joint accounts. This
MCQ attribute stores the primary account number.
S_name: Full name of the student.
Hostel_ Room_No: Room number allocated
to the student.
Which of the following options is not
correct?
a) Mail_id is a candidate key.
b) Roll_No can be a primary key.
c) Bank_Account_No is a candidate
key.
d) If S is a super key such that
'S' ∩ 'Hostel_ Room_No' is NULL
then 'S' U 'Hostel_ Room_No' is also
a super key.
1. Let us consider two relations P (u,v,w)
and Q (a,b,c) where u denotes the foreign
key of P which refers to the primary key of
Q. Assume the following four tasks.
(a)Insert into Q
(b)Insert into P
(c)Delete from Q
MCQ (d)Delete from P
Considering the above tasks, which of the C04
following is correct regarding the referential B
integrity constraint:
a) Operations (a) and (b) will cause
violation.
b) Operations (b) and (c) will cause
violation.
c) Operations (c) and (d) will cause
violation.
d) Operations (d) and (a) will cause
violation.
Q.No:3 Once a transaction successfully completes
its execution, all changes made by it in
database persist, even if there are system
failures. This feature is ensured by
durability property of transaction. Which
component of database system is
responsible for implementing this B
MCQ durability:
CO6
(a) Both Concurrency control component
and Transaction management component.
(b) Only Recovery management
component.
(c) Only Transaction management
component.
(d) Both Transaction management
component and Recovery management
component.
In lock based protocols. a transaction that
holds a lock on a data item is allowed to
change the lock from one mode to another
under certain condition. Changing the mode
of a lock that is already held is called lock
conversion. Which among the following is
true for lock conversion:
I. In Lock Upgrading a shared lock is
upgraded to an exclusive lock whereas an
exclusive lock is downgraded to a shared
lock in Lock Downgrading. C
MCQ II. Lock upgrading can take place only in
the growing phase, whereas lock CO6
downgrading can take place both in growing
as well as in the shrinking phase.
III. Two-phase locking with lock
conversion generates only
conflict-serializable schedules.
(a) Only I and II.
(b) Only II and III.
(c) Only I and III.
(d) I, II and III
The Timestamp Ordering Protocol is used to
order the transactions based on their
Timestamps. Here every transaction has a
timestamp associated with it, and the
ordering is determined by the age of the
transaction. Let the transaction T1 entered
the system at 004 times and another
MCQ transaction T2 entered the system at 006
times. Then, which among the following is
incorrect about Timestamp Ordering
Protocol. C
I. The transaction T1 issuing a Read
(X) operation will be rejected if CO6
TS(T1) < W_TS (X).
II. This protocol is free from deadlock
thus no transaction ever waits.
III. The transaction T1 issuing Write(X)
operation will be executed if TS(T1)
< R_TS(X).
a) Only I
b) Only II
c) Only III
d) Both I and III
The atomicity property of a transaction
despite failure can be ensured using two log
based approaches which include deferred
database modification and immediate
database modification. If a transaction does
MCQ not update the database until it has
committed then which approach is CO6 A
recommended:
(a) Deferred database modification
(b) Immediate database modification
(c) Both
(d) Either of them
Q.No:4 Let R = (STUVWXYZ) be a relation
schema with given set of functional
dependencies, F = {UZ → Y, S → TU, T →
UXZ, W → S, X → WY}.The feasible
candidate keys of this relation are: CO5
C
MCQ a) SV, WV, TV, WY
b) SV, UV, WV, XV
c) SV, WV, TV, XV
d) UV, XV, YV, WV
Normalization is a process of organizing the
data in database to avoid data redundancy
and anomalies. Several normal forms are
used for this purpose. With respect to
normal forms in database systems, which of
MCQ the following is true:
(a) Every relation in 3NF is also in BCNF C
(b) A relation R is in 3NF if every
non-prime attribute of R is fully CO5
functionally dependent on every key of R
(c) Every relation in BCNF is also in 3NF
(d) 4NF is concerned with only join
dependency.
Consider two relational schemes for a
database: R1 (ABCDEF) and R2 (ABC)
with the following functional dependencies:
AB → C
C → ABDE
DE → F
CO5
MCQ Assume {AB} is the key for both relations.
Which of the following statements is true? B
(a) Both R1 and R2 are in BCNF
(b) R1 is in 2NF and R2 is in 3NF
(c) Both R1 and R2 are in 3NF only
(d) Both R1 and R2 are in 2NF only
The maximum number of super keys
possible for a relation schema R(PQRS)
with P as the key is:
CO4
MCQ (a) 6 C
(b) 7
(c) 8
(d) 9
Q.No:5 The three schema architecture in DBMS is
used to describe the structure of a specific
database system and is used to separate the
user applications from the physical
database. Which level in this architecture is
used to define the low-level data structures:
B
I. External level CO1
MCQ II. Internal level
III. Conceptual level
(a) Only I
(b) Only II
(c) Both I and II
(d) Both II and III
Which of the following is not a super key in
a relational schema with
attributes {KLMNO} and primary
key {KN}:
MCQ CO2
(a) KLNO C
(b) KMNOL
(c) KLOM
(d) KLN
Statement 1: When a node is split during
insertion in B+ tree, the middle key is
promoted to the parent as well as retained in
right half-node.
Statement 2: A B+ tree can support both
random access as well as sequential access.
CO6
MCQ Statement 3: In a B+ tree, both the internal C
nodes and the leaves have keys.
(a) Statement 1 and 3 are true.
(b) Statement 2 and 3 are true.
(c) Statements 1 and 2 are true.
(d) All statements are true
A B+ tree is a balanced binary search tree
which follows a multi-level index format
where all leaf nodes remain at the same
height. Consider a B+ tree comprising
maximum of 9 pointers in a node. What is CO6 B
MCQ the minimum number of keys in leaves:
(a) 3
(b) 4
(c) 5
(d) 6
Q.No:6 I. A secondary index provides a
secondary means of accessing a file
for which some primary access
already exists.
MCQ II. The secondary index may be on a CO6 A
field which is a candidate key and
has a unique value in every record,
or a non-key with duplicate values.
III. The secondary index is only based
on a non-key with duplicate values.
a) Statement I and II are true.
b) Statement II and III are true.
c) Statements I and III are true.
d) All statements are true
Let R(W,X,Y,Z) and X → Y && Z → W
&& WY→ Z, then using composition
and/or
pseudo-transitivity we can say:
CO5 C
(a) Option 1: WX → Z
(b) Option 2: XZ → YW
MCQ (c) Both option 1 and option 2
(d) None of the above
Let R(W,X,Y,Z). If X → Y && Z → W,
then XZ → YW can be proved in a best way
by using:
CO5
(a) Reflexivity & Pseudo-transitivity C
(b) Augmentation & Union
(c) Augmentation & Transitivity
(d) Transitivity & Union
Which one of the following statements about
normal forms is FALSE, when a relation
schema, R, is decomposed into two
sub-schemas R1 and R2? D
a) In lossless join decomposition, the
common attribute must be a key for at least
MCQ one relation. CO5
b) Lossless join and dependency preserving
decomposition into 3 NF is always possible.
c) Loss less join and dependency preserving
decomposition into BCNF is always not
possible
d) None of the above
Q.No:7 Let R(A, B, C, D, E, F) be a relation schema
with sets of functional dependencies, F =
P{AB → CDEF, C→D, E→F}. The
domain of all attributes are atomic. In which
MCQ highest normal form the relation schema R CO5 B
is??
a) 1NF
b) 2NF
c) 3NF
d) None of the above
A relation R(ABC) is having the following 4
tuples: (1,2,3), (4,2,3,), (5,3,3,) and (2,4,4,).
Which of the following dependencies can
MCQ you infer does not hold over relation R? CO5
a) C→B A
b) A→B
c) AB→C
d) B→C
An expression in the domain relational
calculus is of the form
a) a) {P(x1, x2, . . . , xn) | < x1, x2, . . . , xn > }
b) {x1, x2, . . . , xn | < x1, x2, . . . , xn > }
MCQ c) { x1, x2, . . . , xn | x1, x2, . . . , xn}
d) {< x1, x2, . . . , xn > | P(x1, x2, . . . , xn)} CO2 D
Which of the following concurrency control
protocols ensure both conflict serialzability
and freedom from deadlock?
MCQ I. Time-stamp ordering protocol CO6
II. Two-phase locking protocol
A
(a) II only
(b) Both I and II
(c) I only
(d) None
SECTION-B(Answer Any Three Questions. Each Question carries 12
Marks)
Time: 1 Hour and 30 Minutes (3×12=36 Marks)
Question No Question CO
Mapping
(Each
question
should be
from the
same
CO(s))
Q.No:8 A Company is organized into a number of departments.
Each department has a unique name and location. An
employee can manage only one department at a time
and a department can be managed by only one
employee. The Start date for the manager is recorded.
Department may have several locations. A department
controls a number of projects. Projects have a unique
name, number and a single location. Company’s
employee’s name, employee number (which is unique),
address, salary, sex and birth date are stored. An
employee is assigned to only one department, but may
work for several projects. Number of hours/week an
employee works on each project is recorded. An
employee may have dependant(s). Employee’s
dependants are tracked for health insurance purposes.
The dependants record consists of dependent's name
(not unique), birthdate, relationship to employee. All
employee can be classified as officer or secretary, but
not the both. (Note: All relations mentioned above are CO3
with employees but not explicitly with officer or
secretary)
(a) Construct an ER Diagram for the above problem
description. Clearly mention all assumptions made by
you in imposing constraints. (8 marks)
(b) Map the ER diagram into relations and specify the
primary keys and foreign keys of each relation.
(4 marks)
Q. No. 8 Numerous educational institutions are present for
which their unique inst_ID need to be stored along with
inst_Name and domain. Every year a cultural event
(unique eventID, eventName, eventTheme, budget) is
conducted by every institution where huge gathering
takes place. Each person in the gathering has unique
personID WITH personName, age and address. People
in the gathering can be classified as either employee CO3
(with salary) or student (with CGPA) or staffs (with
working_hrs). All students in the events are managed
by both employees and staffs. Every cultural event has
various sessions (recognized by unique sessionID
along with sessionName and sessionType). Students
have the liberty to take part in one or multiple sessions.
Likewise, many students can participate in one session.
Different students are assigned as session coordinators
for different session. Every session is associated with
many awards and awardName with prize_money is
linked to each award. Every award is identified by
awardName for its own session.
(a) Draw the ER model for the above scenario and
highlight all essential assumptions .
(8 marks)
(b) Map the ER diagram into relations and specify the
primary keys and foreign keys of each relation.
(4 marks)
Q. No. 8 The Flight database stores detail about an airline’s
fleet, flights and seat bookings as per the following:
The airline has one or more airplanes. An airplane is CO3
associated with a model number, a unique registration
number and the capacity to take one or more
passengers. An airplane flight has a unique flight
number, a departure airport, a destination airport, a
departure date and time and an arrival date and time.
Each flight is carried out by a single airplane. A
passenger has given names, a surname and a unique
email address. A passenger can book a seat on a flight.
It is to be noted here that, a pilot (who is an employee)
can fly various airplanes, but allotted to only one flight.
(a) Draw the ER diagram of the above problem
description. Make necessary assumptions.
(8 marks)
(b) Map the ER diagram into relations and specify the
primary keys and foreign keys of each relation.
(4 marks)
Q.No:9 What is an extraneous attribute? Given a relational
Schema R( W, X, Y, Z) and set of Functional
Dependencies, FD = { W → X, Y → X, Z → WXY,
WY → Z }. Find the canonical cover? Mention all steps
for finding the canonical cover. (6 marks)
BCNF is a stronger form of normalization than 3NF. CO5
Justify. (2 marks)
Find the highest normal form of given relation schema
R(A,B,C,D,E) with set of functional dependencies, F =
{AB→CE, BC→D, C→E}. (4 marks)
Q.No:9 1) Let R = (A,B,C,D,E) be a given relation schema with
functional dependencies, F = {CE → D,D → B,C → A}.
(1+ 2+ 3 = 6 marks)
a) Find all candidate keys.
b) Check whether R is in BCNF or not?
c) If R is not in BCNF, then do the BCNF
decomposition and check whether the
decomposition is lossless and dependency
preserving decomposition or not??
CO5
2) Let R(UVWXY) be a relation schema with a set of
functional dependencies, F={UV → WX, U → V, VY
→ XU, Y → X, W → X}. Compute a canonical cover of
F. Show the intermediate steps of your derivation
(6 marks)
Q.No:9 1) Let R = (A,B,C,D) be a given relation schema with CO5
functional dependencies, F = {AB → C, C → B, C →
D}. (2+4 = 6 marks)
a) Find candidate keys, prime attributes and non
prime attributes of R.
b) Is R in 3 NF or in BCNF? Justify. If not then
normalize R.
2) Let R = (A,B,C) be a given relation schema with
functional dependencies, F = {A→ BC, B → C, A → B,
AB→C}. (3+3 =6 marks)
a) Find the canonical cover of F. Show the
intermediate steps of your derivation.
b) Justify that the canonical cover of F is
equivalent to F.
Q.No:10 1) Concurrency control helps in managing
simultaneous operations without conflicting with each
another. In relation to this, discuss with example the
following problems that may be encountered during
concurrency execution of transactions:
I. Lost update problem
II. Dirty read problem. CO6
(6 marks)
2) Check whether the given schedules are conflict
serializable or not using precedence graph.
a) R4(X), R2(X), R3(X), W1(Y), W2(X), R3(Y),
W2(Y)
b) R1(X), R2(Z), R1(Z), R3(X), R3(Y), W1(X),
W3(Y), R2(Y), W2(Z), W2(Y)
(6 marks)
Q.No:10 1. (6 marks) CO6
Explain how serializability help to maintain the
consistency of the database. Verify whether the
given schedule S is conflict serializable or not,
using precedence graph.
S : R1(A) , R2(A) , R1(B) , R2(B) , R3(B) , W1(A) ,
W2(B)
2. (4+2=6 marks)
a) Using label precedence graph, check
whether the given schedule S with
transactions T1, T2, and T3 is view
serializable or not.
S= R1(A), R2(A), W3(A), W1(A)
b) Give your comment on the state of the
following schedule with justification.
T1 T2
Lock-X(A)
R(A)
W(A)
Lock-X(B)
R(B)
W(B)
Lock-X(A)
Lock-X(B)
Q.No:10 1. Check the serilaizability of the following schedules CO6
using precedence graph/ label precedence graph as per
the question. (6 marks)
a) R2(X), W3(X), W1(X), W2(Y), R4(X), R4(Y),
for conflict serializability.
b) R1(X); W1(X); R3(X); R2(X); W3(X), for view
serializability.
2. Consider the following log sequence of two
transactions on a bank account, 'B', with initial balance
12000, that transfer 2000 to a mortgage, 'M', payment
and then apply 5% interest. (6 marks)
1. <T1, START>
2. <T1, B, old = 12000, new = 10000>
3. <T1, M, old = 0, new = 2000>
4. <T1, COMMIT>
5. <T2, START>
6. <T2, B, old = 10000, new = 10500>
7. <T2, COMMIT>
Find the actions to be taken when the database system
crashes just before log record 6, and just before log
record 7 with the following updates:
a) deferred update
b) immediate update
Q.No:11 1. Consider the relational scheme: (8 marks) CO4 & CO6
EMPLYOEE (person_name, street, city)
WORKS(person_name, company_name, salary)
COMPANY(company_name, city)
MANAGERS(person_name, manager_name)
Give the expression in relational algebra of the
following queries:
a) Find the name of all employees who works for
'TCS' company.
b) Find the name of all employees who earns more
than every employee of 'Infosys' company.
(without using aggregate function)
c) Find the name of all employees who live in the
same city and same street as do their managers.
d) Give all employees a 10% salary rise.
2. Supported with suitable example (of your own) and
schematic diagram, explain the primary index and
secondary index. (4 marks)
Q.No:11 1. Suppose we have an ordered data file with r = 24,000 CO4 & CO6
records stored on a disk with block size B = 512 bytes.
File record are of fixed size with record length, R = 120
bytes.
One primary index file of the given data file is created
based on ordering key field of the file. Assume that, the
length of each index entry is 12 bytes (key field size= 7
bytes and a block pointer size = 5 bytes).
Calculate the following: (8 marks)
a) Blocking factor of data file and index file.
b) Total number of blocks required for data file and
index file.
c) Number of block access on data file for a binary
search.
d) Number of block access on Index file for a
binary search.
2. Construct a B+ tree of order 3, for (1, 4, 7, 10, 16, 20,
32, 41). Mention all steps for every insertion during the
creation of the tree. (4 marks)
Q.No:11 1) Consider the airline flight relational schema details:
Flight (flight-no, from, to)
Aircraft (aid, aname, cruise_range)
Certified (e-id, a-id)
Employee (eid, ename, salary)
Here the employee relation describes pilots and other
kinds of employees as well. Every pilot is certified for
some aircraft (else he/she will not qualify as a pilot) CO4 & CO6
and only pilots are certified to fly. With respect to this,
write the following queries in relational algebra.
(8 marks)
I. Find the eid of pilots certified for boeing aircraft.
II. Find the names of pilots certified.
III. Find the aid of all aircraft that can be utlized on
non-stop flights from Bhubaneswar to Delhi.
IV. Determine the flights that can be piloted by every
pilot whose salary is greater than Rs. 100,000.
2.) Construct a B+ tree of order 4, for letters (M, O, T, H,
E, R, L, A, N, D) Mention all steps for every insertion
during the creation of the tree. (4 marks)
CO # Detail
CO1 Describe the fundamentals of relational database management systems
CO2 Explain the basic concepts of relational data model, entity-relationship model, relational
database design, relational algebra and SQL.
CO3 Design ER-models to represent simple database application scenarios
CO4 Convert the ER-model to relational tables, populate relational database and formulate SQL
queries on data.
CO5 Improve the database design by normalization.
CO6 Familiar with transaction processing, basic database storage structures and access techniques:
file and page organizations, indexing methods including B tree, and hashing..