Skip to content

Normalization

In one line

Normalization is the process of structuring tables to minimize data duplication and avoid update anomalies.

In simple words

Normalization is the process of organizing your tables to reduce redundant data and avoid "anomalies" — problems that arise when you insert, update, or delete duplicated data.

There are several "normal forms" (1NF, 2NF, 3NF, BCNF, etc.), each stricter than the last. In practice, 3NF is the most common target:

  • 1NF: Each column holds a single value (no lists in a cell).
  • 2NF: 1NF plus no partial dependency on a composite key.
  • 3NF: 2NF plus no transitive dependency (non-key columns depend only on the key).

For example, instead of storing a user's city and country in every order row, you normalize by creating a locations table and referencing it — the city and country are stored once.

The trade-off: normalized data avoids redundancy but may require more joins to query. Sometimes you deliberately denormalize for read performance.

Example

sql
-- Before normalization: redundant data
CREATE TABLE orders_bad (
  id INTEGER, user_name TEXT, user_city TEXT, total NUMERIC
);

-- After normalization: data stored once
CREATE TABLE users (id SERIAL PRIMARY KEY, name TEXT, city_id INTEGER);
CREATE TABLE cities (id SERIAL PRIMARY KEY, name TEXT);
CREATE TABLE orders (id SERIAL PRIMARY KEY, user_id INTEGER, total NUMERIC);

Normalization moves user and city data into separate tables, referenced by foreign keys.

Related terms

Related Resources

Related Lessons

Decode error messages

Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.

View errors

← Back to glossary