CS FundamentalsVery hardGATE

R(City, Street, Zip) has FDs City,Street → Zip and Zip → City, with candidate keys {City,Street} and {Street,Zip}. Decomposing into R1(Zip, City) and R2(Zip, Street) removes the BCNF violation (Zip → City, since Zip alone isn't a superkey). Is this specific decomposition lossless, and is it dependency-preserving?

  1. A. Neither lossless nor dependency-preserving
  2. B. Lossless (Zip is a key of R1), but NOT dependency-preserving (City,Street → Zip can no longer be checked without joining R1 and R2 back together)
  3. C. Lossless and fully dependency-preserving
  4. D. Not lossless, but dependency-preserving

Correct answer: B. Lossless (Zip is a key of R1), but NOT dependency-preserving (City,Street → Zip can no longer be checked without joining R1 and R2 back together)

The common attribute of R1(Zip,City) and R2(Zip,Street) is Zip, and Zip → City makes Zip a key of R1, satisfying the lossless-join test. But City,Street → Zip no longer lives inside either piece alone — Street is in R2, City is in R1 — so verifying it requires rejoining R1 and R2, meaning this correct, BCNF-achieving decomposition is NOT dependency-preserving.

More DBMS and SQL questions

Exams that ask this topic