Database Management System: Assignment 4: September 2, 2018
Database Management System: Assignment 4: September 2, 2018
Total Marks : 20
September 2, 2018
Question 1
Consider the following functional dependencies Marks: 2 MSQ
AB → C
C → D
BD → E
a) ACD
b) BCD
c) AB
d) CD
Answer: b), c)
Explanation: a) closure of ACD = ACD hence ACD does not determines E. b) closure of BCD
= BCDE. c) closure of AB = ABCDE. d) closure of CD = CD.
AB closure step by step:
Attributes Added in Closure FD
{AB} Triviality
{ABC} AB→ C
{ABCD} C→ D
{ABCDE} BD→ E
1
Question 2
Consider relation r1 Marks:2 MSQ
• r1(p, q, r, s, t)
• p → q,r,s,t
• s→t
• r1 a(p, q, r, s)
• r1 b(s,t)
Answer: b), c)
Explanation: A relation schema R is in Boyce Codd Normal Form (BCNF) with respect to
a set F of functional dependencies if for all functional dependencies in F + of the form α → β,
where α, β ⊆ R at least one of the following holds:
1. α → β is trivial (β ⊆ α)
2. α is a superkey for R
A relation schema R is in Third Normal Form (3NF) with respect to a set F of functional
dependencies if for all functional dependencies in F + of the form α → β, where α, β ⊆ R at
least one of the following holds:
1. α → β is trivial (β ⊆ α)
2. α is a superkey for R
2
Question 3
Consider the set of functional dependencies:
F={
P → QR
Q → R
P → Q
PQ → R
}
Identify the correct canonical cover for the above given set. Marks: 2 MCQ
a) { P → QR; Q → R; P → Q; }
b) { P → Q; Q → R; }
c) { P → QR; PQ → R; P → Q; Q → R }
d) { P → QR; }
Answer: b)
Explanation: A canonical cover must cover the FDs and be minimal. (d) fails Q → R. It is
easy to see that the rest 3 covers F. (b) is the minimal and hence the answer.
• There are two functional dependencies with the same set of attributes on the left:
P → QR
P → Q
These two can be combined to get P → QR.
Now, the revised set F becomes:
F= {P → QR, Q → R, PQ → R }
3
Question 4
Consider the following relational table R: Marks: 2 MSQ
R
X Y Z V W
x1 y1 z1 v1 w1
x2 y2 z1 v2 w2
Also, consider the decomposition of the relation R into R1 = (X, Y, Z) and R2 = (Z, V, W ).
Choose the correct statement/s based on the above relations.
X Y Z V W
x1 y1 z1 v1 w1
b) ΠR1 (r) ./ ΠR2 (r) will be:
x2 y2 z1 v2 w2
Answer: a), c)
Explanation: Let us start with computing the join:
X Y Z V W
x1 y1 z1 v1 w1
x1 y1 z1 v2 w2
ΠR1 (r) ./ ΠR2 (r) =
x2 y2 z1 v1 w1
x2 y2 z1 v2 w2
Also, ΠR1 (r) ./ ΠR2 (r) 6= r (the decomposition is lossy). (c) is correct.
From the above table we can see that XY does not uniquely identify W (first two records). (d)
fails.
4
Question 5
Consider the table below: Marks: 2 MCQ
employee
name emp id department
employee name
emp id name
E-123 Piyush
E-456 Piyush
employee department
emp id department
E-123 Finance
E-456 HR
Identify the correct characteristics of this decomposition (as observed from the given instance).
Answer: b)
Explanation: Apparently no dependency holds on employee. Hence, the decomposition is
trivially dependency preserving and (c) & (d) are incorrect.
In a lossy decomposition, no spurious tuple is generated when a natural join is applied to the
relations in the decomposition. Here, employee name ./ employee department = employee
5
Question 6
Consider the relation R(X,Y,Z,V,W) which satisfies the following functional dependencies:
Marks: 2 MCQ
XY → Z
YZ → V
ZV → W
VW → X
XW → Y
Which of the following functional dependencies are also guaranteed to be satisfied by relation
R?
a) XZ → V
b) YZV → X
c) Z → W
d) X → Z
Answer: b)
Explanation: a) closure of XZ = XZ does not contains V. b) closure of YZV = XYZVW con-
tains X, therefore the option is correct. c) closure of Z = Z does not contains W. d) closure of
X = X does not contains Z.
6
Question 7
Consider following relation.
R
customer id loan number customer city
99-123 23/24 Rye/Manchester
15-106 93 Horseneck
Identify if any multivalued dependency exist in relation R. Marks: 2 MCQ
Answer: b)
Explanation: A customer’s city is independent of the loan that they borrow. After convert-
ing the above relation in Single Valued Attribute, each of a customer’s loan appears with each
of the city they live.
R
customer id loan number customer city
99-123 23 Rye
99-123 23 Manchester
99-123 24 Rye
99-123 24 Manchester
15-106 93 Horseneck
7
Question 8
Consider the smart phone table and the functional dependencies on it. Marks:2 MCQ
Answer: c)
Explanation: In FD3: model, manufacturer → battery, the non prime attribute is de-
pendent on a super key. Also there is no transitive dependency and not composite attribute,
hence the relation is in first, second and third normal form.
The canonical cover for the set of FDs is FD1 and FD2 (covers FD3), and model is its key.
Hence, smart phone is in BCNF which means it is also in 1NF, 2NF, and 3NF.
8
Question 9
Let S(A, B, C, D) be a relational schema with the following functional dependencies:
{ A → B, B→ C, C → D, D→ B }.
Answer: a)
Explanation:
Note that A, B, C and D are all key attributes. We can derive all attributes from every at-
tribute.
Since the intersection of all decomposed relations (S1, S2 and S3) is B and B derives all other
attributes, decomposition is lossless.
The decomposition is dependency preserving as well as all functional dependencies are pre-
served directly or indirectly. Note that C → D is also preserved from C → B (in S2) and B →
D (in S3).
9
Question 10
Consider the following instance of a relational schema R(A, B, C).
A B C
5 5 5
5 5 1
7 9 7
7 9 7
Identify the correct statement(s) based on the above instance of relational schema R.
Marks: 2 MCQ
Answer: c)
Explanation: A → B holds true for the above instance. We can be sure that B does not
functionally determine C because for the value 5 of B, it gives two different values of C i.e.
5 and 1. From the above instance it is concluded that A does not functionally determine C
because for A = 5 there are two values of C.
10