Upload
khanh-nguyen
View
226
Download
0
Embed Size (px)
Citation preview
7/31/2019 26CS157F 4N and the Normalization Of
1/15
4N and the Normalization ofMultivalue Dependency
By:
Laith Alnagem
7/31/2019 26CS157F 4N and the Normalization Of
2/15
Rules
Fourth Normal Form- if Ris 3N and BCNF
- given the non-trivial MVD: A1A2An B1B2Bn{A1A2An} is a superkey
A MVD: A1A2An B1B2Bn for a Relation Ris non-trivial if:
1. none of the Bs are among the As2. Not all of the attributes of Rare among the As and Bs
A MVD is trivial if it contains all the variations ofA1A2AnxB1B2Bn.
or is or
7/31/2019 26CS157F 4N and the Normalization Of
3/15
Formal Definition
Let Rbe a relation schema and let Rand R .The multivalued dependency
holds on R if, in any legal relation r(R), for all pairs oftuples t1 and t2 in rsuch that t1[] = t2[], there existtuples t3 and t4 in rsuch thatt1[] = t2[] = t3[] = t4[]t3[] = t1[]t3[R ] = t2[R ]t4[] = t2[]t4[R ] = t1[R ][1]
http://en.wikipedia.org/wiki/Multivalued_dependencyhttp://en.wikipedia.org/wiki/Multivalued_dependency7/31/2019 26CS157F 4N and the Normalization Of
4/15
Multivalued Dependency in 4N
A table with a multivalued dependency is one
where the existence of more than oneindependent many-to-many relationships in atable causes redundancy; and it is thisredundancy which is removed by fourth
normal form.
7/31/2019 26CS157F 4N and the Normalization Of
5/15
Example
Restaurant Pizza Variety Delivery Area
Elite Pizza Thin Crust Capital City
Elite Pizza Stuffed Crust Capital City
A1 Pizza Thick Crust Springfield
A1 Pizza Thick Crust Shelbyville
A1 Pizza Thick Crust Capital City
A1 Pizza Stuffed Crust Springfield
A1 Pizza Stuffed Crust Shelbyville
A1 Pizza Stuffed Crust Capital City
7/31/2019 26CS157F 4N and the Normalization Of
6/15
Example (cont)
It is 1N, 2N, 3N and BCNF
But because the varieties of pizza a restaurant offersare independent from the areas to which therestaurant delivers, there is redundancy in the table:
for example, we are told three times that A1 Pizzaoffers Stuffed Crust, and if A1 Pizza start producing
Cheese Crust pizzas then we will need to addmultiple records, one for each of A1 Pizza's deliveryareas.
7/31/2019 26CS157F 4N and the Normalization Of
7/15
The Fix
Restaurant Pizza Variety Delivery Area
Elite Pizza Thin Crust Capital CityElite Pizza Stuffed Crust Capital City
A1 Pizza Thick Crust Springfield
A1 Pizza Thick Crust Shelbyville
A1 Pizza Thick Crust Capital City
A1 Pizza Stuffed Crust Springfield
A1 Pizza Stuffed Crust Shelbyville
A1 Pizza Stuffed Crust Capital City
7/31/2019 26CS157F 4N and the Normalization Of
8/15
Restaurant Pizza Variety
Elite Pizza Thin Crust
Elite Pizza Stuffed Crust
A1 Pizza Thick Crust
A1 Pizza Stuffed Crust
Restaurant Delivery Area
Elite Pizza Capital City
A1 Pizza Springfield
A1 Pizza Shelbyville
A1 Pizza Capital City
7/31/2019 26CS157F 4N and the Normalization Of
9/15
A little thought
Q:
What if the pizza varieties offered by arestaurant sometimes did vary from onedelivery area to another?
7/31/2019 26CS157F 4N and the Normalization Of
10/15
A:
Then the original three-column table wouldsatisfy 4NF
7/31/2019 26CS157F 4N and the Normalization Of
11/15
Course Book Lecturer
AHA Silberschatz John D
AHA Nederpelt John D
AHA Silberschatz William M
AHA Nederpelt William M
AHA Silberschatz Christian G
AHA Nederpelt Christian G
OSO Silberschatz John D
OSO Silberschatz William M
7/31/2019 26CS157F 4N and the Normalization Of
12/15
A.
1. {course} {book}2. {course} {lecturer}
7/31/2019 26CS157F 4N and the Normalization Of
13/15
Conclusions
Databases with multivalued dependencies
exhibit redundancy. In database normalization, fourth normal
form requires that databases have nomultivalued dependencies.
http://en.wikipedia.org/wiki/Database_normalizationhttp://en.wikipedia.org/wiki/Fourth_normal_formhttp://en.wikipedia.org/wiki/Fourth_normal_formhttp://en.wikipedia.org/wiki/Fourth_normal_formhttp://en.wikipedia.org/wiki/Fourth_normal_formhttp://en.wikipedia.org/wiki/Database_normalization7/31/2019 26CS157F 4N and the Normalization Of
14/15
Extra
Transitivity, Reflexivity, Complementation,
Replication, Augmentation and a few moreare all properties of 4th normal form
7/31/2019 26CS157F 4N and the Normalization Of
15/15
References
Multivalued dependency
From Wikipedia, the free encyclopedia
Revision as of 11:59, 24 October 2006 by GurchBot (Talk | contribs)(diff) Older revision| Current revision | Newer revision (diff)
DataBase: System Concepts (5th Edition) Ch-7
Silberschatz, Korth, Sudarshan
NY, 2006
http://en.wikipedia.org/wiki/User:GurchBothttp://en.wikipedia.org/wiki/User_talk:GurchBothttp://en.wikipedia.org/w/index.php?title=Special:Contributions&target=GurchBothttp://en.wikipedia.org/w/index.php?title=Multivalued_dependency&diff=prev&oldid=83406977http://en.wikipedia.org/w/index.php?title=Multivalued_dependency&direction=prev&oldid=83406977http://en.wikipedia.org/w/index.php?title=Multivalued_dependency&direction=prev&oldid=83406977http://en.wikipedia.org/w/index.php?title=Multivalued_dependency&diff=prev&oldid=83406977http://en.wikipedia.org/w/index.php?title=Special:Contributions&target=GurchBothttp://en.wikipedia.org/wiki/User_talk:GurchBothttp://en.wikipedia.org/wiki/User:GurchBot