Denny Tran CS157B 3/25/2010. Agenda Definition MVD Rules Examples.
-
Upload
rita-barrett -
Category
Documents
-
view
215 -
download
2
Transcript of Denny Tran CS157B 3/25/2010. Agenda Definition MVD Rules Examples.
Denny Tran
CS157B
3/25/2010
Agenda
Definition MVD Rules Examples
Definition
The multivalued dependency X->>Y holds in a relation R if wherever we have two tuples of R that agree in all the attributes of X, then we can swap their Y components and get two new tuples that are also in R.
Graphical Representation
MVD Rules
Every FD is an MVD: If X -> Y, then X ->> Y
A B C1 3 22 1 21 3 32 1 1
A -> B
1: 32: 1
A ->> B
MVD Rules Cont
Complementation: If X ->> Y, then X ->> Z where Z is all attributes not in X or Y.
A B C1 3 22 1 21 3 32 1 1
Show ifA ->> BthenA ->> C
1: 2,32: 2,1
A B C1 32 1
True
Example 1Instructor ->> BookInstructor Book Class
Price Inro Comp MIS 2003Parker Intro Comp MIS 2003Kemp Data in
ActionMIS 4533
Kemp ORACLE Tricks
MIS 4533
Warner Data in Action
MIS 4533
Warner ORACLE Tricks
MIS 4533
Price: Intro CompParker: Intro CompKemp: Data in Action, ORACLE TricksWarner: Data in Action, ORACLE Tricks
Instructor Book Class
Price Intro Comp MIS 2003
Parker Intro Comp MIS 2003
Kemp MIS 4533
Warner MIS 4533
Data in Action
Data in Action
ORACLE Tricks
ORACLE Tricks
MVD Satisfied!
Example 1 cont
Instructor Book ClassPrice Inro Comp MIS 2003Parker Intro Comp MIS 2003Kemp Data in
ActionMIS 4533
Kemp ORACLE Tricks
MIS 4533
Warner Data in Action
MIS 4533
Warner ORACLE Tricks
MIS 4533
Instructor ->> Class
Price: MIS2003Parker: MIS2003Kemp: MIS4533Warner: MIS4533
Nothing to swap so satisfies MVD.
Example 1 contInstructor Book ClassPrice Inro Comp MIS 2003Parker Intro Comp MIS 2003Kemp Data in
ActionMIS 4533
Kemp ORACLE Tricks
MIS 4533
Warner Data in Action
MIS 4533
Warner ORACLE Tricks
MIS 4533
Class ->> Instructor
MIS2003: Price, ParkerMIS4533: Kemp, Warner
Instructor Book Class Intro
CompMIS 2003
Data in Action
MIS 4533
ORACLE Tricks
MIS 4533
PriceParker
Kemp
Kemp
Warner
Warner
MVD Satisfied!
Example 2Name Area Code Phone Beers
LikedBeer Manufacturer
Sue 650 555-1111 Bud A.B.Sue 650 555-1111 WickedAle Pete'sSue 415 555-9999 Bud A.B.Sue 415 555-9999 WickedAle Pete's
Name ->> Area Code?
Name Area Code Phone Beers Liked
Beer Manufacturer
Sue 415 555-1111 Bud A.B.
Name ->> Phone?
Name Area Code Phone Beers Liked
Beer Manufacturer
Sue 650 555-9999 Bud A.B.
No
No
Example 2 ContName Area Code Phone Beers
LikedBeer Manufacturer
Sue 650 555-1111 Bud A.B.Sue 650 555-1111 WickedAle Pete'sSue 415 555-9999 Bud A.B.Sue 415 555-9999 WickedAle Pete's
Name ->> AreaCode Phone?
Sue: {650, 555-1111}, {415, 555-9999}
Name Area Code Phone Beers Liked
Beer Manufacturer
Sue Bud A.B.Sue WickedAle Pete's
Yes!
Example 3: Tuple-generating effect of MVD
A B C D1 1 2 11 2 3 11 3 1 21 2 2 11 3 2 11 1 3 11 3 3 11 1 1 21 2 1 2
1: 1, 2, 3A ->> B
Questions?