GATE Questions-DBMS-Functional Dependency
GATE Questions-DBMS-Functional Dependency
Functional Dependency
Labels: GATE, GATE questions on DBMS
Previous GATE questions with solutions on DBMS (Functional Dependency) -
CS/IT
GATE-1999
1. Let R= (A, B, C, D, E, F) be a relation scheme with the following dependencies: C->F, E->A, EC->D, A-
>B. Which of the following is a key for R?
(a) CD (b) EC (c) AE (d) AC
GATE-2000
2. Given the following relation instance.
-------
X Y Z
-------
1 4 2
1 5 3
1 6 3
3 2 2
-------
Which of the following functional dependencies are satisfied by the instance?
(a) XY -> Z and Z -> Y
(b) YZ -> X and Y -> Z
(c) YZ -> X and X -> Z
(d) XZ -> Y and Y -> X
In option (a), its given Z->Y, it means that the value of Z uniquely determines the value of Y. But here the
value 2 of Z, gives two different values of Y i.e. 4 and 2. Therefore this FD is not satisfied by the instance.
In option (c), its given X->Z, it means that the value of X uniquely determines the value of Z. But here the
value 1 of X, gives two different values of Z i.e. 2 and 3. Therefore this FD is not satisfied by the instance.
n option (d), its given Y->X, here the value of Y uniquely determines the value of X. Therefore this FD is
satisfied by the instance. Now take FD XZ->Y, here (1,3) cannot uniquely determine the value of Y. (1,3)
gives two values for Y i.e. 5 and 6. Therefore this FD (XZ->Y) is not satisfied by the instance.
GATE-2002
3. From the following instance of a relational schema R(A, B, C), we can conclude that:
----------
A B C
----------
1 1 1
1 1 0
2 3 2
2 3 2
----------
(a) A functionally determines B and B functionally determines C
(b) A functionally determines B and B does not functionally determine C
(c) B does not functionally determine C
(d) A does not functionally determine B and B does not functionally determine C
GATE-2005(IT)
5. In a schema with attributes A, B, C, D and E, following set of functional dependencies are given:
A->B
A->C
CD->E
B->D
E->A
Which of the following functional dependencies is NOT implied by the above set?
(a) CD->AC (b) BD->CD (c) BC->CD (d) AC->BC
GATE-2006
6. The following functional dependencies are given:
AB->CD, AF->D, DE->F, C->G , F->E, G->A
Which one of the following options is false?
(a)CF+ = {ACDEFG} (b)BG+ = {ABCDG}
(c)AF+ = {ACDEFG} (d)AB+ = {ABCDFG}
Ans: option(c)
Explanation:
AF+ = {AFDE}
As explained in question 1, find the closure set of each options.
Option (d) is also false. AB+ = {ABCDG}.
GATE-2013
Linked question ( 7 & 8 )
Relation R has eight attributes ABCDEFGH. Fields of R contain only atomic values.
F={CH->G, A->BC, B->CFH, E->A, F->EG} is a set of functional dependencies (FDs) so that F + is
exactly the set of FDs that hold for R.
Explanation:
In a relational database, a key helps to uniquely identify each record within a table . A key is a combination of
one or more fields/attributes in a table. If a relational schema has multiple keys,each key is a candidate key.
One of the candidate keys is chosen as the primary key.
To find the candidate keys, we need to find the closure of each attribute. (If x ia an attribute(field), set of
attributes determined by x under a set F of functional dependencies is the closure of x under F, denoted x+ ).
Thus,
A+:ABCFHGE
B+: BCFHEGA
C+:C
D+:D
E+: EABCFHG
F+:FEGABCH
G+:G
H+ : H
A+,B+,E+,F+ contains all attributes except D. Thus there are 4 candidate keys DA,DB,DE and DF.
8. The relation R is
(a) in 1NF, but not in 2NF.
(b) in 2NF, but not in 3NF.
(c) in 3NF, but not in BCNF.
(d) in BCNF.
Consider F->G; G is a non-prime attribute and F is a proper subset of a candidate key (refer the above
question). This is a case of partial dependency. Hence 2NF condition is violated. similarly A->C and B->CFH
also violates 2NF condition, hence R is not in 2NF.
GATE - 2015
9. Consider the relation X(P, Q, R, S, T, U) with the following set of functional dependencies
F={
{P, R} → {S, T}
{P, S, U} → {Q, R}
}
Which of the following is the trivial functional dependency in F+ is closure of F?
(a) {P, R} → {S, T}
(b) {P, R} → {R, T}
(c) {P, S} → {S}
(d) {P, S, U} → {Q}
GATE - 2014
10. Consider the relation scheme R=(E,F,G,H,I,J,K,L,M,N) and the set of functional dependencies
{{E,F}→{G},{F}→{I,J},{E,H}→{K,L},{K}→{M},{L}→{N}}
on R. What is the key for R?
(a) {E,F}
(b) {E,F,H}
(c) {E,F,H,K,L}
(d) {E}