Question

The maximum number of superkeys for the relation schema R(E,F,G,H)R(E, F, G, H) with EE as the key is _____.

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

Solution

Use the definition of superkey as any superset of a candidate key in the relation schema.

  1. Definition of Superkey:
    A superkey for relation schema RR is any set of attributes containing a candidate key as a subset.

  2. Schema Attributes:
    The relation schema is R(E,F,G,H)R(E, F, G, H) with 4 attributes, and EE is given as the key.

  3. Counting Superkeys Containing EE:
    Any superkey must include attribute EE. The remaining 3 attributes {F,G,H}\{F, G, H\} may either be included or excluded.

    Number of subsets of {F,G,H}=23=8.\text{Number of subsets of } \{F, G, H\} = 2^3 = 8.
  4. Listing All 8 Superkeys:

    • Single-attribute: {E}\{E\}
    • Two-attribute: {E,F},{E,G},{E,H}\{E, F\}, \{E, G\}, \{E, H\}
    • Three-attribute: {E,F,G},{E,F,H},{E,G,H}\{E, F, G\}, \{E, F, H\}, \{E, G, H\}
    • Four-attribute: {E,F,G,H}\{E, F, G, H\}

Total number of superkeys = 88.

Final answer

8

Common trap

Counting all possible subsets of all 4 attributes (24=162^4 = 16) without requiring key attribute E to be present.

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

Source

Paper
GATE 2014 Computer Science and Information Technology (CS) Session 2
Question
31 of 65, printed as CS Q.21
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.