CS FundamentalsHardProduct-company interview pattern

R(A, B, C, D) has FDs A → B and C → D. It is decomposed into R1(A, B), R2(C, D) and R3(A, C). Which statement is correct?

  1. A. It is lossy, because R1 and R2 share no attribute
  2. B. The decomposition is lossless and dependency-preserving
  3. C. It is lossless but not dependency-preserving
  4. D. It is dependency-preserving but lossy

Correct answer: B. The decomposition is lossless and dependency-preserving

AC is the key of R (AC⁺ = ABCD), and R3 contains it. Joining R3 with R1 on A (A → B, A is a key of R1) and then with R2 on C (C → D) is lossless at each step. A → B lives in R1 and C → D in R2, so dependencies are preserved. R1 and R2 need not share attributes because R3 links them.

More DBMS and SQL questions

Exams that ask this topic