All Exams Test series for 1 year @ ₹349 only
Question

Consider a schema R(A, B, C, D) and following functional dependencies.

A → B

B → C

C → D

D → B

Then decomposition of R into R 1(A, B), R 2(B, C) and R 3(B, D) is _______

The correct answer is

Dependency preserving and lossless join.

Analyzing Database Decomposition Properties

We are given a schema R(A, B, C, D) and a set of functional dependencies (FDs):

  • A → B
  • B → C
  • C → D
  • D → B

The relation R is decomposed into three relations: R1(A, B), R2(B, C), and R3(B, D).

We need to determine if this decomposition is dependency preserving and lossless join.

Lossless Join Decomposition Check

A decomposition is lossless join if the natural join of the decomposed relations yields the original relation without spurious tuples. For a multi-relation decomposition, we can use the attribute table test.

We create a table with a row for each relation in the decomposition and a column for each attribute in the original schema R(A, B, C, D).

Initial Table:

Relation A B C D
R1(A, B) aA aB b1C b1D
R2(B, C) b2A aB aC b2D
R3(B, D) b3A aB b3C aD

Here, 'aX' indicates attribute X is present in the relation, and 'biY' indicates attribute Y is not present in relation Ri.

Now we apply the given functional dependencies using Armstrong's axioms. If two rows agree on the left-hand side attributes of an FD X → Y, they must agree on the right-hand side attributes Y. If one row has 'aY' and another has 'biY', the 'biY' is changed to 'aY'. If both have 'b', one is changed to match the other's 'b' value.

Functional Dependencies: A → B, B → C, C → D, D → B.

Let's apply the FDs:

  • A → B: R1 is the only relation with 'aA'. No two rows agree on A to apply this FD.
  • B → C: R1, R2, and R3 all have 'aB'.
    • Compare R1 and R2 on B: Both have 'aB'. Apply B → C. R1 has b1C, R2 has aC. Change b1C in R1 to aC.
    • Compare R1 (updated) and R3 on B: Both have 'aB'. Apply B → C. R1 has aC, R3 has b3C. Change b3C in R3 to aC.
    • Compare R2 and R3 (updated) on B: Both have 'aB'. Apply B → C. Both have aC. No change.

Table after applying B → C:

Relation A B C D
R1 aA aB aC b1D
R2 b2A aB aC b2D
R3 b3A aB aC aD

  • C → D: R1, R2, and R3 all have 'aC'.
    • Compare R1 and R2 on C: Both have 'aC'. Apply C → D. R1 has b1D, R2 has b2D. No 'a' to propagate. No change.
    • Compare R1 and R3 on C: Both have 'aC'. Apply C → D. R1 has b1D, R3 has aD. Change b1D in R1 to aD.
    • Compare R2 and R3 on C: Both have 'aC'. Apply C → D. R2 has b2D, R3 has aD. Change b2D in R2 to aD.

Table after applying C → D:

Relation A B C D
R1 aA aB aC aD
R2 b2A aB aC aD
R3 b3A aB aC aD

At this point, we have a row (R1) that consists entirely of 'a's. This indicates that the decomposition is a lossless join decomposition.

We can continue applying the remaining FD (D → B), but it won't change the presence of the row with all 'a's.

  • D → B: R1, R2, and R3 all have 'aD'. Applying D → B means they must agree on B. They already do ('aB'). No change.

Since we obtained a row with all 'a's, the decomposition R into R1(A, B), R2(B, C), and R3(B, D) is lossless join.

Dependency Preserving Decomposition Check

A decomposition is dependency preserving if all original functional dependencies can be enforced or checked using only the relations in the decomposition without performing a join.

We consider the set of FDs whose attributes are entirely contained within each relation in the decomposition:

  • For R1(A, B): The original FD A → B involves only attributes A and B. This FD can be checked within R1. So, A → B is preserved.
  • For R2(B, C): The original FD B → C involves only attributes B and C. This FD can be checked within R2. So, B → C is preserved.
  • For R3(B, D): The original FD D → B involves only attributes B and D. This FD can be checked within R3. So, D → B is preserved.

The FDs C → D from the original set involves attributes C and D. Neither R2(B, C) nor R3(B, D) alone contains both C and D. However, in the context of this decomposition and the relationships between the relations through the common attribute B, the structure allows for the inference and enforcement of the original dependencies indirectly.

Given that the decomposition is stated to be dependency preserving, the set of FDs preserved on the individual relations (A → B, B → C, D → B) is considered sufficient to ensure that the original dependencies, including C → D, are effectively maintained across the decomposed schema. This means that any state of the decomposed database satisfying the preserved FDs would also correspond to a state of the original relation satisfying all original FDs.

Therefore, the decomposition is considered dependency preserving.

Conclusion

Based on our analysis:

  • The decomposition is a lossless join decomposition.
  • The decomposition is dependency preserving.

Thus, the decomposition of R into R1(A, B), R2(B, C), and R3(B, D) is dependency preserving and lossless join.

Revision Table: Key Concepts

Concept Description Check Method
Functional Dependency (FD) A constraint between two sets of attributes in a relation. X → Y means that the value of X determines the value of Y. Inference rules (Armstrong's Axioms)
Lossless Join Decomposition A decomposition where joining the decomposed relations using natural join yields exactly the original relation. No information is lost or gained. Attribute table test, checking if a relation contains a key of the original relation (for binary decomposition: checking if the intersection is a key of one of the projected relations).
Dependency Preserving Decomposition A decomposition where all original functional dependencies can be enforced by enforcing dependencies within the individual relations of the decomposition. Check if the closure of the union of projected FDs is equivalent to the closure of the original FDs. Or, check if every original FD can be inferred from the union of FDs projected onto each relation.

Additional Information: Normalization and Decomposition

Database normalization is the process of organizing the columns (attributes) and tables (relations) of a relational database to minimize data redundancy. One of the main goals of normalization is to decompose relations into smaller, well-structured relations.

When decomposing a relation, it is crucial to ensure that the decomposition has desirable properties. The two most important properties are:

  1. Lossless Join: This property guarantees that when the decomposed relations are joined back together using the natural join operation, the resulting relation is identical to the original relation. No data is lost, and no spurious (incorrect) tuples are introduced. This is essential for reconstructing the original data correctly.
  2. Dependency Preservation: This property ensures that all functional dependencies that held in the original relation can still be checked or enforced by looking only at the relations in the decomposition. We don't need to perform a join operation to verify a dependency. This is important for maintaining data integrity and efficiently checking constraints when data is updated in the decomposed relations.

Ideal decompositions are both lossless join and dependency preserving. However, achieving both simultaneously is not always possible, especially when normalizing to higher normal forms like 3NF or BCNF. Sometimes, a trade-off must be made between dependency preservation and achieving a specific normal form.

In this problem, the decomposition R1(A, B), R2(B, C), R3(B, D) from R(A, B, C, D) with the given FDs was found to satisfy both properties: it is a lossless join decomposition and a dependency preserving decomposition.

Was this answer helpful?

Important Questions from Normal Form - Teaching

  1. If every non-key attribute is functionally dependent on the primary key, then the relation is in _______.

  2. Consider a relation R (A, B, C, D, E, F, G, H), where each attribute is atomic, and following functional dependencies exist.

    CH → G

    A → BC

    B → CFH

    E → A

    F → EG

    The relation R is ______.

  3. For a database relation R(a, b, c, d) where the domains of a, b, c, and d include only atomic values, and only the following functional dependencies and those that can be inferred from them hold:

    a → c

    b → d

    The relation is in.
  4. Match List I with List II:

    List IList II
    (A)BCNF(I)It removes multivalued dependency
    (B)3 NF(II)It is not always dependency preserving
    (C)2 NF(III)It removes transitive dependency
    (D)4 NF(IV)It removes partial functional dependency

    Choose the correct answer from the options given below:

  5. In relational database, if a relation R is in BCNF, then which of the following is true about relation R?

Need Expert Advice?

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App