[{"@context":"http:\/\/schema.org\/","@type":"BlogPosting","@id":"https:\/\/wiki.edu.vn\/en\/wiki21\/second-normal-form-wikipedia\/#BlogPosting","mainEntityOfPage":"https:\/\/wiki.edu.vn\/en\/wiki21\/second-normal-form-wikipedia\/","headline":"Second normal form – Wikipedia","name":"Second normal form – Wikipedia","description":"before-content-x4 From Wikipedia, the free encyclopedia after-content-x4 Term in database normalization Second normal form (2NF) is a normal form used","datePublished":"2016-10-14","dateModified":"2016-10-14","author":{"@type":"Person","@id":"https:\/\/wiki.edu.vn\/en\/wiki21\/author\/lordneo\/#Person","name":"lordneo","url":"https:\/\/wiki.edu.vn\/en\/wiki21\/author\/lordneo\/","image":{"@type":"ImageObject","@id":"https:\/\/secure.gravatar.com\/avatar\/c9645c498c9701c88b89b8537773dd7c?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c9645c498c9701c88b89b8537773dd7c?s=96&d=mm&r=g","height":96,"width":96}},"publisher":{"@type":"Organization","name":"Enzyklop\u00e4die","logo":{"@type":"ImageObject","@id":"https:\/\/wiki.edu.vn\/wiki4\/wp-content\/uploads\/2023\/08\/download.jpg","url":"https:\/\/wiki.edu.vn\/wiki4\/wp-content\/uploads\/2023\/08\/download.jpg","width":600,"height":60}},"image":{"@type":"ImageObject","@id":"https:\/\/en.wikipedia.org\/wiki\/Special:CentralAutoLogin\/start?type=1x1","url":"https:\/\/en.wikipedia.org\/wiki\/Special:CentralAutoLogin\/start?type=1x1","height":"1","width":"1"},"url":"https:\/\/wiki.edu.vn\/en\/wiki21\/second-normal-form-wikipedia\/","wordCount":1190,"articleBody":" (adsbygoogle = window.adsbygoogle || []).push({});before-content-x4From Wikipedia, the free encyclopedia (adsbygoogle = window.adsbygoogle || []).push({});after-content-x4Term in database normalizationSecond normal form (2NF) is a normal form used in database normalization. 2NF was originally defined by E.\u00a0F. Codd in 1971.[1] (adsbygoogle = window.adsbygoogle || []).push({});after-content-x4A relation is in the ‘second normal form if it fulfills the following two requirements:It is in first normal form.It does not have any non-prime attribute that is functionally dependent on any proper subset of any candidate key of the relation (i.e. it lacks partial dependencies). A non-prime attribute of a relation is an attribute that is not a part of any candidate key of the relation.Put simply, a relation is in 2NF if it is in 1NF and every non-prime attribute of the relation is dependent on the whole of every candidate key. Note that it does not put any restriction on the non-prime to non-prime attribute dependency. That is addressed in third normal form.Table of Contents (adsbygoogle = window.adsbygoogle || []).push({});after-content-x42NF and candidate keys[edit]How to decompose into 2NF[edit]Example[edit]See also[edit]References[edit]Further reading[edit]External links[edit]2NF and candidate keys[edit]A functional dependency on a proper subset of any candidate key is a violation of 2NF. In addition to the primary key, the relation may contain other candidate keys; it is necessary to establish that no non-prime attributes have part-key dependencies on any of these candidate keys.How to decompose into 2NF[edit]To make a 1NF relation a 2NF relation, remove the functionally dependent attributes in the partial dependencies of the first normal form relation, and place those partial dependency dependent attributes in a relation where their corresponding determinant attributes are an entire candidate key.Example[edit]The following relation does not satisfy 2NF because:{Manufacturer country} is functionally dependent on {Manufacturer}.{Manufacturer country} is not part of a candidate key, so it is a non-prime attribute. (It is assumed that it is possible for two manufacturers in the same country to make a toothbrush with the same model name, so {Manufacturer country, Model} is not a candidate key even though in the current table the pair uniquely identify rows.){Manufacturer} is a proper subset of the {Manufacturer, Model} candidate key.In other words, since {Manufacturer country} is a non-prime attribute functionally dependent on a proper subset of a candidate key, the relation is in violation of 2NF.Electric toothbrush modelsManufacturerModelManufacturer countryForteX-PrimeItalyForteUltracleanItalyDent-o-FreshEZbrushUSABrushmasterSuperBrushUSAKobayashiST-60JapanHochToothmasterGermanyHochX-PrimeGermanyTo make the design conform to 2NF, it is necessary to have two relations. To create these relations:Remove the functionally dependent attributes in the partial dependencies of the first normal form relation. In this example, {Manufacturer country} is the functionally dependent attribute which will be removed.Place those partial dependency dependent attributes (i.e. {Manufacturer country}) in a relation where their corresponding determinant attributes are a candidate key (i.e. {Manufacturer}).As seen below, {Manufacturer country} is removed from the original table:Electric toothbrush modelsManufacturerModelForteX-PrimeForteUltracleanDent-o-FreshEZbrushBrushmasterSuperBrushKobayashiST-60HochToothmasterHochX-PrimeAs seen below, the partial dependency is put into a new relation where the dependency can exist without being a partial dependency:Electric toothbrush manufacturersManufacturerManufacturer countryForteItalyDent-o-FreshUSABrushmasterUSAKobayashiJapanHochGermanySee also[edit]References[edit]^ Codd, E.\u00a0F. “Further Normalization of the Data Base Relational Model”. (Presented at Courant Computer Science Symposia Series 6, “Data Base Systems”, New York City, May 24\u201325, 1971.) IBM Research Report RJ909 (August 31, 1971). Republished in Randall J. Rustin (ed.), Data Base Systems: Courant Computer Science Symposia Series 6. Prentice-Hall, 1972.Further reading[edit]External links[edit] (adsbygoogle = window.adsbygoogle || []).push({});after-content-x4"},{"@context":"http:\/\/schema.org\/","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"item":{"@id":"https:\/\/wiki.edu.vn\/en\/wiki21\/#breadcrumbitem","name":"Enzyklop\u00e4die"}},{"@type":"ListItem","position":2,"item":{"@id":"https:\/\/wiki.edu.vn\/en\/wiki21\/second-normal-form-wikipedia\/#breadcrumbitem","name":"Second normal form – Wikipedia"}}]}]