CoursifyCoursify

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={AB,  BA}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 BAB \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 ABA \rightarrow B and BAB \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\}ABA \rightarrow B gives BB{A,B}\{A,B\}
B+B^+{B}\{B\}BAB \rightarrow A gives AA{A,B}\{A,B\}
(AC)+(AC)^+{A,C}\{A,C\}ABA \rightarrow B gives BB{A,B,C}\{A,B,C\}
(BC)+(BC)^+{B,C}\{B,C\}BAB \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={AB,  BA}F=\{A \rightarrow B,\; B \rightarrow A\}. These show mutual determination between AA and BB only.

    Footnotes

    1. Normalization – Relational Databases - Notes that if BAB \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 ABA \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 BAB \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 ABA \rightarrow B and BAB \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:

  • AAA \rightarrow A by reflexivity
  • BBB \rightarrow B by reflexivity
  • ABA \rightarrow B given
  • BAB \rightarrow A given

But there is still no derivation of ACA \rightarrow C or BCB \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 BAB \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 ABA \rightarrow B and BAB \rightarrow A."

Footnotes

  1. Normalization – Relational Databases - Notes that if BAB \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={AB,  BA}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={AB,  BA}F=\{A \rightarrow B,\; B \rightarrow A\}, what is A+A^+?

Explore Related Topics

1

Algorithm Property for Clear, Unambiguous Steps: Definiteness

The course clarifies that definiteness is the algorithm property requiring every step to be precise and have exactly one interpretation, distinguishing it from finiteness, effectiveness, and generality.

  • Definiteness: each instruction is specified so precisely that only one meaning is possible.
  • Finiteness concerns termination, effectiveness concerns executability, and generality concerns applicability to all valid inputs.
  • Example: “repeat 3 times” is definite, while “repeat several times” is not.
  • Exam tip: associate words like “clear,” “precise,” or “unambiguous” with definiteness.
  • Algorithm quality can be expressed as Algorithm quality={definiteness, finiteness, effectiveness, input/output clarity} \text{Algorithm quality} = \{\text{definiteness},\ \text{finiteness},\ \text{effectiveness},\ \text{input/output clarity}\}.
2

Hierarchy and Power of Bottom-Up Parsers: SLR, LALR, and CLR

Bottom‑up LR parsers form a strict hierarchy of power: LR(0) < SLR < LALR < CLR, with each level able to handle all grammars of the lower levels.

  • SLR uses LR(0) items and resolves conflicts with FOLLOW sets; it is the weakest but simplest LR parser.
  • LALR builds full LR(1) items then merges states that share the same core, keeping the same number of states as SLR while adding look‑ahead precision.
  • CLR (canonical LR) retains all LR(1) states and look‑aheads, giving it the highest grammar coverage at the cost of many more states.
  • Merging CLR states to form LALR can introduce reduce‑reduce conflicts (never shift‑reduce), making LALR strictly less powerful than CLR.
  • In practice, tools like Yacc/Bison prefer LALR because it balances power with manageable memory usage.
3

Evaluating ER-to-Relational Mapping Statements

The content explains how standard ER‑to‑relational mapping rules validate three statements about weak entities, partial keys, and many‑to‑many relationships, and shows that the fourth claim—every generated relation has only one candidate key—is false.

  • Weak entities depend on a strong owner and are identified by the owner’s primary key plus a partial (discriminator) key.
  • A partial key is allowed for weak entities, forming a composite primary key with the owner key.
  • Binary M:NM:N relationships are mapped to a separate associative relation containing the participating primary keys.
  • A generated relation may have multiple candidate keys; one is chosen as the primary key, so statement (iv) is false.
Chat with Kiro