Third normal form

Also known as: 3NF

On this page 7

Third normal form (3NF) is a level of relational database normalization in which a table is already in second normal form and no non-key attribute depends transitively on the primary key. In data modeling, 3NF is the most common target for operational schemas because it eliminates most update, insertion and deletion anomalies while keeping the number of tables manageable.

The rule was defined by Edgar F. Codd in 1971 as part of the normalization theory for the relational model. A widely quoted summary says that every non-key attribute must depend on the key, the whole key and nothing but the key, where the last clause expresses the specific requirement of third normal form.

The formal definition of 3NF

A relation is in 3NF when, for every non-trivial functional dependency X → A that holds in it, either X is a superkey or A is a prime attribute, meaning A belongs to at least one candidate key. This formulation, refined by Carlo Zaniolo, is equivalent to Codd’s original wording and is the version used in textbooks and design tools.

The informal version focuses on the transitive dependency. If the key determines attribute B, and B in turn determines attribute C, then C depends on the key only through B. In a table of employees, department_id determines department_name, so storing department_name next to each employee violates 3NF.

The table below shows how 3NF fits into the sequence of normal forms, each adding one condition to the previous level.

Normal formCondition addedAnomaly it removes
First normal formAtomic values, no repeating groupsAmbiguous multi-valued cells
Second normal formNo partial dependency on part of a composite keyRedundancy tied to key fragments
Third normal formNo transitive dependency of non-key attributesRedundancy through intermediate attributes
Boyce–Codd normal formEvery determinant is a superkeyRare anomalies with overlapping candidate keys
Normal forms up to Boyce–Codd normal form

Anomalies that 3NF prevents

A table that violates 3NF stores the same fact many times, and redundancy causes three classic anomalies. Each one appears when the same information about a dependent attribute must be kept consistent across many rows.

AnomalyExample in an employee table with department namesOutcome without 3NF
Update anomalyRenaming a department requires changing every employee rowInconsistent names if one row is missed
Insertion anomalyA new department without staff cannot be recordedPlaceholder rows or missing data
Deletion anomalyRemoving the last employee deletes the department nameUnintended loss of a fact
Anomalies caused by a transitive dependency

Moving department_name into a separate department table, referenced by a foreign key, removes all three anomalies at once. Each fact now lives in exactly one place, and referential integrity constraints keep the two tables aligned.

Decomposing a table into 3NF

Reaching 3NF follows a repeatable decomposition procedure driven by the functional dependencies of the data, not by the column names. The goal is a lossless decomposition that also preserves every dependency, which 3NF can always guarantee.

  1. List the functional dependencies observed in the business rules, such as order_id → customer_id and customer_id → customer_city.
  2. Identify candidate keys and confirm that the table is already in second normal form.
  3. Find transitive chains in which a non-key attribute determines another non-key attribute.
  4. Extract each determinant with its dependent attributes into a new table whose key is that determinant.
  5. Keep the determinant as a foreign key in the original table and verify that joining the tables reproduces the original rows.

The 3NF synthesis algorithm formalizes these steps: it computes a minimal cover of the dependencies and creates one relation per group. Unlike decomposition into Boyce–Codd normal form, this algorithm is guaranteed to be both lossless and dependency-preserving.

When to stop at 3NF and when to denormalize

For most transactional OLTP schemas, 3NF is the practical endpoint: it removes almost all redundancy, and the remaining cases handled by higher forms are uncommon. Analytical systems often choose differently, because their priorities are read speed and simple queries rather than write integrity.

SituationRecommended designReason
Operational order system3NFFrequent writes need a single source of each fact
Overlapping composite candidate keysBoyce–Codd normal formRemoves anomalies that 3NF still allows
Data warehouse reportingStar schema with denormalized dimension tablesFewer joins and faster aggregation
Enterprise integration layer3NF or Data Vault modelingAuditable history and stable structures
Read-heavy cache or search indexDeliberate denormalizationPrecomputed values avoid joins at query time
Choosing a normalization target by workload

Denormalization should be a deliberate decision made after a 3NF model exists, not a substitute for designing one. Teams that start from a normalized model know exactly which redundancies they introduce and can protect them with triggers, materialized views or batch reconciliation.

Common mistakes with third normal form

  • Treating derived values as harmless: storing order_total next to the order lines is a transitive dependency unless it is explicitly managed as a denormalized cache.
  • Confusing surrogate keys with normalization: adding an identity column does not remove a dependency such as zip_code → city.
  • Splitting tables by column names instead of dependencies: normalization follows business rules, so the same columns can be in 3NF in one domain and not in another.
  • Assuming 3NF equals Boyce–Codd normal form: the two differ when candidate keys overlap, although such cases are rare in practice.

Stripped to the essentials

Third normal form is a tidiness rule for database tables. Each piece of information should be stored in only one place, and each table should describe only one kind of thing.

If a list of employees also repeats the name of each department, renaming a department means fixing hundreds of rows. Under 3NF, department names live in their own small table, and employees just point to it. One change, one place, and the data cannot contradict itself.

Where it is applied

A regional clinic network builds a patient appointment system whose first prototype keeps everything in one appointments table: patient name, patient phone, doctor name, doctor specialty and clinic address. Within weeks, staff notice that a doctor appears with two different specialties and that clinic addresses are spelled three ways.

The data architect lists the dependencies and finds two transitive chains: doctor_id determines specialty, and clinic_id determines address. The model is decomposed into patients, doctors, clinics and appointments tables, with appointments holding only foreign keys, a timestamp and a status.

After migration, a change of address is a single-row update in the clinics table, duplicate spellings disappear, and the reporting team builds a separate denormalized view for monthly utilization dashboards without touching the normalized core.