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 form | Condition added | Anomaly it removes |
|---|---|---|
| First normal form | Atomic values, no repeating groups | Ambiguous multi-valued cells |
| Second normal form | No partial dependency on part of a composite key | Redundancy tied to key fragments |
| Third normal form | No transitive dependency of non-key attributes | Redundancy through intermediate attributes |
| Boyce–Codd normal form | Every determinant is a superkey | Rare anomalies with overlapping candidate keys |
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.
| Anomaly | Example in an employee table with department names | Outcome without 3NF |
|---|---|---|
| Update anomaly | Renaming a department requires changing every employee row | Inconsistent names if one row is missed |
| Insertion anomaly | A new department without staff cannot be recorded | Placeholder rows or missing data |
| Deletion anomaly | Removing the last employee deletes the department name | Unintended loss of a fact |
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.
- List the functional dependencies observed in the business rules, such as order_id → customer_id and customer_id → customer_city.
- Identify candidate keys and confirm that the table is already in second normal form.
- Find transitive chains in which a non-key attribute determines another non-key attribute.
- Extract each determinant with its dependent attributes into a new table whose key is that determinant.
- 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.
| Situation | Recommended design | Reason |
|---|---|---|
| Operational order system | 3NF | Frequent writes need a single source of each fact |
| Overlapping composite candidate keys | Boyce–Codd normal form | Removes anomalies that 3NF still allows |
| Data warehouse reporting | Star schema with denormalized dimension tables | Fewer joins and faster aggregation |
| Enterprise integration layer | 3NF or Data Vault modeling | Auditable history and stable structures |
| Read-heavy cache or search index | Deliberate denormalization | Precomputed values avoid joins at query time |
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.