CS FundamentalsVery hardProduct company interview · GATE level

A relation R(City, Street, Zip) has FDs City, Street → Zip and Zip → City (candidate keys: {City, Street} and {Street, Zip}). Why is this the classic example where a lossless, dependency-preserving decomposition into BCNF is IMPOSSIBLE?

  1. A. Because it is always possible for every relation, including this one
  2. B. Because decomposing to remove the BCNF violation (Zip → City, since Zip alone is not a superkey) into R1(Zip, City) and R2(Zip, Street) loses the ability to directly check City, Street → Zip without rejoining the pieces, yet R1/R2 ARE each individually in BCNF and the decomposition is lossless — it is dependency preservation specifically that cannot be achieved alongside BCNF here
  3. C. Because this relation has no candidate keys at all
  4. D. Because Zip → City is a trivial dependency and doesn't need to be preserved

Correct answer: B. Because decomposing to remove the BCNF violation (Zip → City, since Zip alone is not a superkey) into R1(Zip, City) and R2(Zip, Street) loses the ability to directly check City, Street → Zip without rejoining the pieces, yet R1/R2 ARE each individually in BCNF and the decomposition is lossless — it is dependency preservation specifically that cannot be achieved alongside BCNF here

This is the textbook example showing BCNF cannot always be achieved while preserving all dependencies: splitting off Zip → City (since Zip isn't a superkey, violating BCNF) into R1(Zip, City) and R2(Zip, Street) gives a lossless, fully-BCNF-compliant pair, but City, Street → Zip can no longer be verified without joining R1 and R2 back together — demonstrating that BCNF and dependency-preservation can be mutually incompatible goals, unlike 3NF, which always admits a synthesis algorithm achieving both.

More DBMS and SQL questions

Exams that ask this topic