ArticleslgStudy

science

Third normal form

Third normal form is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Third normal form rather than just read about it. In short: Third normal form (3NF) is a level of database normalization defined by English computer scientist Edgar F. Codd.

Key takeaways

  • Third normal form belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Third normal form to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Third normal form from memory before moving on to harder problems.

Reference excerpt

Third normal form (3NF) is a level of database normalization defined by English computer scientist Edgar F. Codd. A relation (or table, in SQL) is in third normal form if it is in second normal form and also lacks non-key dependencies, meaning that no non-prime attribute is functionally dependent on (that is, contains a fact about) any other non-prime attribute. In other words, each non-prime attribute must depend solely and non-transitively on each candidate key. William Kent summarised 3NF with the dictum that "a non-key field must provide a fact about the key, the whole key, and nothing but the key". An example of a violation of 3NF would be a Patient relation with the attributes PatientID, DoctorID and DoctorName, in which DoctorName would depend first and foremost on DoctorID and only transitively on the key, PatientID (via DoctorID's dependency on PatientID). Such a design would cause a doctor's name to be redundantly duplicated across each of their patients. A database compliant with 3NF would store doctors' names in a separate Doctor relation which Patient could reference via a foreign key. 3NF was defined, along with 2NF (which forbids dependencies on proper subsets of composite keys), in Codd's paper "Further Normalization of the Data Base Relational Model" in 1971, which came after 1NF's definition in "A Relational Model of Data for Large Shared Data Banks" in 1970. 3NF was itself followed by the definition of Boyce–Codd normal form in 1974, which seeks to prevent anomalies possible in relations with several overlapping composite keys.

Definition of third normal form Codd's definition states that a relation R is in 3NF if and only if it is in second normal form (2NF) and every non-prime attribute of R is non-transitively dependent on each candidate key. A non-prime attribute of R is an attribute that does not belong to any candidate key of R. Codd defines a transitive dependency of an attribute set Z on an attribute set X as a functional dependency chain X → Y → Z that must be satisfied for some attribute set Y, where it is not the case that Y → X, and all three sets must be disjoint. 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 X → Y, at least one of the following conditions holds:

X contains Y (that is, Y is a subset of X, meaning X → Y 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."). The definition offered by Zaniolo can be shown to be equivalent to the Codd definition in the following way (the trivial case is by default same statements): let X → A be a nontrivial functional dependency (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. Further since A is a non-prime attribute, therefore A cannot determine X (A → X not possible) because in that case some AM would form the candidate key (where M = Y \ A (or simply Y, since A is non-prime and thus not an element of Y)). Therefore, A is not transitively dependent on Y (X is not prime attribute as per 2NF but both Y and X can be non-primes if we do not follow the Codd's definition for 3NF. If we follow Codd's definition Y is candidate key and we are showing that following that definition is equivalent to following Zaniolo's definition) if and only if there is a functional dependency X → Y (simply reversing one of the dependency to avoid transitivity), i.e., if and only if X is a candidate key of R in case R consists only these two dependencies otherwise X is a prime attribute, but the second case violates 2NF. So, for a dependency Y → X, X and Y are candidate keys or at least Y is a candidate key, then the relation is in 3NF as per Codd (this is the 2. condition of Zaniolo's definition). The only other way to follow the definition of Codd for 3NF is not to consider any non-prime being dependent, that is to make every such A only a prime attribute i.e. there shouldn't be a non-prime attribute that depends on another non-prime attribute (2NF allows dependency on candidate key or non-prime attribute) that may lead to transitivity (in short avoid non-prime to non-prime dependency). By allowing such dependencies where right hand side is only primes we follow Codd's third normal form as well as third condition of Zaniolo's definition. It is to be noted that either or each of A, X and Y can be single attributes or a combination thereof but are necessarily disjoint. One can write X → Y equivalently as X → XY and one may thus observe the Zaniolo equivalence for Codd by performing the set difference between the dependent and the determinant. In short, Zaniolo points to a loophole more clearly than the transitive definition. 3NF gives a massive "escape clause" (loophole) to the RHS. One interesting point here is before 3NF we were bothered about LHS and even in BCNF we are bothered about that. For a dependency (X → Y) to pass 3NF, even if X is not a Super Key / Candidate Key the following conditions must be true:

Y is a Prime Attribute (RHS loophole)

Example

Design which violates 3NF The following relation, with the composite key {Name, Year}, fails to meet the requirements of 3NF. The non-prime attributes WinnerName and WinnerBirthdate are only transitively dependent on the composite key via their dependence on the non-prime attribute WinnerID. This creates redundancy and the potential for inconsistency in the case that a winner of multiple tournaments is accidentally given different dates of birth in different tuples.

Design which complies with 3NF To bring the relation into compliance with 3NF, WinnerID, WinnerName and WinnerBirthdate can be transferred to a separate table.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Third normal form

Start with the simplest possible case. Write down what Third normal form claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Third normal form before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Third normal form ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Third normal form

In research
Third normal form appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Third normal form in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Third normal form is common in secondary-school and first-year university syllabi. It links to neighbouring topics Database normalization, so understanding it makes those chapters shorter.
In everyday life
Look for Third normal form outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Third normal form” →

How to study Third normal form in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Third normal form means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Third normal form out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Third normal form in simple terms?

Third normal form (3NF) is a level of database normalization defined by English computer scientist Edgar F. Codd.

Why does Third normal form matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Third normal form?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Third normal form.

Tags

  • Database normalization

Keep exploring