Question

Consider a relation R(A,B,C,D,E)R(A, B, C, D, E) with the following three functional dependencies.

AB→C;BC→D;C→E;AB \to C; \quad BC \to D; \quad C \to E;

The number of superkeys in the relation R is _____________.

Official answer and solution
Official answer
8
From
Official GATE 2022 answer key

Solution

Find the candidate key(s) of relation RR and compute the number of supersets.

Relation R(A,B,C,D,E)R(A, B, C, D, E) has functional dependencies:

AB→C,BC→D,C→EAB \to C, \quad BC \to D, \quad C \to E
  1. Attributes AA and BB do not appear on the right-hand side of any FD. Therefore, AA and BB must be part of every candidate key.
  2. Compute the attribute closure of {A,B}\{A, B\}:
    (AB)+={A,B}∪{C}={A,B,C}(AB)^+ = \{A, B\} \cup \{C\} = \{A, B, C\}
    Using BC→DBC \to D: (AB)+={A,B,C,D}(AB)^+ = \{A, B, C, D\}
    Using C→EC \to E: (AB)+={A,B,C,D,E}(AB)^+ = \{A, B, C, D, E\}

Since (AB)+={A,B,C,D,E}(AB)^+ = \{A, B, C, D, E\} and neither AA nor BB alone can derive the other attributes, ABAB is the unique candidate key of RR.
3. A superkey is any superset of a candidate key. Since ABAB is the only candidate key, any superkey must contain both AA and BB.
4. The remaining 3 attributes {C,D,E}\{C, D, E\} can be included or excluded independently in 23=82^3 = 8 ways.

Thus, there are exactly 8 superkeys.

Final answer

8

Common trap

Overlooking that AA and BB are essential and checking if other attribute combinations form independent candidate keys.

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2022 Computer Science and Information Technology (CS)
Question
31 of 65
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.