Skip to content
Official PYQ · 2005

GATE CS 2005 Q78 — Integrity Constraints

Explain with AI

Consider a relation scheme R=(A,B,C,D,E,H)R = (A, B, C, D, E, H) on which the following functional dependencies hold: {A→BA \rightarrow B, BC→DBC \rightarrow D, E→CE \rightarrow C, D→AD \rightarrow A}. What are the candidate keys R?

Choose one option
View worked solution

Answer: D

To find the candidate keys of the relation R(A,B,C,D,E,H)R(A, B, C, D, E, H), we first identify the attributes that must be present in every candidate key.

Step 1: Identify Essential Attributes

An attribute that does not appear on the right-hand side (RHS) of any functional dependency must be part of every candidate key because it cannot be determined by any other attribute.

  • The given functional dependencies are:
    • A→BA \rightarrow B
    • BC→DBC \rightarrow D
    • E→CE \rightarrow C
    • D→AD \rightarrow A
  • Attributes on the RHS: B,D,C,AB, D, C, A
  • Attributes not on the RHS: EE and HH

Thus, every candidate key must contain both EE and HH. This immediately eliminates options A and B.

Step 2: Test Closures of Combinations with EE and HH

Let's find the attribute closures for combinations of EE and HH with other attributes:

  1. For AEHAEH: (AEH)+={A,E,H}={A,B,E,H}(using A→B)={A,B,C,E,H}(using E→C)={A,B,C,D,E,H}(using BC→D)=R\begin{aligned} (AEH)^+ &= \{A, E, H\} \\ &= \{A, B, E, H\} \quad (\text{using } A \rightarrow B) \\ &= \{A, B, C, E, H\} \quad (\text{using } E \rightarrow C) \\ &= \{A, B, C, D, E, H\} \quad (\text{using } BC \rightarrow D) \\ &= R \end{aligned} Since (AEH)+(AEH)^+ contains all attributes of RR and no proper subset of AEHAEH can determine RR (as EE and HH are essential), AEHAEH is a candidate key.

  2. For BEHBEH: (BEH)+={B,E,H}={B,C,E,H}(using E→C)={B,C,D,E,H}(using BC→D)={A,B,C,D,E,H}(using D→A)=R\begin{aligned} (BEH)^+ &= \{B, E, H\} \\ &= \{B, C, E, H\} \quad (\text{using } E \rightarrow C) \\ &= \{B, C, D, E, H\} \quad (\text{using } BC \rightarrow D) \\ &= \{A, B, C, D, E, H\} \quad (\text{using } D \rightarrow A) \\ &= R \end{aligned} Thus, BEHBEH is a candidate key.

  3. For DEHDEH: (DEH)+={D,E,H}={A,D,E,H}(using D→A)={A,B,D,E,H}(using A→B)={A,B,C,D,E,H}(using E→C)=R\begin{aligned} (DEH)^+ &= \{D, E, H\} \\ &= \{A, D, E, H\} \quad (\text{using } D \rightarrow A) \\ &= \{A, B, D, E, H\} \quad (\text{using } A \rightarrow B) \\ &= \{A, B, C, D, E, H\} \quad (\text{using } E \rightarrow C) \\ &= R \end{aligned} Thus, DEHDEH is a candidate key.

Therefore, the candidate keys of RR are AEHAEH, BEHBEH, and DEHDEH.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Integrity Constraints questions