Linked answer questions

Statement for Linked Answer Questions 54 and 55:
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.

Shared with question 55.

Question

How many candidate keys does the relation R have?

Choose one option
Official answer and solution
Official answer
B
From
Official GATE 2013 answer key

Solution

Find essential attributes that never appear on the right-hand side of any functional dependency and compute attribute closures to find all candidate keys.

The relation R(A,B,C,D,E,F,G,H)R(A, B, C, D, E, F, G, H) has functional dependencies:

F={CH→G,A→BC,B→CFH,E→A,F→EG}F = \{CH \rightarrow G,\quad A \rightarrow BC,\quad B \rightarrow CFH,\quad E \rightarrow A,\quad F \rightarrow EG\}
  1. Identify essential attributes:

    • Attribute DD does not appear on the right-hand side of any dependency (in fact, DD does not appear in FF at all).
    • Therefore, DD must be a component of every candidate key.
  2. Check closures of candidate key combinations:

    • Closure of (AD)(AD):

      (AD)+={A,D}→A→BC{A,B,C,D}→B→CFH{A,B,C,D,F,H}→F→EG{A,B,C,D,E,F,G,H}=R(AD)^+ = \{A, D\} \xrightarrow{A \rightarrow BC} \{A, B, C, D\} \xrightarrow{B \rightarrow CFH} \{A, B, C, D, F, H\} \xrightarrow{F \rightarrow EG} \{A, B, C, D, E, F, G, H\} = R

      Since no proper subset of ADAD determines all attributes, ADAD is a candidate key.

    • Since E→AE \rightarrow A, consider (ED)(ED):

      (ED)+={E,D}→E→A{A,E,D}=(AD)+=R(ED)^+ = \{E, D\} \xrightarrow{E \rightarrow A} \{A, E, D\} = (AD)^+ = R

      Thus, EDED is a candidate key.

    • Since F→EGF \rightarrow EG, consider (FD)(FD):

      (FD)+={F,D}→F→EG{D,E,F,G}→E→A(AD)+=R(FD)^+ = \{F, D\} \xrightarrow{F \rightarrow EG} \{D, E, F, G\} \xrightarrow{E \rightarrow A} (AD)^+ = R

      Thus, FDFD is a candidate key.

    • Since B→CFHB \rightarrow CFH, consider (BD)(BD):

      (BD)+={B,D}→B→CFH{B,C,D,F,H}→F→EG{B,C,D,E,F,G,H}→E→AR(BD)^+ = \{B, D\} \xrightarrow{B \rightarrow CFH} \{B, C, D, F, H\} \xrightarrow{F \rightarrow EG} \{B, C, D, E, F, G, H\} \xrightarrow{E \rightarrow A} R

      Thus, BDBD is a candidate key.

    • Attributes C,G,HC, G, H only have CH→GCH \rightarrow G. Even with DD, (CHD)+={C,D,G,H}≠R(CHD)^+ = \{C, D, G, H\} \ne R, so no other combination can form a candidate key.

Therefore, the relation RR has exactly 4 candidate keys: {AD,BD,ED,FD}\{AD, BD, ED, FD\}. This matches option (B).

Final answer

B

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

Source

Paper
GATE 2013 Computer Science and Information Technology (CS)
Question
54 of 65, printed as CS Q.54
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.