Third normal form

Third normal form (3NF) is a database schema design approach for relational databases which uses normalizing principles to reduce the duplication of data, avoid data anomalies, ensure referential integrity, and simplify data management. It was defined in 1971 by Edgar F. Codd, an English computer scientist who invented the relational model for database management.

A database relation (e.g. a database table) is said to meet third normal form standards if all the attributes (e.g. database columns) are functionally dependent on solely a key, except the case of functional dependency whose right hand side is a prime attribute (an attribute which is strictly included into some key). Codd defined this as a relation in second normal form where all non-prime attributes depend only on the candidate keys and do not have a transitive dependency on another key.[1]

A hypothetical example of a failure to meet third normal form would be a hospital database having a table of patients which included a column for the telephone number of their doctor. (The phone number is dependent on the doctor, rather than the patient, thus would be better stored in a table of doctors.) The negative outcome of such a design is that a doctor's number will be duplicated in the database if they have multiple patients, thus increasing both the chance of input error and the cost and risk of updating that number should it change (compared to a third normal form-compliant data model that only stores a doctor's number once on a doctor table).

Codd later realized that 3NF did not eliminate all undesirable data anomalies and developed a stronger version to address this in 1974, known as Boyce–Codd normal form.

Definition of third normal form

The third normal form (3NF) is a normal form used in database normalization. 3NF was originally defined by E. F. Codd in 1971.[2]

Codd's definition states that a table is in 3NF if and only if both of the following conditions hold:

A non-prime attribute of R is an attribute that does not belong to any candidate key of R.[3] A transitive dependency is a functional dependency in which XZ (X determines Z) indirectly, by virtue of XY and YZ (where it is not the case that YX).[4]

A 3NF definition that is equivalent to Codd's, but expressed differently, was given by Carlo Zaniolo in 1982. This definition states that a table is in 3NF if and only if for each of its functional dependencies XY, at least one of the following conditions holds:[5][6][need quotation to verify]

  • X contains Y (that is, Y is a subset of X, meaning XY is a trivial functional dependency),
  • X is a superkey,
  • every element of Y \ X, the set difference between Y and X, is a prime attribute (i.e., each attribute in Y \ X is contained in some candidate key).

To rephrase Zaniolo's definition more simply, the relation is in 3NF if and only if for every non-trivial functional dependency X → Y, X is a superkey or Y \ X consists of prime attributes. Zaniolo's definition gives a clear sense of the difference between 3NF and the more stringent Boyce–Codd normal form (BCNF). BCNF simply eliminates the third alternative ("Every element of Y \ X, the set difference between Y and X, is a prime attribute.").

"Nothing but the key"

An approximation of Codd's definition of 3NF, paralleling the traditional oath to give true evidence in a court of law, was given by Bill Kent: "[every] non-key [attribute] must provide a fact about the key, the whole key, and nothing but the key".[7] A common variation supplements this definition with the oath "so help me Codd".[8]

Requiring existence of "the key" ensures that the table is in 1NF; requiring that non-key attributes be dependent on "the whole key" ensures 2NF; further requiring that non-key attributes be dependent on "nothing but the key" ensures 3NF. While this phrase is a useful mnemonic, the fact that it only mentions a single key means it defines some necessary but not sufficient conditions to satisfy the 2nd and 3rd normal forms. Both 2NF and 3NF are concerned equally with all candidate keys of a table and not just any one key.

Chris Date refers to Kent's summary as "an intuitively attractive characterization" of 3NF and notes that with slight adaptation it may serve as a definition of the slightly stronger Boyce–Codd normal form: "Each attribute must represent a fact about the key, the whole key, and nothing but the key."[9] The 3NF version of the definition is weaker than Date's BCNF variation, as the former is concerned only with ensuring that non-key attributes are dependent on keys. Prime attributes (which are keys or parts of keys) must not be functionally dependent at all; they each represent a fact about the key in the sense of providing part or all of the key itself. (This rule applies only to functionally dependent attributes, as applying it to all attributes would implicitly prohibit composite candidate keys, since each part of any such key would violate the "whole key" clause.)

An example of a table that fails to meet the requirements of 3NF is:

Tournament winners
Tournament Year Winner Winner's date of birth
Indiana Invitational 1998 Al Fredrickson 21 July 1975
Cleveland Open 1999 Bob Albertson 28 September 1968
Des Moines Masters 1999 Al Fredrickson 21 July 1975
Indiana Invitational 1999 Chip Masterson 14 March 1977

Because each row in the table needs to tell us who won a particular Tournament in a particular Year, the composite key {Tournament, Year} is a minimal set of attributes guaranteed to uniquely identify a row. That is, {Tournament, Year} is a candidate key for the table.

The breach of 3NF occurs because the non-prime attribute (Winner's date of birth) is transitively dependent on the candidate key {Tournament, Year} through the non-prime attribute Winner. The fact that Winner's date of birth is functionally dependent on Winner makes the table vulnerable to logical inconsistencies, as there is nothing to stop the same person from being shown with different dates of birth on different records.

In order to express the same facts without violating 3NF, it is necessary to split the table into two:

Tournament winners
Tournament Year Winner
Indiana Invitational 1998 Al Fredrickson
Cleveland Open 1999 Bob Albertson
Des Moines Masters 1999 Al Fredrickson
Indiana Invitational 1999 Chip Masterson
Winner's dates of birth
Winner Date of birth
Chip Masterson 14 March 1977
Al Fredrickson 21 July 1975
Bob Albertson 28 September 1968

Update anomalies cannot occur in these tables, because unlike before, Winner is now a candidate key in the second table, thus allowing only one value for Date of birth for each Winner.

Computation

A relation can always be decomposed in third normal form, that is, the relation R is rewritten to projections R1, ..., Rn whose join is equal to the original relation. Further, this decomposition does not lose any functional dependency, in the sense that every functional dependency on R can be derived from the functional dependencies that hold on the projections R1, ..., Rn. What is more, such a decomposition can be computed in polynomial time.[10]

To decompose a relation into 3NF from 2NF, break the table into the canonical cover functional dependencies, then create a relation for every candidate key of the original relation which was not already a subset of a relation in the decomposition.[11]

Equivalence of the Codd and Zaniolo definitions of 3NF

The definition of 3NF offered by Carlo Zaniolo in 1982, and given above, can be shown to be equivalent to the Codd definition in the following way: Let X → A be a nontrivial FD (i.e. one where X does not contain A) and let A be a non-prime attribute. Also let Y be a candidate key of R. Then Y → X. Therefore, A is not transitively dependent on Y if there is a functional dependency X → Y iff X is a superkey of R.

Normalization beyond 3NF

Most 3NF tables are free of update, insertion, and deletion anomalies. Certain types of 3NF tables, rarely met with in practice, are affected by such anomalies; these are tables which either fall short of Boyce–Codd normal form (BCNF) or, if they meet BCNF, fall short of the higher normal forms 4NF or 5NF.

Considerations for use in reporting environments

While 3NF was ideal for machine processing, the segmented nature of the data model can be difficult to intuitively consume by a human user. Analytics via query, reporting, and dashboards were often facilitated by a different type of data model that provided pre-calculated analysis such as trend lines, period-to-date calculations (month-to-date, quarter-to-date, year-to-date), cumulative calculations, basic statistics (average, standard deviation, moving averages) and previous period comparisons (year ago, month ago, week ago) e.g. dimensional modeling and beyond dimensional modeling, flattening of stars via Hadoop and data science.[12][13] Hadley Wickham's "tidy data" framework is 3NF, with "the constraints framed in statistical language".[14]

See also

References

  1. ^ Codd, E. F. "Further Normalization of the Data Base Relational Model", p. 34.
  2. ^ Codd, E. F. "Further Normalization of the Data Base Relational Model". (Presented at Courant Computer Science Symposia Series 6, "Data Base Systems", New York City, May 24–25, 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.
  3. ^ Codd, p. 43.
  4. ^ Codd, p. 45–46.
  5. ^ Zaniolo, Carlo. "A New Normal Form for the Design of Relational Database Schemata". ACM Transactions on Database Systems 7(3), September 1982.
  6. ^ Abraham Silberschatz, Henry F. Korth, S. Sudarshan, Database System Concepts (5th edition), p. 276–277.
  7. ^ Kent, William. "A Simple Guide to Five Normal Forms in Relational Database Theory", Communications of the ACM 26 (2), Feb. 1983, pp. 120–125.
  8. ^ The author of a 1989 book on database management credits one of his students with coming up with the "so help me Codd" addendum. Diehr, George. Database Management (Scott, Foresman, 1989), p. 331.
  9. ^ Date, C. J. An Introduction to Database Systems (7th ed.) (Addison Wesley, 2000), p. 379.
  10. ^ Serge Abiteboul, Richard B. Hull, Victor Vianu: Foundations of Databases. Addison-Wesley, 1995. http://webdam.inria.fr/Alice/ ISBN 0201537710. Theorem 11.2.14.
  11. ^ Hammo, Bassam. "Decomposition, 3NF, BCNF" (PDF). Archived (PDF) from the original on 2023-03-15.
  12. ^ "Comparisons between Data Warehouse modelling techniques – Roelant Vos". Roelant Vos. 12 February 2013. Retrieved 5 March 2018.
  13. ^ "Hadoop Data Modeling Lessons | EMC". InFocus Blog | Dell EMC Services. 23 September 2014. Retrieved 5 March 2018.
  14. ^ Wickham, Hadley (2014-09-12). "Tidy Data". Journal of Statistical Software. 59: 1–23. doi:10.18637/jss.v059.i10. ISSN 1548-7660.

Further reading

Read other articles:

Pantai Kondang Merak Pantai Kondang Merak Informasi Lokasi Pantai Kondang Merak, Bantur, Kabupaten Malang, Jawa Timur Negara  Indonesia Biaya Rp.10.000 Jenis objek wisata Wisata pantai Fasilitas  • Pantai pasir putih • Rumah makan • Tempat sampah • Kamar bilas/Toilet • Mushola • Spot foto • Area Camping Pantai Kondang Merak adalah sebuah pantai di pesisir selatan yang secara administratif berada di Desa Sumberbening, Kecamatan Bantur, Kabu...

 

Hubungan akrab Jenis hubungan Duda · Istri · Janda · Keluarga · Kumpul kebo · Monogami · Nikah siri · Pacar lelaki · Pacar perempuan · Perkawinan · Poligami · Saudara · Sahabat · Selir · Suami · Wanita simpanan Peristiwa dalam hubungan Cinta · Ciuman · Kasih sayang · Pacaran · Persahabatan · Pernikahan · Perselingkuhan · Perceraian · Percumbuan · Perj...

 

Commune in Sud-Est, HaitiAnse-à-Pitres AnsapitCommuneAnse-à-PitresLocation in HaitiCoordinates: 18°3′0″N 71°45′0″W / 18.05000°N 71.75000°W / 18.05000; -71.75000CountryHaitiDepartmentSud-EstArrondissementBelle-AnseArea • Total479.6 km2 (185.19 sq mi)Elevation20 m (70 ft)Population (March, 2015)[1] • Total30,146 • Density163/km2 (420/sq mi) Anse-à-Pitres (Haitian Creole: Ansapit...

هذه المقالة يتيمة إذ تصل إليها مقالات أخرى قليلة جدًا. فضلًا، ساعد بإضافة وصلة إليها في مقالات متعلقة بها. (سبتمبر 2018) جوشوا قروس   معلومات شخصية الميلاد 25 يونيو 1982 (العمر 41 سنة) الطول 6 قدم 0 بوصة (1.83 م) مركز اللعب وسط الجنسية الولايات المتحدة  مسيرة الشباب سنوات ف...

 

Major branch of Protestantism Anglican Church redirects here. For other uses, see Anglican Church (disambiguation). Episcopalian redirects here. For the ecclesiastical governance structure, see Episcopal polity. For other uses, see Episcopal (disambiguation) and Episcopal Church (disambiguation). This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: ...

 

25th Chief of the Army Staff (India) GeneralDalbir Singh SuhagPVSM UYSM AVSM VSM ADCIndian High Commissioner to SeychellesIn office25 April 2019 – 22 September 2022PresidentRam Nath KovindPrime MinisterNarendra ModiPreceded byAusaf SayeedSucceeded byKartik Pande[1]25th Chief of the Army StaffIn office31 July 2014 – 31 December 2016PresidentPranab MukherjeePrime MinisterNarendra ModiPreceded byBikram SinghSucceeded byBipin Rawat Personal detailsBorn (1954-12-28) 2...

American economist Alvin HansenHansen in 1938Born(1887-08-23)August 23, 1887Viborg, South Dakota, USDiedJune 6, 1975(1975-06-06) (aged 87)Alexandria, Virginia, USAcademic careerInstitutionHarvard UniversityFieldMacroeconomics, political economicsSchool ortraditionNeo-Keynesian economicsAlma materUniversity of Wisconsin–MadisonYankton CollegeInfluencesJohn Maynard KeynesContributionsIS–LM model (Hicks–Hansen synthesis)Secular stagnation theory Part of a series onMacroecono...

 

Choerades marginata Klasifikasi ilmiah Kerajaan: Animalia Filum: Arthropoda Kelas: Insecta Ordo: Diptera Famili: Tipulidae Genus: Choerades Spesies: Choerades marginata Choerades marginata adalah spesies lalat yang tergolong famili Asilidae. Lalat ini juga merupakan bagian dari genus Choerades, ordo Diptera, kelas Insecta, filum Arthropoda, dan kingdom Animalia. Lalat ini mempunyai insting predator yang agresif dan makanannya utamanya adalah serangga lain. Referensi Bisby F.A., Roskov Y.R., O...

 

This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages) This article may need to be rewritten to comply with Wikipedia's quality standards. You can help. The talk page may contain suggestions. (March 2021) This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources...

هذه المقالة بحاجة لصندوق معلومات. فضلًا ساعد في تحسين هذه المقالة بإضافة صندوق معلومات مخصص إليها. الاحتراق الذاتي هو نوع من أنواع الاحتراق، والذي يحدث بسبب تسخين الجسم أو المادة نفسها ذاتياً، بحيث تزداد درجات الحرارة نتيجة حدوث تفاعلات كيميائية داخلية ناشرة للحرارة، يتلو

 

1971 studio album by Joe DassinJoe Dassin (Elle était… Oh !)Studio album by Joe DassinReleased1971 (1971)GenrechansonLabelCBS DisquesProducerJacques PlaitJoe Dassin chronology Joe Dassin (La Fleur aux dents)(1970) Joe Dassin (Elle était… Oh !)(1971) Joe(1972) Singles from Joe Dassin Elle était... Oh !Released: 1972 Bye Bye LouisReleased: 1972 Joe Dassin (commonly called Elle était… Oh ! after the first track on side 2) is the fifth French studio albu...

 

1967 Alpine Skiing competition 8th Vitranc Cup Giant slalom Date: 16 February 1969 Event: FIS World Cup Official list: 74 Ranked: 56 Course setter 1: Marjan Magušar (YUG) Course setter 2: R. Sulpice (FRA) Gates (1st run): 57 Gates (1st run): 56 Slalom Date: 17 February 1969 Event: FIS World Cup 8th Vitranc Cup was an alpine skiing competition, held from 16–17 February 1969 in Kranjska Gora, SR Slovenia, Yugoslavia. The event played host to two FIS World Cup events.[1] Official resu...

CBS Sports Radio station in Pasadena, Texas, United States For the airport serving Kankakee, Illinois assigned the ICAO code KIKK, see Greater Kankakee Airport. KIKKPasadena, TexasBroadcast areaGreater HoustonFrequency650 kHzBrandingThe Bet HoustonProgrammingLanguage(s)EnglishFormatSports gamblingAffiliationsBetQL NetworkCBS Sports RadioOwnershipOwnerAudacy, Inc.(Audacy License, LLC)Sister stationsKHMXKILTKILT-FMKKHHKLOLHistoryFirst air dateOctober 2, 1947; 76 years ago (194...

 

Radio station in Belleville, Ontario CIGL-FMBelleville, OntarioBroadcast areaBelleville-Quinte WestFrequency97.1 MHz (FM)BrandingMix 97ProgrammingFormatHot adult contemporaryAffiliationsCompass Media NetworksPremiere NetworksOwnershipOwnerQuinte BroadcastingSister stationsCJBQ, CJTN-FMHistoryFirst air dateAugust 1962Former call signsCJBQ-FM (1962-1978)Technical informationLicensing authorityCRTCClassBERP18,000 wattsHAAT121 meters (397 ft)LinksWebsitemix97.com CIGL-FM is a Canadian radio ...

 

American company Banfield Pet HospitalTypeSubsidiaryIndustryVeterinary ServicesFounded1955; 68 years ago (1955)Portland, Oregon, U.S.HeadquartersVancouver, Washington, U.S. 45°36′59″N 122°29′09″W / 45.616306°N 122.485809°W / 45.616306; -122.485809Key peopleMony Iyer, PresidentDaniel Aja Sr. Vice President and Chief Medical OfficerProductsVeterinary careRevenueUS$774.4 million[1]Number of employees14,000 (2014)[2]ParentMars ...

United States Navy admiral Peter A.GumataotaoBorn1958 (age 64–65)Guam, United StatesAllegiance United StatesService/branch United States NavyYears of service1981–2017Rank Rear admiralCommands held Naval Surface Force Atlantic Carrier Strike Group 11 United States Naval Forces Korea Destroyer Squadron 31 USS Curtis Wilbur (DDG-54) USS Decatur (DDG-73) Battles/wars Operation Enduring Freedom Awards Defense Superior Service Medal Legion of Merit Meritorious ...

 

Serbian actress Renata UlmanskiРената УлманскиRenata UlmanskiBorn (1929-11-29) 29 November 1929 (age 94)Zagreb, Kingdom of YugoslaviaNationalitySerbianOccupationActressYears active1955–presentSpouseMirko Tepavac Renata Ulmanski (Serbian Cyrillic: Рената Улмански: born 29 November 1929) is a Serbian actress.[1] She appeared in more than ninety films since 1955. Ulmanski was married to Serbian politician and writer Mirko Tepavac (1922–2014).[...

 

Church in Leeds, EnglandChurch of the EpiphanyParish Church of the Epiphany53°48′47″N 1°29′31″W / 53.81295°N 1.49187°W / 53.81295; -1.49187LocationGipton, LeedsCountryEnglandDenominationAnglicanHistoryStatusParish churchArchitectureArchitect(s)Nugent Cachemaille-DayGroundbreaking1936Completed1938AdministrationProvinceYorkDioceseLeedsArchdeaconryLeedsParishGipton The Church of the Epiphany (also known as the Bishop Burroughs Memorial Church of the Epiphany) ...

ألفية: ألفية 2 قرون: القرن 19 – القرن 20 – القرن 21 عقود: عقد 1950  عقد 1960  عقد 1970  – عقد 1980 –  عقد 1990  عقد 2000  عقد 2010 سنين: 1984 1985 1986 – 1987 – 1988 1989 1990 1987 في التقاويم الأخرىتقويم ميلادي1987MCMLXXXVIIتقويم هجري1407–1408تقويم هجري شمسي1365–1366تقويم أمازيغي2937من بداية روما274...

 

Japanese guitar brand GrecoProduct typeMusical instrumentsOwnerKanda Shokai Corp.CountryJapanIntroducedc. 1960; 63 years ago (1960) [1]Websitegreco.jp Greco (Japanese: グレコ Gureko) is a Japanese guitar brand owned by the Kanda Shokai Corporation (in Japanese) 神田商会, a musical instrument wholesaler mostly known for being part of Fender Japan. Instruments manufactured with the name Greco are electric and acoustic guitars. History Kanda Shokai was establishe...

 

Strategi Solo vs Squad di Free Fire: Cara Menang Mudah!