Consider a schema R(A, B, C, D) and functional dependencies A → B and C → D.…
2012
Consider a schema R(A, B, C, D) and functional dependencies A → B and C → D. Then the decomposition R1(A, B) and R2(C, D) is
Answer: A. Dependency preserving but not lossless join — ConceptA decomposition of a relation R into two fragments is judged on two independent properties, and each property has its own test. Lossless join: the…
- A.
Dependency preserving but not lossless join
- B.
Dependency preserving and lossless join
- C.
Lossless join but not dependency preserving
- D.
Lossless join
Attempted by 87 students.
Show answer & explanation
Correct answer: A
Concept
A decomposition of a relation R into two fragments is judged on two independent properties, and each property has its own test.
Lossless join: the natural join of the fragments must return exactly the original relation for every legal instance. The test is that the shared attribute set R1 ∩ R2 must functionally determine all of R1 or all of R2 — that is, it must be a superkey of at least one fragment.
Dependency preservation: every functional dependency in F must be enforceable inside one fragment. Formally, the projections of F onto R1 and R2 taken together must imply all of F+, so no join is needed to validate an update.
Application
List the shared attributes: R1 ∩ R2 = {A, B} ∩ {C, D} = ∅ — the two fragments have no attribute in common.
Apply the lossless-join test: the closure of the empty set is empty (∅+ = ∅), so ∅ determines neither {A, B} nor {C, D}. Neither ∅ → R1 nor ∅ → R2 is implied by F, so the decomposition is not a lossless-join decomposition.
Project the dependencies: A → B has both of its attributes inside R1(A, B), so R1 alone can enforce it; C → D has both of its attributes inside R2(C, D), so R2 alone can enforce it.
Union the projections: {A → B} ∪ {C → D} = F. Every dependency of F survives on a single fragment, so the decomposition is dependency preserving.
Cross-check
Because the fragments share no attribute, the natural join R1 ⋈ R2 degenerates into a Cartesian product. Take the instance R = {(a1, b1, c1, d1), (a2, b2, c2, d2)}. Then R1 = {(a1, b1), (a2, b2)} and R2 = {(c1, d1), (c2, d2)}, and their join produces 2 × 2 = 4 tuples: the two original ones plus two spurious ones such as (a1, b1, c2, d2). The extra tuples cannot be removed afterwards, which is exactly what a lossy decomposition means. Dependency checking is untouched by this, because neither A → B nor C → D ever needs a join to be validated.
Property | Test applied here | Outcome |
|---|---|---|
Lossless join | Is R1 ∩ R2 = ∅ a superkey of a fragment? | ∅ determines nothing, so the join is lossy |
Dependency preservation | Does every FD of F lie inside one fragment? | A → B lies in R1 and C → D lies in R2 |
Result
The decomposition R1(A, B), R2(C, D) is dependency preserving but not lossless join.