next up previous
Next: Normalization Using Functional Dependencies Up: Relational Database Design Previous: Representation of Information

Decomposition

  1. The previous example might seem to suggest that we should decompose schema as much as possible.

    Careless decomposition, however, may lead to another form of bad design.

  2. Consider a design where Lending-schema is decomposed into two schemas

     Branch-customer-schema = (bname, bcity, assets, cname)
    

    Customer-loan-schema = (cname, loan#, amount)

  3. We construct our new relations from lending by:

     branch-customer =  tex2html_wrap_inline1540 
    

    customer-loan = tex2html_wrap_inline1542

      figure105
    Figure 7.2:   The decomposed lending relation.

  4. It appears that we can reconstruct the lending relation by performing a natural join on the two new schemas.
  5. Figure 7.3 shows what we get by computing branch-customer tex2html_wrap_inline1544 customer-loan.

      figure122
    Figure 7.3:   Join of the decomposed relations.

  6. We notice that there are tuples in branch-customer tex2html_wrap_inline1544 customer-loan that are not in lending.
  7. How did this happen?
  8. When we decomposed Lending-schema into Branch-schema and Loan-info-schema, we will not have a similar problem. Why not?

     Branch-schema = (bname, bcity, assets)
    

    Branch-loan-schema = (bname, cname, loan#, amount)

  9. For a given branch name, there is exactly one assets value and exactly one bcity; whereas a similar statement associated with a loan depends on the customer, not on the amount of the loan (which is not unique).
  10. We'll make a more formal definition of lossless-join:
  11. In other words, a lossless-join decomposition is one in which, for any legal relation r, if we decompose r and then ``recompose'' r, we get what we started with - no more and no less.


next up previous
Next: Normalization Using Functional Dependencies Up: Relational Database Design Previous: Representation of Information

Osmar Zaiane
Thu Jun 18 12:56:34 PDT 1998