Consider a schema R(A, B, C, D) with the following functional dependencies: A…
2017
Consider a schema R(A, B, C, D) with the following functional dependencies:
A → B
B → C
C → D
D → B
The decomposition of R into R1(A, B), R2(B, C) and R3(B, D) is __________ .
- A.
Dependency preserving and lossless join.
- B.
Lossless join but not dependency preserving.
- C.
Dependency preserving but not lossless join.
- D.
Not dependency preserving and not lossless join.
Attempted by 270 students.
Show answer & explanation
Correct answer: A
Concept
A binary decomposition of R into R1 and R2 is lossless iff the common attributes (R1 ∩ R2) form a superkey of at least one of R1 or R2 — i.e. (R1 ∩ R2) → R1 or (R1 ∩ R2) → R2. A decomposition is dependency-preserving iff the union of the FDs projected onto each subrelation has the same closure as the original FD set F, so every original FD is implied by the projections.
Set-up
First note the cycle B → C → D → B. Hence B, C and D are mutually equivalent: B⁺ = C⁺ = D⁺ = {B, C, D}. So each of B, C, D determines the other two. (A is determined by nothing, since no FD has A on its right side.)
Lossless-join check
R1(A, B) ⋈ R2(B, C): common attribute is B. In R2, B → C holds, so B is a key of R2. The intersection determines a whole subrelation, so this join is lossless and yields R12(A, B, C).
R12(A, B, C) ⋈ R3(B, D): common attribute is B. Since B⁺ = {B, C, D} ⊇ {B, D}, we have B → D, so B is a key of R3(B, D). Again the intersection is a key, so this join is lossless and reconstructs R(A, B, C, D).
Both binary joins are lossless, so the overall decomposition is lossless.
Dependency-preservation check
Project the FDs onto each subrelation and take the union F′:
R1(A, B) gives A → B.
R2(B, C) gives B → C and (since C⁺ ⊇ {B}) C → B.
R3(B, D) gives B → D and (since D → B) D → B.
Now recover every original FD from F′:
A → B : present directly (from R1).
B → C : present directly (from R2).
C → D : not stored directly, but F′ has C → B (R2) and B → D (R3); by transitivity C → B → D gives C → D.
D → B : present directly (from R3).
Every original FD is implied by F′, so the decomposition is dependency-preserving.
Conclusion
The decomposition is both lossless-join and dependency-preserving.
Cross-check (the key idea behind the lossless rule)
The reason losslessness holds here is exactly the rule that the shared attribute must be a key (superkey) in at least one of the two relations being joined. Because the cycle makes B equivalent to C and D, B acts as a key in both R2 and R3, so neither join introduces spurious tuples.
A video solution is available for this question — log in and enroll to watch it.