Presentation is loading. Please wait.

Presentation is loading. Please wait.

Multivalued Dependencies Fourth Normal Form Tony Palladino 157B.

Similar presentations


Presentation on theme: "Multivalued Dependencies Fourth Normal Form Tony Palladino 157B."— Presentation transcript:

1 Multivalued Dependencies Fourth Normal Form Tony Palladino 157B

2 Multivalued Dependencies  Multivalued dependencies exit when the relation contains unnecessary duplication of data.  BCNF is required in order to be in Fourth Normal Form  Also referred to as equality- generating dependencies

3 Multivalued Dependencies cont.  Given the “non-trivial definition” MVD: A 1 A 2 …A n => B 1 B 2 …B n then {A 1 A 2 …A n } is the superkey  A MVD: for A 1 A 2 …A n => B 1 B 2 …B n for a Relation R is “non-trivial” if 1. none of the Bs are among the As 2. none of the attributes of R are among the As and Bs  A MVD is “trivial” if it contains all the variations of A 1 A 2 …A n x B 1 B 2 …B n  A relation cannot be decomposed any further (under 4NF) if it has a trivial MVD

4 Fourth Normal Fourth: definition  Fourth normal form (or 4NF) requires that there are no non-trivial multi-valued dependencies of attribute sets on something other than a superset of a candidate key. A table is said to be in 4NF if and only if it is in the BCNF and multi- valued dependencies are functional dependencies. The 4NF removes unwanted data structures: multi-valued dependencies  www.wikipedia.org

5 Fourth Normal Fourth  There is no multivalued dependency in the relation  There are multivalued dependency but the attributes are dependent between themselves  Either of these conditions must hold true in order to be fourth normal form  The relation must also be in BCNF  Fourth normal form differs from BCNF only in that it uses multivalued dependencies

6 Why was fourth normal form developed?  It was necessary to develop a way to eliminate non-trivial multivalued dependencies.  It was needed in order to be applied to many to many relationships  Without being adjusted for fourth normal form, there may result update anomalies

7 How to achieve fourth normal form  In order to do so, all unnecessary tuples must be eliminated  This includes those with null values  All MVD’s must be changed from non-trivial to trivial

8 An Example StudentNameMajorClasses smithCSNull smithMathNull smithNullCS146 smithNullMath104 smithNullCS151 StudentNameMajorsmithCS smithMath StudentNameClassesSmithCS146 SmtihMath104 SmithCS151 This relation has extraneous tuples Must be removed to be in 4NF These are both now in fourth normal form

9 Checking for Multivalued Dependencies  You must check for all like tuples  For example: A->>B ABC 135 246 157 248 In this case you have to calculate for the tuples shown in each chart.ABC246 248 ABC 135 157

10 Checking for Multivalued Dependencies, Cont.  There is an easy way to check! First, write the tuples to be compared ABC 135 157

11 Checking for Multivalued Dependencies, Cont.  Next, write the attributes in the multivalued dependency on the chart, underneath their current place in the same order ABC 135 157 13 15

12 Checking for Multivalued Dependencies, Cont.  Next, write the extra attributes below the originals, but swap the order as shown ABC 135 157 137 155

13 Checking for Multivalued Dependencies, Cont.  Then check relation to see if all the dependencies exist ABC 135 157 137 155 ABC135 246 157 248 Not all exist, so this is not a proper multivalued dependency

14 Another Example ABCD 3212 3232 2342 3233 4242 1342 4343 ACBDt1=r54422 t2=r74433 t3=r74433 t4=r54422 t1=r13122 t2=r23322 t3=r13122 t4=r23322 t1=r13122 t2=r43323 t3=r13123 t4=r43322

15 Armstrong’s Axioms  Reflexivity: if A is a set of attributes, and B belongs to A, then A->B holds true.  Augmentation: if A->B holds, and C is a set of attributes, the AC ->BC holds true.  Complementation: if A->B holds, then A->R-b-a holds true  Transitivity: if A->b holds, and b->c holds, then a->c holds

16 Multivalued Axioms  Multivalued transitivity: if A->B holds, and B->C holds, then A->CB holds  Replication: if A->B holds, then A->>B  Multivalued Augmentation: if A->B holds, and C belongs to R and D belongs to C, then AC->:BD holds  Coalescence: if A->>B holds,, and C belongs to B, and there is a D such that D belongs to R and D^B = 0, and d->C, then A->C holds


Download ppt "Multivalued Dependencies Fourth Normal Form Tony Palladino 157B."

Similar presentations


Ads by Google