QUESTIONS ON NORMALIZATION
Question on Second Normal Form (2NF):
1. Given a relation R( A, B, C, D) and Functional Dependency set FD
= { AB → CD, B → C }, determine whether the given R is in 2NF? If
not convert it into 2 NF.
Solution: Let us construct an arrow diagram on R using FD to calculate the
candidate key.
From above arrow diagram on R, we can see that an attributes AB is not
determined by any of the given FD, hence AB will be the integral part of the
Candidate key, i.e. no matter what will be the candidate key, and how many
will be the candidate key, but all will have W compulsory attribute.
Let us calculate the closure of AB
AB + = ABCD (from the method we studied earlier)
Since the closure of AB contains all the attributes of R, hence AB is
Candidate Key
From the definition of Candidate Key(Candidate Key is a Super Key
whose no proper subset is a Super key)
Since all key will have AB as an integral part, and we have proved that AB is
Candidate Key, Therefore, any superset of AB will be Super Key but not
Candidate key.
Hence there will be only one candidate key AB
Definition of 2NF: No non-prime attribute should be partially dependent on
Candidate Key
Since R has 4 attributes: - A, B, C, D, and Candidate Key is AB, Therefore,
prime attributes (part of candidate key) are A and B while a non-prime
attribute are C and D
a) FD: AB → CD satisfies the definition of 2NF, that non-prime attribute(C
and D) are fully dependent on candidate key AB
b) FD: B → C does not satisfy the definition of 2NF, as a non-prime
attribute(C) is partially dependent on candidate key AB( i.e. key should not
be broken at any cost)
As FD B → C, the above table R( A, B, C, D) is not in 2NF
Convert the table R(A, B, C, D) in 2NF:
Since FD: B → C, our table was not in 2NF, let's decompose the table
R1(B, C)
Since the key is AB, and from FD AB → CD, we can create R2(A, B, C, D) but
this will again have a problem of partial dependency B → C, hence R2(A, B,
D).
Finally, the decomposed table which is in 2NF
a) R1( B, C)
b) R2(A, B, D)
2. Given a relation R( P, Q, R, S, T) and Functional Dependency set
FD = { PQ → R, S → T }, determine whether the given R is in 2NF? If
not convert it into 2 NF.
Solution: Let us construct an arrow diagram on R using FD to calculate the
candidate key.
From above arrow diagram on R, we can see that an attributes PQS is not
determined by any of the given FD, hence PQS will be the integral part of the
Candidate key, i.e., no matter what will be the candidate key, and how many
will be the candidate key, but all will have PQS compulsory attribute.
Let us calculate the closure of PQS
PQS + = PQSRT (from the method we studied earlier)
Since the closure of PQS contains all the attributes of R, hence PQS is
Candidate Key
From the definition of Candidate Key (Candidate Key is a Super Key
whose no proper subset is a Super key)
Since all key will have PQS as an integral part, and we have proved that PQS
is Candidate Key. Therefore, any superset of PQS will be Super Key but not
Candidate key.
Hence there will be only one candidate key PQS
Definition of 2NF: No non-prime attribute should be partially dependent on
Candidate Key.
Since R has 5 attributes: - P, Q, R, S, T and Candidate Key is PQS, Therefore,
prime attributes (part of candidate key) are P, Q, and S while a non-prime
attribute is R and T
a) FD: PQ → R does not satisfy the definition of 2NF, that non-prime
attribute( R) is partially dependent on part of candidate key PQS.
b) FD: S → T does not satisfy the definition of 2NF, as a non-prime
attribute(T) is partially dependent on candidate key PQS (i.e., key should not
be broken at any cost).
Hence, FD PQ → R and S → T, the above table R( P, Q, R, S, T) is not
in 2NF
Convert the table R( P, Q, R, S, T) in 2NF:
Since due to FD: PQ → R and S → T, our table was not in 2NF, let's
decompose the table
R1(P, Q, R) (Now in table R1 FD: PQ → R is Full F D, hence R1 is in 2NF)
R2( S, T) (Now in table R2 FD: S → T is Full F D, hence R2 is in 2NF)
And create one table for the key, since the key is PQS.
R3(P, Q, S)
Finally, the decomposed tables which is in 2NF are:
a) R1( P, Q, R)
b) R2(S, T)
c) R3(P, Q, S)
3. Given a relation R( P, Q, R, S, T, U, V, W, X, Y) and Functional
Dependency set FD = { PQ → R, PS → VW, QS → TU, P → X, W → Y },
determine whether the given R is in 2NF? If not convert it into 2 NF.
Solution: Let us construct an arrow diagram on R using FD to calculate the
candidate key.
From above arrow diagram on R, we can see that an attributes PQS is not
determined by any of the given FD, hence PQS will be the integral part of the
Candidate key, i.e. no matter what will be the candidate key, and how many
will be the candidate key, but all will have PQS compulsory attribute.
Let us calculate the closure of PQS
PQS + = P Q S R T U V W X Y (from the closure method we studied earlier)
Since the closure of PQS contains all the attributes of R, hence PQS is
Candidate Key
From the definition of Candidate Key(Candidate Key is a Super Key
whose no proper subset is a Super key)
Since all key will have PQS as an integral part, and we have proved that PQS
is Candidate Key, Therefore, any superset of PQS will be Super Key but not a
Candidate key.
Hence there will be only one candidate key PQS
Definition of 2NF: No non-prime attribute should be partially dependent on
Candidate Key
Since R has 10 attributes: - P, Q, R, S, T, U, V, W, X, Y, and Candidate Key is
PQS calculated using FD = { PQ → R, PS → VW, QS → TU, P → X, W → Y }.
Therefore, prime attribute(part of candidate key) are P, Q, and S while non-
prime attribute are R, T, U, V, W, X and Y
a. FD: PQ → R does not satisfy the definition of 2NF, that non-prime
attribute( R) is partially dependent on part of candidate key PQS
b. FD: PS → VW does not satisfy the definition of 2NF, that non-prime
attribute( VW) is partially dependent on part of candidate key PQS
c. FD: QS → TU does not satisfy the definition of 2NF, that non-prime
attribute( TU) is partially dependent on part of candidate key PQS
d. FD: P → X does not satisfy the definition of 2NF, that non-prime
attribute( X) are partially dependent on part of candidate key PQS
e. FD: W → Y does not violate the definition of 2NF, as the non-prime
attribute(Y) is dependent on the non-prime attribute(W), which is not
related to the definition of 2NF.
Hence because of FD: PQ → R, PS → VW, QS → TU, P → X the above
table R( P, Q, R, S, T, U, V, W, X, Y) is not in 2NF
Convert the table R( P, Q, R, S, T, U, V, W, X, Y) in 2NF:
Since due to FD: PQ → R, PS → VW, QS → TU, P → X our table was not in 2NF,
let's decompose the table
R1(P, Q, R) (Now in table R1 FD: PQ → R is Full F D, hence R1 is in 2NF)
R2( P, S, V, W) (Now in table R2 FD: PS → VW is Full F D, hence R2 is in
2NF)
R3( Q, S, T, U) (Now in table R3 FD: QS → TU is Full F D, hence R3 is in 2NF)
R4( P, X) (Now in table R4 FD : P → X is Full F D, hence R4 is in 2NF)
R5( W, Y) (Now in table R5 FD: W → Y is Full F D, hence R2 is in 2NF)
And create one table for the key, since the key is PQS.
R6(P, Q, S)
Finally, the decomposed tables which is in 2NF are:
R1(P, Q, R)
R2( P, S, V, W)
R3( Q, S, T, U)
R4( P, X)
R5( W, Y)
R6(P, Q, S)
4. Given a relation R( A, B, C, D, E) and Functional Dependency set
FD = { A → B, B → E, C → D}, determine whether the given R is in
2NF? If not convert it into 2 NF.
Solution: Let us construct an arrow diagram on R using FD to calculate the
candidate key.
From above arrow diagram on R, we can see that an attributes AC is not
determined by any of the given FD, hence AC will be the integral part of the
Candidate key, i.e. no matter what will be the candidate key, and how many
will be the candidate key, but all will have W compulsory attribute.
Let us calculate the closure of AC
AC + = ACBED( from the closure method we studied earlier)
Since the closure of AC contains all the attributes of R, hence AC is
Candidate Key
From the definition of Candidate Key(Candidate Key is a Super Key
whose no proper subset is a Super key)
Since all key will have AC as an integral part, and we have proved that AC is
Candidate Key, Therefore, any superset of AC will be Super Key but not
Candidate key.
Hence there will be only one candidate key AC
Definition of 2NF: No non-prime attribute should be partially dependent on
Candidate Key
Since R has 5 attributes: - A, B, C, D, E and Candidate Key is AC, Therefore,
prime attribute (part of candidate key) are A and C while the non-prime
attribute are B D and E
a. FD: A → B does not satisfy the definition of 2NF, as a non-prime
attribute(B) is partially dependent on candidate key AC (i.e., key
should not be broken at any cost).
b. FD: B → E does not violate the definition of 2NF, as a non-prime
attribute(E) is dependent on the non-prime attribute(B), which is not
related to the definition of 2NF.
c. FD: C → D does not satisfy the definition of 2NF, as a non-prime
attribute(D) is partially dependent on candidate key AC (i.e., key
should not be broken at any cost)
Hence because of FD A → B and C → D, the above table R( A, B, C, D,
E) is not in 2NF
Convert the table R(A, B, C, D, E) in 2NF:
Since due to FD: A →B and C → D our table was not in 2NF, let's decompose
the table
R1(A, B, E) ( from FD: A → B and B → E and both are violating 2 NF
definition)
R2( C, D) (Now in table R2 FD: C → D is Full F D, hence R2 is in 2NF)
And create one table for candidate key AC
R3 ( A, C)
Finally, the decomposed tables which are in 2NF:
a. R1( A, B, E)
b. R2( C, D)
c. R3( A, C)
Procedure: To verify that given relational schema R is in 2NF or NOT, If NOT
then Convert it to 2NF:
STEP 1: Calculate the Candidate Key of given R by using an arrow diagram
on R.
STEP 2: Verify each FD with Definition of 2NF (No non-prime attribute
should be partially dependent on Candidate Key)
STEP 3: Make a set of FD which do not satisfy 2NF, i.e. all those FD which
are partial.
STEP 4: Convert the table R in 2NF by decomposing R such that each
decomposition based on FD should satisfy the definition of 2NF:
STEP 5: Once the decomposition based on FD is completed, create a
separate table of attributes in the Candidate key.
STEP 6: All the decomposed R obtained from STEP 4 and STEP 5 forms the
required decomposition where each decomposition is in 2NF.
QUESTIONS ON THIRD NORMAL FORM
To solve the question on 3 NF, we must understand it's both definitions:
Definition 1: A relational schema R is said to be in 3NF, First, it should be in
2NF and, no non-prime attribute should be transitively dependent on the Key
of the table.
If X → Y and Y → Z exist then X → Z also exists which is a transitive
dependency, and it should not hold.
Definition 2: First it should be in 2NF and if there exists a non-trivial
dependency between two sets of attributes X and Y such that X → Y (i.e., Y is
not a subset of X) then
a. Either X is Super Key
b. Or Y is a prime attribute.
Question 1: Given a relation R( X, Y, Z) and Functional Dependency set FD
= { X → Y and Y → Z }, determine whether the given R is in 3NF? If not
convert it into 3 NF.
Solution: Let us construct an arrow diagram on R using FD to calculate the
candidate key.
From above arrow diagram on R, we can see that an attribute X is not
determined by any of the given FD, hence X will be the integral part of the
Candidate key, i.e. no matter what will be the candidate key, and how many
will be the candidate key, but all will have X compulsory attribute.
Let us calculate the closure of X
X + = XYZ (from the closure method we studied earlier)
Since the closure of X contains all the attributes of R, hence X is Candidate
Key
From the definition of Candidate Key (Candidate Key is a Super Key
whose no proper subset is a Super key)
Since all key will have X as an integral part, and we have proved that X is
Candidate Key, Therefore, any superset of X will be Super Key but not the
Candidate key.
Hence there will be only one candidate key X
Definition of 3NF: A relational schema R is said to be in 3NF, First, it should
be in 2NF and, no non-prime attribute should be transitively dependent on
the Key of the table.
If X → Y and Y → Z exist then X → Z also exists which is a transitive
dependency, and it should not hold.
Since R has 3 attributes: - X, Y, Z, and Candidate Key is X, Therefore, prime
attribute (part of candidate key) is X while a non-prime attribute are Y and Z
Given FD are X → Y and Y → Z
So, we can write X → Z (which is a transitive dependency)
In above FD X → Z, a non-prime attribute( Z) is transitively depending on the
key of the table( X ) hence as per the definition of 3NF it is not in 3
NF, because no non-prime attribute should be transitively dependent
on the key of the table.
Now check the above table is in 2 NF.
a. FD: X → Y is in 2NF ( as Key is not breaking and its Fully functional
dependent )
b. FD: Y → Z is also in 2NF( as it does not violate the definition of 2NF)
Hence above table R( X, Y, Z ) is in 2NF but not in 3NF.
We can also prove the same from Definition 2: First, it should be in 2NF
and if there exists a non-trivial dependency between two sets of attributes X
and Y such that X → Y (i.e., Y is not a subset of X) then
a. Either X is Super Key
b. Or Y is a prime attribute.
Since we have just proved that above table R is in 2 NF. Let's check
it for 3NF using definition 2.
a. FD: X → Y is in 3NF (as X is a super Key)
b. FD: Y → Z is not in 3NF (as neither Y is Key nor Z is a prime attribute)
Hence because of Y → Z using definition 2 of 3NF, we can say that above
table R is not in 3NF.
Convert the table R( X, Y, Z) into 3NF:
Since due to FD: Y → Z, our table was not in 3NF, let's decompose the table
FD: Y → Z was creating issue, hence one table R1(Y, Z)
Create one Table for key X, R2(X, Y), since X → Y
Hence decomposed tables which are in 3NF are:
R1(X, Y)
R2(Y, Z)
Question 2: Given a relation R( X, Y, Z, W, P) and Functional Dependency
set FD = { X → Y, Y → P, and Z → W}, determine whether the given R is in
3NF? If not convert it into 3 NF.
Solution: Let us construct an arrow diagram on R using FD to calculate the
candidate key.
From above arrow diagram on R, we can see that an attributes XZ is not
determined by any of the given FD, hence XZ will be the integral part of the
Candidate key, i.e. no matter what will be the candidate key, and how many
will be the candidate key, but all will have XZ compulsory attribute.
Let us calculate the closure of XZ
XZ + = XZYPW (from the closure method that we studied earlier)
Since the closure of XZ contains all the attributes of R, hence XZ is
Candidate Key
From the definition of Candidate Key (Candidate Key is a Super Key
whose no proper subset is a Super key).
Since all key will have XZ as an integral part, and we have proved that XZ is
Candidate Key, Therefore, any superset of XZ will be Super Key but not the
Candidate key.
Hence there will be only one candidate key XZ
Definition of 3NF: First it should be in 2NF and if there exists a non-trivial
dependency between two sets of attributes X and Y such that X → Y ( i.e., Y is
not a subset of X) then
a. Either X is Super Key
b. Or Y is a prime attribute.
Since R has 5 attributes: - X, Y, Z, W, P and Candidate Key is XZ, Therefore,
prime attribute (part of candidate key) are X and Z while a non-prime
attribute are Y, W, and P
Given FD are X → Y, Y → P, and Z → W and Super Key / Candidate Key is XZ
a. FD: X → Y does not satisfy the definition of 3NF, that neither X is Super
Key nor Y is a prime attribute.
b. FD: Y → P does not satisfy the definition of 3NF, that neither Y is Super
Key nor P is a prime attribute.
c. FD: Z → W satisfies the definition of 3NF, that neither Z is Super Key
nor W is a prime attribute.
Convert the table R( X, Y, Z, W, P) into 3NF:
Since all the FD = { X → Y, Y → P, and Z → W} were not in 3NF, let us
convert R in 3NF
R1(X, Y) {Using FD X → Y}
R2(Y, P) {Using FD Y → P}
R3(Z, W) {Using FD Z → W}
And create one table for Candidate Key XZ
R4( X, Z) { Using Candidate Key XZ }
All the decomposed tables R1, R2, R3, and R4 are in 2NF( as there is no
partial dependency) as well as in 3NF.
Hence decomposed tables are:
R1(X, Y), R2(Y, P), R3( Z, W), and R4( X, Z)
Question 3: Given a relation R( P, Q, R, S, T, U, V, W, X, Y) and Functional
Dependency set FD = { PQ → R, P → ST, Q → U, U → VW, and S → XY},
determine whether the given R is in 3NF? If not convert it into 3 NF.
Solution: Let us construct an arrow diagram on R using FD to calculate the
candidate key.
From above arrow diagram on R, we can see that an attribute PQ is not
determined by any of the given FD, hence PQ will be the integral part of the
Candidate key, i.e. no matter what will be the candidate key, and how many
will be the candidate key, but all will have PQ compulsory attribute.
Let us calculate the closure of PQ
PQ + = P Q R S T U X Y V W (from the closure method we studied earlier)
Since the closure of XZ contains all the attributes of R, hence PQ is
Candidate Key
From the definition of Candidate Key (Candidate Key is a Super Key
whose no proper subset is a Super key)
Since all key will have PQ as an integral part, and we have proved that XZ is
Candidate Key, Therefore, any superset of PQ will be Super Key but not
Candidate key.
Hence there will be only one candidate key PQ
Definition of 3NF: First it should be in 2NF and if there exists a non-trivial
dependency between two sets of attributes X and Y such that X → Y (i.e., Y is
not a subset of X) then
c) Either X is Super Key
d) Or Y is a prime attribute.
Since R has 10 attributes: - P, Q, R, S, T, U, V, W, X, Y, V, W and Candidate
Key is PQ, Therefore, prime attribute (part of candidate key) are P and Q
while a non-prime attribute are R S T U V W X Y V W
Given FD are {PQ → R, P → ST, Q → U, U → VW and S → XY} and Super Key /
Candidate Key is PQ
a. FD: PQ → R satisfy the definition of 3NF, as PQ Super Key
b. FD: P → ST does not satisfy the definition of 3NF, that neither P is
Super Key nor ST is the prime attribute
c. FD: Q → U does not satisfy the definition of 3NF, that neither Q is
Super Key nor U is a prime attribute
d. FD: U → VW does not satisfy the definition of 3NF, that neither U is
Super Key nor VW is a prime attribute
e. FD: S → XY does not satisfy the definition of 3NF, that neither S is
Super Key nor XY is a prime attribute
Convert the table R( X, Y, Z, W, P) into 3NF:
Since all the FD = { P → ST, Q → U, U → VW, and S → XY } were not in 3NF,
let us convert R in 3NF
R1(P, S, T) {Using FD P → ST }
R2(Q, U) {Using FD Q → U }
R3( U, V, W) { Using FD U → VW }
R4( S, X, Y) { Using FD S → XY }
R5( P, Q, R) { Using FD PQ → R, and candidate key PQ }
All the decomposed tables R1, R2, R3, R4, and R5 are in 2NF( as there is no
partial dependency) as well as in 3NF.
Hence decomposed tables are:
R1(P, S, T), R2(Q, U), R3(U, V, W), R4( S, X, Y), and R5( P, Q, R)
Conclusion: From the above three examples, we can conclude that the
following steps are followed to check whether the given relational schema R
is in 3 NF or not? If not, how to decompose it into 3 NF.
STEP 1: Calculate the Candidate Key of given R by using an arrow diagram
and then using the closure of an attribute on R, such that from the calculated
candidate key, we can separate the prime attributes and non-prime
attributes.
STEP 2: Verify each FD with Definition of 3NF (First it should be in 2NF and
if there exist a non-trivial dependency between two sets of attributes X and Y
such that X → Y (i.e., Y is not a subset of X) then Either X is Super Key or Y is
a prime attribute).
STEP 3: Make a set of FD which does not satisfy 3NF, i.e. all those FD which
do not have an attribute on the left side of FD as a super key or attribute on
the right side of FD as a prime attribute.
STEP 4: Convert the table R in 3NF by decomposing R such that each
decomposition based on FD should satisfy the definition of 3NF.
STEP 5: Once the decomposition based on FD is completed, create a
separate table of attributes in the Candidate key.
STEP 6: All the decomposed R obtained from STEP 4 and STEP 5 forms the
required decomposition where each decomposition is in 3NF.
EQUIVALENCE OF FUNCTIONAL DEPENDENCY
Definition: Two or more than two sets of functional dependencies are called
equivalence if the right-hand side of one set of functional dependency can be
determined using the second FD set, similarly the right-hand side of the
second FD set can be determined using the first FD set.
Q 1: Given a relational schema R( X, Y, Z, W, V ) set of
functional dependencies P and Q such that:
P = { X → Y, XY → Z, W → XZ, W → V} and Q = { X → YZ, W → XV } using FD
sets P and Q which of the following options are correct?
a. P is a subset of Q
b. Q is a subset of P
c. P = Q
d. P ≠ Q
→Using definition of equivalence of FD set, let us determine the right-hand
side of the FD set of P using FD set Q.
Given P = { X → Y, XY → Z, W → XZ, W → V} and Q = { X → YZ, W → XV }
Let's find closure of the left side of each FD of P using FD Q.
a. X+ = XYZ (using X → YZ)
b. XY+ = XYZ (using X → YZ)
c. W+ = WXVYZ (using W → XV and X → YZ)
d. W+ = WXVYZ (using W → XV and X → YZ)
Now compare closure of each X, XY, W and W calculated using FD Q with the
right-hand side of FD P. Closure of each X, XY, W and W has all the attributes
which are on the right-hand side of each FD of P. Hence, we can say P is a
subset of Q----------1
→Using definition of equivalence of FD set, let us determine the right-hand
side of the FD set of Q using FD set P.
Given P = { X → Y, XY → Z, W → XZ, W → V} and Q = { X → YZ, W → XV }
Let us find closure of the left side of each FD of Q using FD P.
a. X+ = XYZ (using X → Y and XY → Z)
b. W+ = WXZVY (using W → XZ, W → V, and X → Y)
Now compare closure of each X, W calculated using FD P with the right-hand
side of FD Q. Closure of each X and W has all the attributes which are on the
right-hand side of each FD of Q. Hence, we can say Q is a subset of
P-----------2
From 1 and 2 we can say that P = Q, hence option C is correct.
Q 2: Given a relational schema R( A, B, C, D ) set of
functional dependencies P and Q such that:
P = { A → B, B → C, C → D } and Q = { A → BC, C → D } using FD sets P and Q
which of the following options are correct?
a. a) P is a subset of Q
b. b) Q is a subset of P
c. c) P = Q
d. d) P ≠ Q
→Using definition of equivalence of FD set, let us determine the right-hand
side of the FD set of P using FD set Q.
Given P = { A → B, B → C, C → D } and Q = { A → BC, C → D }
Let us find closure of the left side of each FD of P using FD Q.
a. A+ = ABCD (using A → BC, C → D)
b. B+ = B (no FD of Q has B on its left)
c. C+ = CD (using C → D)
Now compare closure of each A, B and C calculated using FD Q with the
right-hand side of FD P. Closure B is B while in FD set P, B → C (B determines
C), since the closure of B determined using FD Q has no C. Hence, we can
say P is not a subset of Q----------1
→Using definition of equivalence of FD set, let us determine the right-hand
side of the FD set of Q using FD set P.
Given P = { A → B, B → C, C → D } and Q = { A → BC, C → D }
Let us find closure of the left side of each FD of Q using FD P.
a. A+ = ABCD (using A → B, B → C, C → D)
b. C+ = CD (using C → D)
Now compare closure of each A and C calculated using FD P with the right-
hand side of FD Q. Closure of each A and C has all the attributes which are
on the right-hand side of each FD of Q. Hence, we can say Q is a subset of
P-----------2
From 1 and 2 we can say that only Q is a subset of P since from 1
condition violated, hence option B is correct.
Q 3: Given a relational schema R( X, Y, Z ) set of functional
dependencies P and Q such that:
P = { X → Y, Y → Z, Z → X } and Q = { X → YZ, Y → X, Z → X } using FD sets P
and Q which of the following options are correct?
a. P is a subset of Q
b. Q is a subset of P
c. P = Q
d. P ≠ Q
→Using definition of equivalence of FD set, let us determine the right-hand
side of the FD set of P using FD set Q.
Given P = {X → Y, Y → Z, Z → X} and Q = {X → YZ, Y → X, Z → X}
Let us find closure of the left side of each FD of P using FD Q.
a. X+ = XYZ (using X → YZ)
b. Y+ = YZX (using X → YZ, Y → X)
c. Z+ = ZXY (using X → YZ, Y → X, Z → X)
Now compare closure of each X, Y, Z calculated using FD Q with the right-
hand side of FD P. Closure of each X, Y, Z has all the attributes which are on
the right-hand side of each FD of P. Hence, we can say P is a subset of
Q----------1
→Using definition of equivalence of FD set, let us determine the right-hand
side of the FD set of Q using FD set P.
Given P = { X → Y, Y → Z, Z → X } and Q = { X → YZ, Y → X, Z → X }
Let us find closure of the left side of each FD of Q using FD P.
a. X+ = XYZ (using X → Y, Y → Z, Z → X)
b. Y+ = YZX (using Y → Z, Z → X)
c. Z+ = ZXY (using X → Y, Y → Z, Z → X)
Now compare closure of each X, Y and Z calculated using FD P with the right-
hand side of FD Q. Closure of each X, Y and Z has all the attributes which are
on the right-hand side of each FD of Q. Hence, we can say Q is a subset of
P-----------2
From 1 and 2 we can say that P = Q, hence option C is correct.
Conclusion: From the above three questions solved for equivalence of FD,
we noticed the following steps which are as follows:
STEP 1: Suppose two FD sets P and Q are given, write FD of each set P and
Q separately.
STEP 2: Take FD set P first and then find closure of each attribute of the left
side of FD in P using FD set Q.
STEP 3: Now compare the closure of each attribute of P with the right-hand
side of FD of P.
STEP 4: If closure of each attribute is equal to the right-hand side of FD of P,
we say P is a subset of Q
STEP 5: Take FD set Q next and then find closure of each attribute of the
left side of FD in Q using FD set P.
STEP 6: Now compare the closure of each attribute of Q with the right-hand
side of FD of Q.
STEP 7: If closure of each attribute is equal to right-hand side of FD of Q, we
say Q is a subset of P
STEP 8: IF P is a subset of Q and Q is a subset of P, we can say P = Q.