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 joinConceptA decomposition of a relation R into two fragments is judged on two independent properties, and each property has its own test. Lossless join: the…

  1. A.

    Dependency preserving but not lossless join

  2. B.

    Dependency preserving and lossless join

  3. C.

    Lossless join but not dependency preserving

  4. 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 R1R2 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

  1. List the shared attributes: R1R2 = {A, B} ∩ {C, D} = ∅ — the two fragments have no attribute in common.

  2. 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.

  3. 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.

  4. 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 R1R2 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 R1R2 = ∅ 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.

Explore the full course: Nta Ugc Net Paper 2

Loading lesson…