GATE Computer Science · Databases, Theory of Computation, and Compiler Design · hard

Consider a relation schema R(A, B, C, D, E) with the functional dependency set F = {AB -> C, C -> D, D -> B, D -> E}. Which two attribute sets are candidate keys of relation R? (Select two.)

Published · Last updated · checked before publication — how we verify questions

Options

  • ACandidate key AB because (AB)+ = {A, B, C, D, E} and A+ or B+ alone is smallerCorrect answer
  • BCandidate key BCD because B, C, and D appear in the functional dependencies
  • CCandidate key AC because C -> D -> B and D -> E give (AC)+ = {A, B, C, D, E}Correct answer
  • DCandidate key DE because D determines both B and E directly in dependency set F

Answers: A. Candidate key AB because (AB)+ = {A, B, C, D, E} and A+ or B+ alone is smaller; C. Candidate key AC because C -> D -> B and D -> E give (AC)+ = {A, B, C, D, E}

Attributes A never appear on the right-hand side of any FD, so A must be in every candidate key. A+ = {A}. Test AB: (AB)+ = {A, B, C, D, E} = R, so AB is a candidate key. Since C -> D -> B and D -> B, test AC: (AC)+ = {A, C, D, B, E} = R, and test AD: (AD)+ = {A, D, B, E, C} = R. Thus AB, AC, and AD are minimal superkeys (candidate keys).

Why the other options are wrong

  • B. Candidate key BCD because B, C, and D appear in the functional dependencies — Attribute A never appears on the right-hand side of any FD, so (BCD)+ = {B, C, D, E}, missing A.
  • D. Candidate key DE because D determines both B and E directly in dependency set F — (DE)+ = {D, B, E} which misses both A and C, so DE is not a superkey.

All Databases, Theory of Computation, and Compiler Design questions and the topic overview →

GATE is a mark of the Indian Institute of Science and the Indian Institutes of Technology. PrepIQ Hub is not affiliated with, endorsed by, or sponsored by the GATE Committee.