IAE Academy

GATE 2022 CS Q.14: solution and answer

GATE 2022 · CSQ.14 · 1 mark · MCQ

In a relational data model, which one of the following statements is TRUE?

  1. (A)

    A relation with only two attributes is always in BCNF.

  2. (B)

    If all attributes of a relation are prime attributes, then the relation is in BCNF.

  3. (C)

    Every relation has at least one non-prime attribute.

  4. (D)

    BCNF decompositions preserve functional dependencies.

See the question in the paper

Answer and solution

ANSWER

Option A is the true statement: every relation with only two attributes is in BCNF.

Official answer: ASource: Official answer key, GATE 2022 CS (IIT Kharagpur)

  1. A relation is in BCNF when, for every non-trivial functional dependency that holds, is a superkey.

  2. Option A: let the relation be . A non-trivial dependency has exactly one attribute on its left side, so the possible sets of non-trivial dependencies are: none; only; only; or both.

  3. If holds, then , so is a superkey. The same argument works for . With no non-trivial dependency, BCNF holds vacuously. So every two-attribute relation is in BCNF, and A is TRUE.

  4. Option B: take with and . Then and , while , and alone are not keys, so the candidate keys are and . Every attribute is prime. But in the left side has , which is not a superkey, so the relation violates BCNF. B is FALSE. (All attributes prime guarantees 3NF only.)

  5. Option C: take with and . Both and are candidate keys, so every attribute is prime and the relation has no non-prime attribute. C is FALSE.

  6. Option D: take with and . The dependency violates BCNF because is not a superkey. Decomposing on it gives and . The dependencies that hold on these parts are only (and trivial ones), and cannot be derived from them, so it is lost. BCNF decomposition is always lossless but need not preserve dependencies. D is FALSE.

  7. Hence the only true statement is A.

KEY IDEA

With two attributes, any non-trivial dependency has a single attribute on its left, and that attribute determines the other one, so it is a superkey. BCNF therefore always holds.

WATCH OUT FOR

Believing that "all attributes prime" implies BCNF. It only implies 3NF. Another slip is assuming BCNF decomposition preserves dependencies, which holds for 3NF synthesis but not for BCNF.

From the GATE 2022 CS paper. Every question of this paper · Download the full paper · All 19 Normal forms questions, with notes

More Normal forms questions