Professional Documents
Culture Documents
Normalization
Atechniqueusedtoperformlogicaldatabasedesign,andfor
producingsetofrelationsthatpossessacertainsetofproperties
Processoforganizingdatainadatabase,whichincludescreating
tablesandestablishingrelationshipbetweentablestoeliminate
redundancyandinconsistentdependency
DatabaseNormalization
FunctionalDependency
NormalForms
*PropertyofSTI
1 _________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
Anyrelation(table)willbetakenandauniqueidentifier(primary
key)willbechosenfortheentity(table)thattherelation
represents
2__________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
TheNeedforNormalization
Normalizingrelationsispracticedtoremoveanomaliesfromthe
data
InsertAnomaly
K0044
Referstothesituationwhereindeletionofdataaboutoneparticularentity
causesunintentionallossofdatathatrepresentsanotherentity
UpdateAnomaly
Figure6.1NormalizationProcess
Referstoasituationwhereinanewtuple(row)cannotbeinsertedina
relationbecauseofanartificialdependencyonanotherrelation
DeleteAnomaly
*PropertyofSTI
K0044
Referstoasituationinwhichanupdateofasingledatavaluerequires
multipletuple(rows)ofdatatobeupdated
*PropertyofSTI
3 _________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
K0044
4__________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
ClassificationofFunctionDependency
Describestherelationshipbetweentwosetsofattributes
(column)fromthedatabase
FullFunctionalDependency
IftwotupleshavesamevaluesforattributesA1,A2An,then
thosetwotuplesmusthavesamevaluesforattributesB1,
B2.Bn
Example:
IfAandBareattributesofatable,BisfullyfunctionallydependentonAifBis
functionallydependentonA,butnotonanypropersubsetofA
Representedbyanarrowsign()
*PropertyofSTI
Yisfullyfunc onallydependentonXandthereshouldnotbeanyZY,
whereZisapropersubsetofX
K0044
*PropertyofSTI
5 _________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
ClassificationofFunctionDependency
K0044
6__________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
ClassificationofFunctionDependency
PartialDependency
TransitiveDependency
IfAandBareattributesofatable,BispartiallydependentonAifthereis
someattributethatcanberemovedfromAandyetthedependencystillholds
AconditionwhereA,B,andCareattributesofatablesuchthat,ifAis
functionallydependentonBandBisfunctionallydependentonCthenCis
transitivelydependentonAviaB
Example:
Givenarela onR(A,B,C,D,E),Func onalDependencyABCDE,and
PrimaryKeyAB
Example:
Givenarela onR(A,B,C,D,E),anddependencyAB,BCistransi ve
dependency,sinceACisimplied
ACispar aldependency
ADispar aldependency
AEispar aldependency
BCispar aldependency
BDispar aldependency
BEispar aldependency
*PropertyofSTI
K0044
*PropertyofSTI
7 _________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
K0044
8__________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
FirstNormalForm(1NF)
Norowsofdatamustcontainrepeatinggroupofinformationthatiseachset
ofcolumnmusthaveauniquevalue,suchthatmultiplecolumnscannotbe
usedtoobtainsamerow
UnnormalizedForm
Increasesdataredundancy,sincetherewillbemanycolumnswithsamedata
inmultiplerows,buteachrowwillbeunique
Figure 6. 4 1NF
*PropertyofSTI
K0044
*PropertyofSTI
9 _________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
SecondNormalForm(2NF)
K0044
10 ________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
ThirdNormalForm(3NF)
Theremustbenopartialdependencyofanycolumnonprimarykey
Eachcolumnisdirectlydependent
ontheprimarykeywhilenon
primarykeycolumnsarent
dependentonothernonprimary
keycolumns
Atablethathasconcatenatedprimarykey,eachcolumninthetable,whichis
notpartoftheprimarykey,mustdependupontheentireconcatenatedkeyfor
itsexistence
Transitivefunctionaldependency
shouldberemovedfromthetable,
andmusthavebeenin2NF
Figure 6. 5 2NF
Figure 6. 6 3NF
*PropertyofSTI
K0044
*PropertyofSTI
11 ________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
K0044
12 ________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
BoyceCodd NormalForm(BCNF)
FourthNormalForm(4NF)
Referredasthirdandahalf(3.5)normalform
Arelationisinthefourthnormalform(4NF)ifandonlyifitdoesnotcontain
MultiValuedDependency(MVD)thatexistsinatable
NamedafterRayBoycewhowasoneofthecreatorsofSQL,andEdgarCodd
whoistheFatherofRelationalDatabases
Eliminatesmostoftheanomaliesknownindatabasestoday
MultiValuedDependency
Mostcommonstandardfornormalizationincommercialdatabasesand
computeraidedsoftwareengineeringtools
occurswhenthepresenceofoneormorerowsinatableimpliesthepresence
ofoneormoreotherrowsinthatsametable
FifthNormalForm(5NF)
Alsocalledtheprojectionjoinnormalform(PJ/NF)
Arelationisinthefifthnormalformifandonlyifeveryjoindependencyinthe
relationisaconsequenceofthecandidatekeysoftherelation
*PropertyofSTI
K0044
*PropertyofSTI
13 ________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
K0044
14 ________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________