• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Multivalued dependency
 

Multivalued dependency

on

  • 7,332 views

 

Statistics

Views

Total Views
7,332
Views on SlideShare
7,332
Embed Views
0

Actions

Likes
2
Downloads
68
Comments
1

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

11 of 1 previous next

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • very help full some contents of normalization
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Multivalued dependency Multivalued dependency Presentation Transcript

    • Multivalued Dependency Tamer Abuelata
    • Introduction
      • Goal in Databases:
        • BCNF (Boyce Codd Normal Form)
        • Losslessness
        • Dependency preservation
    • Remember…
      • Boyce Codd Normal Form (BCNF) eliminates all redundancy that can be discovered based on functional dependencies.
    • Issue
      • Some relation schemas, even though they are in BCNF, do not seem to be sufficiently normalized.
      • They still contain repetitions
    • Case study
      • Consider the bank database schema:
      • cust_loan = ( loan_number, cust_id , cust_name, cust_street, cust_city)
      • This is BCNF because of the functional dependency:
      • cust_id -> cust_name, cust_street cust_city
      • And because cust_id is not a key for cust_loan
    • Case Study
      • But what if some customers have several addresses?
      • We no longer wish to enforce the func. dependency: cust_id ->cust_street cust_city
      • But we still want to enforce
      • cust_id -> cust_name
    • Case Study
      • Following BCNF decomposition algorithm
      • we get:
      • R1 = ( cust_id , cust_name)
      • R2 = ( loan_number, cust_id , cust_street, cust_city)
      • (both in BCNF)
    • Case Study
      • The issue
      • Despite R2 in BCNF, there is redundancy. We repeat the address of each residence for each loan that the customer has.
    • Case Study
      • We can therefore decompose further into:
      • loan_cust_id = (loan_number, cust_id)
      • cust_residence = (cust_id, cust_street, cust_city)
      • But there is no constraint that lead us to do that.
      • To deal with this, we need a few form of constraint: 4NF.
    • 4NF
      • We can use multivalued dependencies to define the fourth normal form
    • 4NF
      • A relation schema R is in fourth normal form with respect to a set D of functional and multivalued dependencies if, for all multivlued dependencies in D+ of the form A -->-> B at least one of the following holds:
        • A -->-> B is a trivial multivalued dependency
        • A is a superkey for schema R
    • Multivalued Dependency
      • Requires that other tuples of a certain form be present in the relation.
      • Multivalued Dependencies
      • The  multivalued dependency  relates to this problem when more than one multivalued attributes exist.
      • Also referred to as:
      • tuple-generating dependency
    • Example
      • R relation schema, A and B follow the multivalued dependency :
      • A -->-> B
      • The relationship between A and B is independent of the relation between A and R – B
      • If A -->-> B is satisfied by all relations on R then
      • A -->-> B is a trivial multivalued dependency
    • Example
      • Let’s reconsider
      • R2 = ( loan_number, cust_id , cust_street, cust_city)
      loan_number cust_id cust_street cust_city L-23 99-123 North Rye L-23 99-123 Main Manchester L-93 15-106 Lake Horseneck
    • Example We must repeat the loan number once for each address a customer has and we must repeat the address for each loan a customer has. loan_number cust_id cust_street cust_city L-23 99-123 North Rye L-23 99-123 Main Manchester L-93 15-106 Lake Horseneck
    • Example We must repeat the loan number once for each address a customer has and we must repeat the address for each loan a customer has. This repetition is unnecessary since the relationship between a customer and his address is independent of the relationship between that customer and a loan. loan_number cust_id cust_street cust_city L-23 99-123 North Rye L-23 99-123 Main Manchester L-93 15-106 Lake Horseneck
    • Example
      • Therefore this relation is illegal
      loan_number cust_id cust_street cust_city L-23 99-123 North Rye L-27 99-123 Main Manchester
    • Example
      • Therefore this relation is illegal
      • To make it legal we should add tuples
      • (L23, 99-123, Main, Manchester) and
      • (L27, 99-123, North, Rye)
      loan_number cust_id cust_street cust_city L-23 99-123 North Rye L-27 99-123 Main Manchester
    • Example
      • Updated table (legal)
      loan_number cust_id cust_street cust_city L-23 99-123 North Rye L-27 99-123 Main Manchester L-23 99-123 Main Manchester L-27 99-123 North Rye
    • Example
      • Updated table (legal)
      • We want Cust_id -->-> cust_street cust_city
      • to hold
      loan_number cust_id cust_street cust_city L-23 99-123 North Rye L-27 99-123 Main Manchester L-23 99-123 Main Manchester L-27 99-123 North Rye
    • Conclusion
      • We can use multivalued dependencies
      • To test relations to determine whether they are legal under a given set of functional and multivalued dependencies
      • To specify constraints on the set of legal relations