5 NF

download 5 NF

of 5

Transcript of 5 NF

  • 7/26/2019 5 NF

    1/5

    NOTES on 5NF

    A relation R is in Fifth Normal Form (5NF) if and only if the following conditions aresatisfied simultaneously:

    1. R is already in 4NF.

    2. t cannot !e further non"loss decom#osed.

    Fifth normal form(5NF)$ also %nown as project-join normal form(PJ/NF) is a

    le&el ofdata!ase normali'ationdesigned to reduce redundancy in relational data!ases

    recording multi"&alued facts !y isolatingsemantically related multi#le relationshi#s. A

    ta!leis said to !e in the 5NF if and only ife&ery non"tri&ialoin de#endency in it is

    im#lied !y the candidate %eys.

    Aoin de#endency*A$ +$ , - on R is im#lied !y the candidate %ey(s) of Rif and only if

    each of A$ +$ ,$ - is a su#er%eyfor R.

    /he fifth normal form was first descri!ed !y Ronald Faginin his 100 conference #a#er.

    5NF is of little #ractical use to the data!ase designer$ !ut it is of interest from atheoretical #oint of &iew and a discussion of it is included here to com#lete the #icture ofthe further normal forms.

    n all of the further normal forms discussed so far$ no loss decom#osition was achie&ed!y the decom#osing of a single ta!le into two se#arate ta!les. No loss decom#osition is#ossi!le !ecause of the a&aila!ility of the oin o#erator as #art of the relational model. nconsidering 5NF$ consideration must !e gi&en to ta!les where this non"lossdecom#osition can only !e achie&ed !y decom#osition into three or more se#arateta!les. uch decom#osition is not always #ossi!le as is shown !y the following e3am#le.

    onsider the ta!le

    A6N/789AN;7R8

  • 7/26/2019 5 NF

    2/5

    /his ta!le lists agents$ the com#anies they wor% for and the #roducts they sell for thosecom#anies. >/he agents do not necessarily sell all the #roducts su##lied !y thecom#anies they do !usiness with. An e3am#le of this ta!le might !e:

    /he ta!le is necessary in order to show all the information re?uired. uneet$ fore3am#le$ sells A+>s Nuts and crews$ !ut not A+>s +olts. Ra is not an age it for s Nuts or crews. /he ta!le is in 4NF !ecause it contains no multi"&alued de#endency. t does$ howe&er$ contain an element of redundancy in that itrecords the fact that uneet is an agent for A+ twice. +ut there is no way of eliminatingthis redundancy without losing information. u##ose that the ta!le is decom#osed into

    its two #roections$ and 2.

    /he redundancy has !een eliminated$ !ut the information a!out which com#anies ma%ewhich #roducts and which of these #roducts they su##ly to which agents has !een lost./he natural oin of these #roections o&er the >agent> columns is:

    /he ta!le resulting from this oin is s#urious$ since the asteris%ed row of the ta!lecontains incorrect information. Now su##ose that the original ta!le were to !edecom#osed into three ta!les$ the two #roections$ and 2 which ha&e alreadyshown$ and the final$ #ossi!le #roection$ @.

    f a oin is ta%en of all three #roections$ first of and 2 with the (s#urious) resultshown a!o&e$ and then of this result with @ o&er the >om#any> and >roduct name>column$ the following ta!le is o!tained:

    /his still contains a s#urious row. /he order in which the oins are #erformed ma%es nodifference to the final result. t is not sim#ly #ossi!le of decom#ose the>A6N/789AN;7R8 ta!le$ #o#ulated as shown$ without losinginformation. /hus$ it has to !e acce#ted that it is not #ossi!le to eliminate allredundancies using normali'ation techni?ues$ !ecause it cannot !e assumed that alldecom#ositions will !e non"loss.

    http://ecomputernotes.com/fundamental/information-technology/what-do-you-mean-by-data-and-informationhttp://ecomputernotes.com/fundamental/information-technology/what-do-you-mean-by-data-and-informationhttp://ecomputernotes.com/fundamental/information-technology/what-do-you-mean-by-data-and-information
  • 7/26/2019 5 NF

    3/5

    +ut now consider the different case where$ if an agent is an agent for a com#any andthat com#any ma%es a #roduct$ then he always sells that #roduct for the com#any.=nder these circumstances$ the >agent com#any #roduct> ta!le as shown !elow:

    /he assum#tion !eing that A+ ma%es !oth Nuts and +olts and that com#any >#roduct7name> the following ta!le is o!tained:

    /his is a correct recom#osition of the original ta!le and no loss decom#osition into thethree #roections was achie&ed. Again$ the order in which the oins are #erformed doesnot affect the final result. /he original ta!le$ therefore$ &iolated 5NF sim#ly !ecause itwas non"loss decom#osa!le into its three #roections.

    n the first case e3em#lified a!o&e$ non"loss decom#osition of the >agent7com#any"#roduct> ta!le was not #ossi!le. n the second it was. f a ta!le is nonloss decom#osa!leas in the second case$ it is said to !e in &iolation of 5NF. /he difference$ of course$ lay incertain semantic #ro#erties of the information !eing re#resented. /hese #ro#erties werenot understanda!le sim#ly !y loo%ing at the ta!le$ !ut had to !e su##lemented !yfurther information a!out the relationshi# !etween #roducts$ agents and com#anies.

  • 7/26/2019 5 NF

    4/5

    /he agent5Bm#any "#roduct> ta!le is e?ual to the oin of its

    three #roections is to hold true$ this is another way of saying that it an !e non"lossdecom#osed into its three #roections and is e?ui&alent to saying.

    F the tu#le >agent C$ com#any ;> a##ears in

    AN< the tu#le >agent C$ #roduct -> a##ears in 2

    AN< the tu#le >com#any ;$ #roduct -> a##ears in @

    /hen the row >agent C$ com#any ;$ #roduct -> must ha&e a##eared in >agent7com#any7#roduct>.

    f the reader cares to re"e3amine the #roections $ 2$ and @ from the two &ersions of> the ta!le which were illustrated earlier$ then$ it will !e seen that the earlier &ersionwhich was in 5NF does not confirm to the a!o&e rule$ whereas the later &ersion$ which&iolated

    5NF does.

    /he rule is referred to as a Doin. agent7com#any #roduct> can !e said tosatisfy the oin de#endency:

    ($ 2$ @)

    n the discussion of the other further normal forms use was made of the conce#ts offunctional and multi"&alued de#endencies. n dealing with 5NF the conce#t of oinde#endency has !een introduced (in a &ery informal way).

  • 7/26/2019 5 NF

    5/5

    5NF is defined by the statement

    A ta!le / is in fifth normal form if e&ery oin de#endency in / is a conse?uence only ofthe candidate %eys of /.

    /he second &ersion of the ta!le >agent7com#any #roduct> illustrated earlier &iolated

    5NF$ !ecause the oin de#endency (agent$ com#any$ #roduct7name) was not aconse?uence only of the #rimary %ey for the ta!le$ !ut also a conse?uence of the tu#leformation rule which was gi&en earlier$

    n the first$ e3am#le of >agent7com#an;Droduct> there was no a##lication of this rule$hence no oin de#endency other than that on the #rimary %ey. /hus$ the ta!le was in5NF.

    t can !e shown that if a ta!le is in 5NF$ then$ !ecause oin de#endencies are the

    >ultimate> form of de#endency$ it must also !e in 4NF and thus confirm to all the furthernormal forms. /he #ro!lem with this is that detecting oin de#endencies is$ in #ractice$&ery difficult. For this reason$ 5NF is largely of academic interest.