Functional Dependencies and Candidate Keys in R(A,B,C)R(A,B,C)

Functional Dependencies and Candidate Keys in R(A,B,C)R(A,B,C)

Verified Sources
Jun 1, 2026

In the relation schema R(A,B,C)R(A,B,C) with functional dependency set F={A→B,  B→A}F=\{A \rightarrow B,\; B \rightarrow A\}, the correct statement is:

(iv) Neither AA nor BB is a key.2

A candidate key must determine every attribute in the relation, including CC.2 Here, AA determines BB, and BB determines AA, so AA and BB are mutually determining attributes. However, there is no functional dependency involving CC on the right-hand side, so neither A+A^+ nor B+B^+ can include CC under the given FD set.2

Thus:

  • A+={A,B}A^+ = \{A,B\}
  • B+={A,B}B^+ = \{A,B\}

Since neither closure equals {A,B,C}\{A,B,C\}, neither AA nor BB is a superkey, and therefore neither can be a candidate key.2

A useful rule of thumb is that if an attribute such as CC is not derivable from other attributes, then any key must include it. So the actual candidate keys are:

  • {A,C}\{A,C\}
  • {B,C}\{B,C\}

3

Footnotes

  1. Determining candidate keys with functional dependencies simple - Explains key-finding heuristics, including that attributes not derivable from others must appear in every key. ↩ ↩2 ↩3 ↩4

  2. Closure of a Set of Functional Dependencies - Describes attribute closure computation and use of Armstrong-derived inference rules. ↩ ↩2 ↩3

  3. Candidate key - Wikipedia - Defines candidate keys as minimal sets whose closure contains all attributes of the relation. ↩ ↩2 ↩3

  4. Candidate Keys (LSU PDF) - Defines superkeys and candidate keys using attribute closure over the full relation schema. ↩ ↩2

  5. Normalization – Relational Databases - Notes that if B→AB \rightarrow A also holds, then AA and BB can both be candidate keys only when they determine the remaining attributes as well. ↩

Attribute Closure and Candidate Keys in DBMS

Correct Option

For R(A,B,C)R(A,B,C) with A→BA \rightarrow B and B→AB \rightarrow A, the true statement is (iv) Neither AA nor BB is a key because neither determines CC.2

Footnotes

  1. Determining candidate keys with functional dependencies simple - Explains key-finding heuristics, including that attributes not derivable from others must appear in every key. ↩

  2. Closure of a Set of Functional Dependencies - Describes attribute closure computation and use of Armstrong-derived inference rules. ↩

To understand why, we use attribute closure.2 The closure of a set XX, written X+X^+, contains every attribute that can be inferred from XX using the given functional dependencies.

For this problem:

Attribute setStartApply FDsClosure
A+A^+{A}\{A\}A→BA \rightarrow B gives BB{A,B}\{A,B\}
B+B^+{B}\{B\}B→AB \rightarrow A gives AA{A,B}\{A,B\}
(AC)+(AC)^+{A,C}\{A,C\}A→BA \rightarrow B gives BB{A,B,C}\{A,B,C\}
(BC)+(BC)^+{B,C}\{B,C\}B→AB \rightarrow A gives AA{A,B,C}\{A,B,C\}

Because a key must determine all attributes of RR, both AA and BB fail, but ACAC and BCBC succeed.2

This also illustrates minimality: although ACAC determines all attributes, neither AA nor CC alone does, so ACAC is minimal and hence a candidate key.2

Footnotes

  1. Candidate key - Wikipedia - Defines candidate keys as minimal sets whose closure contains all attributes of the relation. ↩ ↩2 ↩3

  2. Candidate Keys (LSU PDF) - Defines superkeys and candidate keys using attribute closure over the full relation schema. ↩ ↩2 ↩3

  3. Determining candidate keys with functional dependencies simple - Explains key-finding heuristics, including that attributes not derivable from others must appear in every key. ↩

How to Solve This Question Systematically

  1. 1
    Step 1

    List the full schema as R(A,B,C)R(A,B,C). A key must determine all three attributes: AA, BB, and CC.2

    Footnotes

    1. Candidate key - Wikipedia - Defines candidate keys as minimal sets whose closure contains all attributes of the relation. ↩

    2. Candidate Keys (LSU PDF) - Defines superkeys and candidate keys using attribute closure over the full relation schema. ↩

  2. 2
    Step 2

    Use the FD set F={A→B,  B→A}F=\{A \rightarrow B,\; B \rightarrow A\}. These show mutual determination between AA and BB only.

    Footnotes

    1. Normalization – Relational Databases - Notes that if B→AB \rightarrow A also holds, then AA and BB can both be candidate keys only when they determine the remaining attributes as well. ↩

  3. 3
    Step 3

    Start with {A}\{A\}. By reflexivity, AA determines itself. Using A→BA \rightarrow B, add BB. No dependency adds CC, so A+={A,B}A^+=\{A,B\}.2

    Footnotes

    1. Closure of a Set of Functional Dependencies - Describes attribute closure computation and use of Armstrong-derived inference rules. ↩

    2. Candidate Keys (LSU PDF) - Defines superkeys and candidate keys using attribute closure over the full relation schema. ↩

  4. 4
    Step 4

    Start with {B}\{B\}. By reflexivity, BB determines itself. Using B→AB \rightarrow A, add AA. No dependency adds CC, so B+={A,B}B^+=\{A,B\}.2

    Footnotes

    1. Closure of a Set of Functional Dependencies - Describes attribute closure computation and use of Armstrong-derived inference rules. ↩

    2. Candidate Keys (LSU PDF) - Defines superkeys and candidate keys using attribute closure over the full relation schema. ↩

  5. 5
    Step 5

    Since neither A+A^+ nor B+B^+ equals {A,B,C}\{A,B,C\}, neither AA nor BB is a superkey.

    Footnotes

    1. Candidate key - Wikipedia - Defines candidate keys as minimal sets whose closure contains all attributes of the relation. ↩

  6. 6
    Step 6

    Because neither single attribute determines all attributes, the correct answer is (iv) Neither AA nor BB is key.2

    Footnotes

    1. Determining candidate keys with functional dependencies simple - Explains key-finding heuristics, including that attributes not derivable from others must appear in every key. ↩

    2. Closure of a Set of Functional Dependencies - Describes attribute closure computation and use of Armstrong-derived inference rules. ↩

Common Exam Trap

Students often see A→BA \rightarrow B and B→AB \rightarrow A and conclude both are keys. That is incorrect unless they also determine CC. A key must cover the entire relation schema, not just part of it.2

Footnotes

  1. Candidate key - Wikipedia - Defines candidate keys as minimal sets whose closure contains all attributes of the relation. ↩

  2. Candidate Keys (LSU PDF) - Defines superkeys and candidate keys using attribute closure over the full relation schema. ↩

A deeper conceptual point is that AA and BB are equivalent with respect to each other, but not with respect to the whole relation. In other words, they can replace each other when deriving AA or BB, yet neither can generate CC.2

Using Armstrong's axioms such as reflexivity and transitivity, we can derive:

  • A→AA \rightarrow A by reflexivity
  • B→BB \rightarrow B by reflexivity
  • A→BA \rightarrow B given
  • B→AB \rightarrow A given

But there is still no derivation of A→CA \rightarrow C or B→CB \rightarrow C.2 Therefore, CC remains outside both single-attribute closures.

This is why many database design heuristics note that an attribute not derivable from others often must appear in every key. Here, CC must be included in any candidate key, yielding ACAC and BCBC as the minimal keys.2

Footnotes

  1. Normalization – Relational Databases - Notes that if B→AB \rightarrow A also holds, then AA and BB can both be candidate keys only when they determine the remaining attributes as well. ↩ ↩2 ↩3

  2. Closure of a Set of Functional Dependencies - Describes attribute closure computation and use of Armstrong-derived inference rules. ↩ ↩2

  3. Determining candidate keys with functional dependencies simple - Explains key-finding heuristics, including that attributes not derivable from others must appear in every key. ↩ ↩2

  4. Candidate key - Wikipedia - Defines candidate keys as minimal sets whose closure contains all attributes of the relation. ↩

To test whether AA is a key, compute A+A^+. Since A+={A,B}A^+=\{A,B\} and does not contain CC, AA is not a key. Similarly, B+={A,B}B^+=\{A,B\}, so BB is not a key.2

Footnotes

  1. Candidate key - Wikipedia - Defines candidate keys as minimal sets whose closure contains all attributes of the relation. ↩

  2. Candidate Keys (LSU PDF) - Defines superkeys and candidate keys using attribute closure over the full relation schema. ↩

Closure Coverage of Attribute Sets

How many attributes each set determines in R(A,B,C)R(A,B,C)

Clarifications and Edge Cases

Reasoning Roadmap for FD-Based Key Questions

List Attributes

Step 1

Identify the complete schema, here R(A,B,C)R(A,B,C)."

Footnotes

  1. Candidate key - Wikipedia - Defines candidate keys as minimal sets whose closure contains all attributes of the relation. ↩

Read FDs Carefully

Step 2

Note that the only dependencies are A→BA \rightarrow B and B→AB \rightarrow A."

Footnotes

  1. Normalization – Relational Databases - Notes that if B→AB \rightarrow A also holds, then AA and BB can both be candidate keys only when they determine the remaining attributes as well. ↩

Compute Closures

Step 3

Find A+A^+ and B+B^+ to test whether either determines the full schema."

Footnotes

  1. Candidate Keys (LSU PDF) - Defines superkeys and candidate keys using attribute closure over the full relation schema. ↩

Test for Full Coverage

Step 4

Observe that both closures miss CC, so neither is a key.2"

Footnotes

  1. Determining candidate keys with functional dependencies simple - Explains key-finding heuristics, including that attributes not derivable from others must appear in every key. ↩

  2. Closure of a Set of Functional Dependencies - Describes attribute closure computation and use of Armstrong-derived inference rules. ↩

Find Minimal Keys

Step 5

Add CC and test ACAC and BCBC; both become candidate keys.2"

Footnotes

  1. Determining candidate keys with functional dependencies simple - Explains key-finding heuristics, including that attributes not derivable from others must appear in every key. ↩

  2. Candidate key - Wikipedia - Defines candidate keys as minimal sets whose closure contains all attributes of the relation. ↩

Fast Key Detection Heuristic

If an attribute never appears as derivable from other attributes, suspect that it must be included in every candidate key. In this problem, CC must appear in every key.

Footnotes

  1. Determining candidate keys with functional dependencies simple - Explains key-finding heuristics, including that attributes not derivable from others must appear in every key. ↩

Final Answer

For the relation R(A,B,C)R(A,B,C) with F={A→B,  B→A}F=\{A \rightarrow B,\; B \rightarrow A\}:

  • A+={A,B}A^+=\{A,B\}
  • B+={A,B}B^+=\{A,B\}

Neither closure contains CC, so neither AA nor BB is a key.3

Therefore, the correct option is:

(iv) Neither A nor B is key\boxed{\text{(iv) Neither A nor B is key}}

The actual candidate keys are:

{A,C}and{B,C}\{A,C\} \quad \text{and} \quad \{B,C\}

Footnotes

  1. Determining candidate keys with functional dependencies simple - Explains key-finding heuristics, including that attributes not derivable from others must appear in every key. ↩

  2. Closure of a Set of Functional Dependencies - Describes attribute closure computation and use of Armstrong-derived inference rules. ↩

  3. Candidate key - Wikipedia - Defines candidate keys as minimal sets whose closure contains all attributes of the relation. ↩

Knowledge Check

Question 1 of 4
Q1Single choice

For R(A,B,C)R(A,B,C) with F={A→B,  B→A}F=\{A \rightarrow B,\; B \rightarrow A\}, what is A+A^+?