GATE / CS ARCHIVE

SUBJECT COLLECTION

Database Management Systems · Functional Dependencies & Keys

23 questions, newest first

GATE CSE has asked 23 questions on Functional Dependencies & Keys (Database Management Systems) from 1994 to 2026, in 21 of the 46 papers; the most recent is in GATE CSE 2026 Set 2. In the last five years it carried 1.2 marks per 100-mark paper on average, against 0.7 since 2003. Since 2014 the questions have been 6 MCQ, 5 NAT and 3 MSQ. 4 groups of questions here are solved the same way; “One per method” keeps the newest of each.

Browse topics
1 mark · MSQ
Report issue

Functional dependencies and counterexamples

Functional Dependencies & Keys

Question 30, GATE 2026: For attributes P,Q,R,S, assess: A PQ→R and P→R imply Q→R; B PQ→R implies P→R or Q→R; C P→R and Q→S imply PQ→RS; D P→R implies PQ→R.
Tap to enlarge
Select all that apply
Answer & solution

Official answer: C, D

Step through it (4 parts)

Givens and goal

For attributes P,Q,R,S, assess: A PQ→R and P→R imply Q→R; B PQ→R implies P→R or Q→R; C P→R and Q→S imply PQ→RS; D P→R implies PQ→R.

Approach

Prove valid implications with agreement of tuples or Armstrong’s axioms, and refute invalid ones with small relations.

Step-by-step solution

1. To prove D, take two tuples agreeing on both P and Q. They agree on P, so P→R forces agreement on R. Adding an attribute to the determinant cannot invalidate a dependency. Thus D is true.
2. To prove C, two tuples agreeing on PQ agree on P and therefore R; they also agree on Q and therefore S. Hence they agree on RS, establishing PQ→RS. This is augmentation followed by union.
3. A is false. Consider the rows (P,Q,R,S)=(0,0,0,0) and (1,0,1,0). P uniquely determines R, and PQ also determines R. However the same Q=0 occurs with both R=0 and R=1, so Q→R fails. There is no “cancellation” rule for determinant attributes.
4. B is false. Use four rows with S fixed at 0 and R=P XOR Q:

    P Q R S
    0 0 0 0
    0 1 1 0
    1 0 1 0
    1 1 0 0

Every PQ pair has one R, so PQ→R holds. Holding only P fixed allows two R values, and holding only Q fixed does likewise. Neither individual dependency holds.
5. Therefore only C and D are always true. One relation satisfying the premises and violating the conclusion is sufficient to disprove each proposed universal inference.

Original paper, page 22 · Answer key

2 marks · NAT
Report issue

Counting superkeys by inclusion-exclusion

Functional Dependencies & Keys

Question 65, GATE 2026: R has four attributes A,B,C,D. Its only candidate keys are {A,B} and {A,C}. Count all superkeys.
Tap to enlarge
Answer & solution

Official answer: 6

Givens and goal

R has four attributes A,B,C,D. Its only candidate keys are {A,B} and {A,C}. Count all superkeys.

Approach

Every superset of a candidate key is a superkey; count both superset families and subtract their overlap.

Step-by-step solution

1. A candidate key is a minimal superkey. Adding attributes preserves the ability to identify a tuple, so every set containing AB or AC is a superkey.
2. For AB, the remaining attributes C and D may each be included or omitted independently, giving 2²=4 supersets: AB,ABC,ABD,ABCD.
3. For AC, optional attributes B and D similarly give AC,ABC,ACD,ABCD, again four.
4. A set counted in both families must contain AB∪AC=ABC. Its only optional attribute is D, so the overlap is {ABC,ABCD}, of size 2.
5. Inclusion-exclusion gives 4+4−2=6. The six distinct superkeys are AB,AC,ABC,ABD,ACD,ABCD.
6. There are no others: from any superkey one can repeatedly remove unnecessary attributes until a minimal superkey, hence a candidate key, remains. The premise says the only such minima are AB and AC, so every superkey must contain at least one of them. D need not belong to a candidate key to occur in larger superkeys.

Original paper, page 46 · Answer key

2 marks · MCQ
Report issue

Deriving the union rule for functional dependencies

Functional Dependencies & Keys

Question 42, GATE 2026: Armstrong rules are reflexivity (Y⊆X implies X→Y), augmentation (X→Y implies XZ→YZ), and transitivity. To derive union, X→Y and X→Z imply X→YZ, which listed rule set is necessary and sufficient? A all three; B reflexivity+augmentation; C transitivity; D augmentation+transitivity.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

Givens and goal

Armstrong rules are reflexivity (Y⊆X implies X→Y), augmentation (X→Y implies XZ→YZ), and transitivity. To derive union, X→Y and X→Z imply X→YZ, which listed rule set is necessary and sufficient? A all three; B reflexivity+augmentation; C transitivity; D augmentation+transitivity.

Approach

Construct a proof that does not use reflexivity, then rule out the smaller listed alternatives.

Step-by-step solution

1. Augment the premise X→Y with X. Because attribute-set union is idempotent, XX=X; this gives X→XY.
2. Augment the premise X→Z with Y. This gives XY→ZY, which is XY→YZ because attribute-set union is commutative.
3. Apply transitivity to X→XY and XY→YZ to obtain X→YZ. Thus augmentation and transitivity suffice, with no application of reflexivity.
4. Transitivity alone cannot generally introduce a new combined right-hand-side set. For singleton distinct attributes X={x},Y={y},Z={z}, the two premises x→y and x→z provide no chain yielding x→yz.
5. Reflexivity and augmentation without transitivity also do not generally combine two premises. Starting from x→y, augmentation by z yields xz→yz, not x→yz; starting from x→z and adding y yields xy→yz. Removing the added left-side attribute requires a further inference not available in those two rules.
6. The minimal listed combination for the general derivation is D. This necessity concerns the rule schema for arbitrary attribute sets, not special cases where Y or Z is already contained in another set.

Original paper, page 29 · Answer key

2 marks · MSQ
Report issue

Prove functional dependencies and refute a converse

Functional Dependencies & Keys

Question 44, GATE 2024: Which functional-dependency implications are valid? A XY→ZW implies X→ZW. B XY→ZW implies XY→Z. C XY→Z and W→Y imply XW→Z. D X→Y and Y→Z imply X→Z. Concatenated letters denote attribute sets.
Tap to enlarge
Select all that apply
Answer & solution

Official answer: B, C, D

Step through it (4 parts)

Approach: Treat a functional dependency as a guarantee that equality on its left side forces equality on its right side. Use Armstrong-style inference or a concrete counterexample.
1. A is false: dropping a determinant attribute can lose information. Consider rows (X,Y,Z,W)=(0,0,0,0) and (0,1,1,1). Their XY values differ, so XY→ZW holds, but equal X values have different ZW values, violating X→ZW.
2. B is true by decomposition. If equal XY forces both Z and W to agree, it certainly forces Z alone to agree.
3. C is true. From equal XW, we have equal W, hence equal Y by W→Y. We now have equal XY, which forces equal Z by XY→Z. Equivalently, the closure of XW contains Y and then Z.
4. D is the transitivity rule: agreement on X gives agreement on Y, then on Z.
Answer: B, C and D. Decomposing the right-hand side is valid; arbitrarily decomposing the left-hand side is not.

Original paper, page 28 · Answer key

2 marks · NAT
Report issue

Count disjoint nonempty sides of a functional dependency

Functional Dependencies & Keys

Question 56, GATE 2024: On a schema of four attributes, call X→Y useful when X and Y are both nonempty and X∩Y=∅. How many different such dependencies are possible?
Tap to enlarge
Answer & solution

Official answer: 50

Approach: Assign each attribute to the left side, right side, or neither, then exclude empty sides.

1. Derivation. For each of four attributes choose membership in X, membership in Y, or neither: 3⁴ assignments enforce disjointness. Exclude assignments with X empty (2⁴) and Y empty (2⁴), then restore the all-neither assignment counted twice. The number is 3⁴−2⁴−2⁴+1=81−16−16+1=50. This counts possible syntactic dependencies, not dependencies that necessarily hold on a particular instance.

2. Explanation and checks. An alternative count chooses the size k of X: sum from k=1 to 3 of C(4,k)(24−k−1). For k=1 there are 4×7=28 choices; k=2 gives 6×3=18; k=3 gives 4×1=4, totaling 50. X→Y and Y→X are different dependencies because direction matters. Multiattribute right sides are allowed by the definition; restricting Y to a single attribute would answer a different question.

Original paper, page 37 · Answer key

1 mark · NAT
Report issue

Functional Dependencies & Keys

Question 31, GATE 2022: For R(A,B,C,D,E), dependencies are AB→C, BC→D, C→E. How many superkeys exist?
Tap to enlarge
Answer & solution

Official answer: 8

Step through it (3 steps)

A and B never appear on a dependency’s right side, so every key and superkey must include both. AB determines C, then BC determines D, and C determines E; hence AB is a key. All superkeys are AB with any subset of {C, D, E}, giving 2³=8.

Compute (AB)+: begin {A,B}; AB→C adds C; BC→D adds D; C→E adds E. No set lacking A or B can obtain it from these FDs, proving AB is the unique minimal key. The eight superkeys are AB,ABC,ABD,ABE,ABCD,ABCE,ABDE,ABCDE.

Original paper, page 22 · Answer key

2 marks · MSQ
Report issue

Functional Dependencies & Keys

Question 40, GATE 2021: On U(P,Q,R,S,T), dependencies P→QR and RS→T hold. Which follow? A PS→T; B R→T; C P→R; D PS→Q.
Tap to enlarge
Select all that apply
Answer & solution

Official answer: A; C; D

Step through it (4 parts)

P→QR gives P→R and P→Q by decomposition. With PS, derive R and retain S, then RS→T gives PS→T; also PS→Q follows by augmentation and decomposition. Starting only from R yields closure{R}, so R→T is not implied. Therefore A, C, D.

Attribute closure of PS starts {P,S}, then adds Q,R using P→QR, then T using RS→T, giving all five attributes. Closure of P is {P,Q,R}, and closure of R is only {R}. The latter is a complete test of nonimplication: no listed dependency can fire from R alone, so S cannot be conjured merely because it appears beside R in RS→T.

Original paper, page 78 · Answer key

1 mark · MCQ
Report issue

Functional Dependencies & Keys

Question 16, GATE 2017: R(V,W,X,Y,Z) has dependencies V→W, VW→X, Y→VX, Y→Z. Choose an irreducible equivalent set. A {V→W,V→X,Y→V,Y→Z}; B {V→W,W→X,Y→V,Y→Z}; C {V→W,V→X,Y→V,Y→X,Y→Z}; D {V→W,W→X,Y→V,Y→X,Y→Z}.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Step through it (7 steps)

1. First split Y→VX into Y→V and Y→X, so every right-hand side is a singleton.

2. From V→W, knowing V gives both V and W; VW→X then gives X. Therefore W is extraneous in the left side of VW→X, and we replace it by V→X.

3. Now Y→X is implied by Y→V and V→X and can be removed. None of V→W,V→X,Y→V,Y→Z follows from the other three. This is A; C is equivalent but not irreducible.

Original paper, page 9 · Answer key

1 mark · MCQ
Report issue

Functional Dependencies & Keys

Question 21, GATE 2016: A relational schema has attributes V,W,X,Y,Z and primary key VY. Which choice is NOT a superkey? A: VXYZ. B: VWXZ. C: VWXY. D: VWXYZ. No other functional dependencies are specified; distinguish the intended answer from what the premise alone guarantees.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Our answer: B is not guaranteed; literal insufficiency of dependencies

A, C, D contain the given primary key VY and are therefore superkeys. B=VWXZ omits Y, so it is the only set not guaranteed to be a superkey by that key alone, intended B. However a primary key does not exclude other candidate keys: adding X→Y would make B a superkey too while VY can remain minimal. No complete FD set is supplied, so the literal assertion that B is not a superkey needs the implicit assumption that no other dependency determines Y.

A superkey determines every attribute; any superset of a known key is therefore automatically a superkey. This immediately verifies A,C,D. Under only the supplied key dependency VY→VWX YZ, closure of VWXZ lacks Y, giving intended B. But “primary” means the chosen candidate key, not the only candidate key. If X→Y is additionally valid, VWXZ closes to all attributes. Keeping this caveat prevents a multiple-choice convention from being taught as a false database theorem.

Original paper, page 10 · Answer key

1 mark · MCQ
Report issue

Functional Dependencies & Keys

Question 13, GATE 2015: Relation X(P,Q,R,S,T,U) has functional dependencies F={ {P,R}→{S,T}, {P,S,U}→{Q,R} }. F⁺ is the closure of F. Which listed dependency is trivial? (A) {P,R}→{S,T}; (B) {P,R}→{R,T}; (C) {P,S}→{S}; (D) {P,S,U}→{Q}.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

1. The closure notation does not make a nontrivial dependency trivial. In A the right side introduces S,T; in B it introduces T; in D it introduces Q. Only C has no right-side attribute outside the left side.

2. A functional dependency X→Y is trivial precisely when Y⊆X. Here{P, S}→{S} meets this condition, C, independently of the other dependencies.

Original paper, page 57 · Answer key

1 mark · MCQ
Report issue

Functional Dependencies & Keys

Question 21, GATE 2014: For R(E,F,G,H,I,J,K,L,M,N), the functional dependencies are EF→G, F→IJ, EH→KL, K→M, L→N. Which is a candidate key? A: EF. B: EFH. C: EFHKL. D: E.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Step through it (2 steps)

1. Method and setup. Attributes absent from every dependency’s right side cannot be generated from other attributes. Thus E, F and H must occur in every key. Compute their closure systematically, and distinguish a minimal candidate key from a larger superkey such as EFHKL.

2. Work through the result and its assumptions. E, F, H never occur on a right-hand side, so every key needs all three. Their closure addsG via EF, I, J via F, K, L via EH, then M, N. Thus EFH determines all attributes and is minimal, B.

Original paper, page 12 · Answer key

1 mark · NAT
Report issue

Functional Dependencies & Keys

Question 21, GATE 2014: For relation schema R(E,F,G,H), with E as the key, find the maximum number of superkeys.
Tap to enlarge
Answer & solution

Official answer: 8

Our answer: 8 if E is the sole candidate key

1. Set up the reasoning. A superkey uniquely identifies tuples and may contain redundant attributes. Starting from E, independently include or omit each of the three remaining attributes F, G, and H.

2. Derive the result. Every superset of E is a superkey; choosing any subset of F, G, H gives 2³=8. Reading E as the only candidate key gives exactly this count. If it merely says E is one candidate key, additional keys could increase the count, up to all 15 nonempty attribute subsets when every singleton is a key. Thus the official 8 relies on the sole-key reading of the key.

3. Check the interpretation. The intended count treats E as the sole candidate key: E, EF, EG, EH, EFG, EFH, EGH, EFGH. If the phrase only grants that E is one key, other candidate keys are not ruled out; preserve that ambiguity rather than claiming eight follows unconditionally.

Original paper, page 33 · Answer key

1 mark · NAT
Report issue

Functional Dependencies & Keys

Question 22, GATE 2014: STUDENTS has columns StudentID, StudentName, StudentEmail, StudentAge, CPI and rows (2345,Shankar,shankar@math,X,9.4), (1287,Swati,swati@ee,19,9.5), (7853,Shankar,shankar@cse,19,9.4), (9876,Swati,swati@mech,18,9.3), (8765,Ganesh,ganesh@civil,19,8.7). For (StudentName,StudentAge) to be a key of this instance, what value must X NOT equal?
Tap to enlarge
Answer & solution

Official answer: 19

1. Set up the reasoning. Project each row to the proposed key columns. Distinct names cannot collide, so only rows sharing a name need to be compared.

2. Derive the result. The two Shankar rows would have the same(Name, Age) pair if X=19. Other repeated names already have different ages, and neither name nor age alone is unique. Hence X must not equal 19 for the pair to be a key of this instance.

3. Check the interpretation. The two Swati ages already differ. The Shankar ages would coincide at X=19, creating two different rows with the same key pair. Other columns such as unique emails do not repair a collision in the specified pair.

Original paper, page 34 · Answer key

1 mark · MCQ
Report issue

Functional Dependencies & Keys

Question 22, GATE 2014: A prime attribute of a relation R belongs to which set? A every candidate key; B some candidate key; C a foreign key; D only the primary key.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Step 1: A candidate key is a minimal attribute set that uniquely identifies a tuple. A relation may have several such sets. Step 2: An attribute is prime if it appears in at least one candidate key, including a candidate key not chosen as primary. Therefore B is the definition. Step 3: Requiring membership in every key is too strong. Foreign-key membership is unrelated, and selection of a primary key does not change which attributes are prime.

Original paper, page 57 · Answer key

2 marks · MCQ
Report issue

Candidate keys from the functional dependencies

Functional Dependencies & Keys

Question 54, GATE 2013: R(A, B, C, D, E, F, G, H) has atomic fields and exactly FD closure generated by CH→G, A→BC, B→CFH, E→A, F→EG. Number of candidate keys: A3, B4, C5, D6.
Question 54, GATE 2013: R(A, B, C, D, E, F, G, H) has atomic fields and exactly FD closure generated by CH→G, A→BC, B→CFH, E→A, F→EG. Number of candidate keys: A3, B4, C5, D6.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Step through it (8 steps)

D never occurs on any right-hand side, so every key must contain D. The dependencies A→B, B→F, F→E and E→A form a reachability cycle among A, B, E, F. Starting from any one of those four attributes derives the other three, C and H through B→CFH, and G through F→EG. Consequently A+, B+, E+, F+ each equal {A, B, C, E, F, G, H}, missing only D. Thus AD, BD, DE and DF are candidate keys, and each is minimal. For completeness, any set containing none of A, B, E, F can include only C, D, G, H; its closure can at most add G via CH→G and can never reach that four-attribute cycle. Therefore every key includes at least one of A, B, E, F, and a minimal key includes exactly one together with D. There are precisely four candidate keys, option B.

Compute closures to establish keys and then prove the list exhaustive. D cannot be derived because it never appears on an FD right side, so it must be supplied. Any one of A, B, E, F reaches all the other members of that cycle and then C, H, G. Supplying D alongside one therefore determines all eight attributes. With none of A, B, E, F, the remaining C, D, G, Hcannot generate an entry point into the cycle. Consequently a minimal key consists of Dplus exactly one cycle member: four possibilities.

Original paper, page 12 · Answer key

1 mark · MCQ
Report issue

Candidate key with joint bank accounts

Functional Dependencies & Keys

Question 12, GATE 2011: A student table has one row per registered student: Registration_Num is unique per student; UID is nationally unique per citizen; BankAccount_Num stores a primary account, and students may have multiple or joint accounts; Name is the student's name; Hostel_Room is the room number. Which statement is INCORRECT?

(A) BankAccount_Num is a candidate key
(B) Registration_Num can be a primary key
(C) UID is a candidate key if all students are from the same country
(D) If S is a superkey and S intersect UID is NULL, S union UID is also a superkey
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Joint accounts allow two students to have the same primary BankAccount_Num, so it need not uniquely identify a student and is not guaranteed to be a candidate key. Registration numbers are unique; a national UID is unique under the stated same-country assumption; adding an attribute to a superkey preserves uniqueness. Therefore A is incorrect. NULL in the set expression is understood as empty intersection, not SQL NULL.

A candidate key must uniquely identify rows and be minimal for that purpose. A unique account number uniquely identifies a bank account, but the table stores students: joint holders can legitimately repeat the account number across student rows. Conversely, unique registration numbers identify students directly. In D, the extra UID attribute cannot create a collision between rows already distinguished by S; minimality may be lost, but superkey status is preserved.

Original paper, page 4 · Answer key

2 marks · MCQ
Report issue

Closures under six functional dependencies

Functional Dependencies & Keys

Question 70, GATE 2006: Given dependencies AB→CD, AF→D, DE→F, C→G, F→E, G→A, which claimed attribute closure is false? Both reproductions contain the following options, including F in D.
Options:
(A) (CF)⁺={A,C,D,E,F,G}
(B) (BG)⁺={A,B,C,D,G}
(C) (AF)⁺={A,C,D,E,F,G}
(D) (AB)⁺={A,B,C,D,F,G}
Tap to enlarge
Your answer
Answer & solution

Answer: C, D (no official key was published)

1. Apply AB→CD, AF→D, DE→F, C→G, F→E, G→A until closure stops. (CF)+={A,C,D,E,F,G}: C gives G then A; F gives E; AF gives D.

2. (BG)+={A,B,C,D,G}: G gives A then AB gives C,D; neither E nor F is derivable. (AF)+={A,D,E,F}: AF gives D and F gives E, but nothing yields C or G.

3. (AB)+={A,B,C,D,G}: AB gives C,D, C gives G; no E or F follows. Thus C is false and D is also false because its printed right side includes F.

4. A and B are true. There is no unique single false option in these reproductions.

5. Teaching check: Begin each closure with the attributes on the left, then repeatedly add a dependency’s right side only when its entire left side is present. In particular DE→F cannot fire with D alone. This is why AB cannot acquire E or F and why AF cannot acquire C or G.

Original paper, page 11

2 marks · MCQ
Report issue

Candidate keys with two mandatory attributes

Functional Dependencies & Keys

Question 78, GATE 2005: R(A, B, C, D, E, H), FDs A→B, BC→D, E→C, D→A. Candidate-key sets: A AE, BE; B AE, BE, DE; C AEH, BEH, BCH; D AEH, BEH, DEH. Option C uses the clearer GateForum BEH; GFG appears to print BEE in that position.
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

Step through it (6 steps)

Neither E nor H appears on any dependency right-hand side, so every key contains both. E supplies C. Adding A yields B then D through BC→D; adding B yields D then A; adding D yields A then B. Thus AEH, BEH, DEH each determine all six attributes. EH alone cannot determine A, B, D, and adding only C gives nothing new, so these are precisely the minimal keys, option D.

Attributes absent from all FD right sides cannot be manufactured by closure, so every key includes E, H. With them C becomes available. Add A: obtain B, then D. Add B: combine with C to obtain D, then A. Add D: obtain A then B. Thus all three listed triples are superkeys. Removing their third attribute leaves EH with only E, H, C, proving minimality; adding C instead cannot unlock A, B, D. This also proves there are no omitted minimal keys.

Original paper, page 10

2 marks · MCQ
Report issue

What a relation instance proves about dependencies

Functional Dependencies & Keys

Question 2.25, GATE 2002: An instance of R(A,B,C) lists rows (1,1,1), (1,1,0), (2,3,2), (2,3,2), including the repeated displayed row. What can be concluded?
(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.
Question 2.25, GATE 2002: An instance of R(A,B,C) lists rows (1,1,1), (1,1,0), (2,3,2), (2,3,2), including the repeated displayed row. What can be concluded?
(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.
Tap to enlarge
Your answer
Answer & solution

Answer: C for schema-level inference (no official key was published)

Step 1: Use a counterexample to distinguish failure from confirmation.

Step 2: The two rows(1,1,1) and(1,1,0) agree on B but disagree on C, immediately witnessing failure of B→C. No displayed pair violates A→B, but an additional legal row(1,2,0) would violate it unless a schema constraint forbids that row. Observing the current sample cannot establish that prohibition. This is why schema inference selects C while instance-only testing supports the stronger conjunction B.

Conclusion: The rows with B=1 have different C values 1 and 0, disproving B→C for any schema constraint meant to hold on all legal instances containing this one. The displayed rows do satisfy A→B, but a single positive example cannot establish that dependency for all legal instances. Therefore the guaranteed schema conclusion is C. If the question instead asks only which dependencies hold on this particular instance, B’s conjunction is true too. The duplicate(2,3,2) row does not affect either observation.

Original paper, page 6

2 marks · MCQ
Report issue

Dependencies holding on a displayed instance

Functional Dependencies & Keys

Question 2.24, GATE 2000: Rows(X,Y,Z) are(1,4,2),(1,5,3),(1,6,3),(3,2,2). Which pair holds: XY→Z and Z→Y; YZ→X and Y→Z; YZ→X and X→Z; XZ→Y and Y→X?
Question 2.24, GATE 2000: Rows(X,Y,Z) are(1,4,2),(1,5,3),(1,6,3),(3,2,2). Which pair holds: XY→Z and Z→Y; YZ→X and Y→Z; YZ→X and X→Z; XZ→Y and Y→X?
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

Step 1: Every Y value in the four rows is distinct. Hence Y uniquely identifies the entire row in this instance, so Y→Z and Y→X hold. Adding Z to Y cannot destroy uniqueness, so YZ→X also holds.

Step 2: Z→Y fails because Z=2 occurs with Y=4 and 2. X→Z fails because X=1 occurs with Z=2 and 3. XZ→Y fails because(X,Z)=(1,3) occurs with Y=5 and 6.

Thus only the conjunction in B holds. These are instance-level observations, not an inference that the same FDs constrain every possible future instance.

Original paper, page 6

1 mark · MCQ
Report issue

Candidate key from a dependency chain

Functional Dependencies & Keys

Question 1.24, GATE 1999: R(A,B,C,D,E,F) has C→F,E→A,EC→D,A→B. Choose a key from CD,EC,AE,AC.
Tap to enlarge
Your answer
Answer & solution

Answer: B: EC (no official key was published)

Step through it (2 steps)

Start the closure of EC with E,C. E→A adds A; A→B adds B; C→F adds F; and EC→D adds D. Thus (EC)+ contains every attribute, so EC is a superkey. Neither E nor C occurs on a right-hand side, so neither can be obtained from other attributes; every key must contain both. Therefore EC is also minimal, a candidate key, and B is correct. Each other listed pair is missing E or C.

Original paper, page 3

Descriptive
Report issue

Finding all minimal keys

Functional Dependencies & Keys

Question 26(b), GATE 1995: For R(A,B,C), with AB→C and C→A, determine every minimal key.
Question 26(b), GATE 1995: For R(A,B,C), with AB→C and C→A, determine every minimal key.
Tap to enlarge
Answer & solution

Answer: AB and BC are exactly the candidate keys. (no official key was published)

Step through it (4 steps)

A candidate key must determine all three attributes, and none of its proper subsets may do so. Since B does not occur on the right side of either given functional dependency, starting from attributes that omit B can never derive B. Thus every key must contain B. The closure B+ is just {B}, so B by itself is not enough.

Add A: (AB)+ initially contains A,B and then AB→C adds C, so AB is a superkey. Removing A leaves B+, which lacks A,C; removing B leaves A+={A}. Therefore AB is minimal. Add C instead: (BC)+ contains B,C, then C→A adds A, so BC is a superkey. Removing B leaves C+={C,A}, and removing C leaves B+={B}; neither is all of R. Thus BC is minimal.

These are exhaustive. Any key must contain B and at least one of the other two attributes. Such a set therefore contains AB or BC. The only larger possibility ABC is a superkey but not a minimal key, because either of those proper subsets already determines R. Hence the complete candidate-key set is {AB,BC}, not just the first key suggested by the dependency AB→C. No extra dependencies are assumed.

Original paper, page 8

Descriptive
Report issue

Distinct values in one database instance

Functional Dependencies & Keys

Question 3.7, GATE 1994: One instance of R(A,B,C) has distinct values for A. Can A be concluded to be a candidate key for the schema?
Tap to enlarge
Answer & solution

Answer: No (no official key was published)

A candidate key is a schema-level guarantee: it must uniquely identify rows in every legal instance and be minimal among such attribute sets. Distinct A values in one observed instance show only that A happens to be unique there. For example rows (1,x,u),(2,y,v) are consistent with no uniqueness constraint on A; a later legal row (1,z,w) could repeat it. Therefore one instance does not establish the functional dependency A→BC or candidate-key status.

Original paper, page 4