Skip to main content

Database Normalization

Updated 2 min read

Share this page

Send the link, quote the definition with a link back, or show it as a card on your own site.

https://softwaredictionary.org/terms/normalization

In short

Database normalization is the process of organizing tables so each fact is stored only once, reducing duplicate data and preventing inconsistent updates.

What is database normalization?

Normalization is a way of designing a relational database so that every piece of information lives in exactly one place. Instead of repeating a customer's address on every order row, you store customers in one table and orders in another and link them with a foreign key. The idea was introduced in the early 1970s by Edgar F. Codd, the inventor of the relational model.

The process is described as a series of normal forms, each building on the last. First normal form (1NF) requires each column to hold a single value, with no lists packed into one cell; second normal form (2NF) requires every non-key column to depend on the whole primary key, not just part of it; and third normal form (3NF) requires non-key columns to depend only on the key, not on other non-key columns. Stricter forms such as Boyce-Codd normal form (BCNF) exist, but 3NF is the usual practical goal.

Normalization prevents so-called update anomalies. If a customer's email is copied onto 500 order rows, changing it means updating 500 rows, and missing one leaves the data contradicting itself. It is like keeping one shared contact list instead of writing a friend's phone number in dozens of notebooks: when the number changes, you update it once.

Normalization is often weighed against denormalization, which deliberately duplicates some data to make reads faster by avoiding joins, a common choice in reporting systems, caches, and many NoSQL designs. The usual advice is to normalize first for correctness, then denormalize specific spots only when measurements show a real performance need. Database normalization is also unrelated to normalizing data in machine learning, which means scaling numbers into a common range.

Key takeaways

  • Normalization stores each fact once to avoid duplicate and contradictory data.
  • Tables are linked with primary and foreign keys instead of copying data.
  • The normal forms 1NF, 2NF, and 3NF are progressively stricter rules.
  • Third normal form is the usual target for application databases.
  • Denormalization trades some duplication for faster reads when needed.

Example

Splitting repeated data into separate tablessql
-- Not normalized: customer details repeat on every order
-- orders(id, customer_name, customer_email, total)

-- Normalized: each customer is stored once and referenced by ID
CREATE TABLE customers (
  id    BIGINT PRIMARY KEY,
  name  TEXT NOT NULL,
  email TEXT NOT NULL UNIQUE
);

CREATE TABLE orders (
  id          BIGINT PRIMARY KEY,
  customer_id BIGINT NOT NULL REFERENCES customers (id),
  total       NUMERIC(10, 2) NOT NULL
);

Readers ask

What are 1NF, 2NF, and 3NF?

They are the first three normal forms. 1NF requires a single value in each column, 2NF removes columns that depend on only part of a composite key, and 3NF removes columns that depend on other non-key columns instead of on the key.

What is denormalization?

Denormalization is intentionally adding duplicate or precomputed data to a database to make reads faster, at the cost of more storage and extra work to keep the copies in sync.

Should every database be fully normalized?

Not necessarily. Most transactional application databases aim for third normal form, while analytics warehouses and read-heavy systems often denormalize on purpose to speed up queries.

See also

Spotted a mistake or something missing on this page?Suggest an edit

Read a random page
Open today's review
Switch to the dark theme
Read this page in Türkçe

More

Settings