ENES

Database normalization

Organizing tables so each fact is stored in exactly one place.

One wide table repeating a customer's address on every order is split into a customers table and an orders table linked by a customer id

Database normalization is a way of designing the tables of a relational database so that each piece of information lives in one place only. Imagine an orders table where every row repeats the customer's name, email and address. If the customer moves, you must update fifty rows, and if you miss one, the database now disagrees with itself.

Normalizing splits that table in two: a customers table with each customer once, and an orders table that only stores the customer's id, a foreign key pointing to the customers table. To see orders with addresses, you join them back in a query. The rules for how far to split are called normal forms; in practice most designs aim for the third normal form (3NF), which roughly means every column depends on the row's key and nothing else.

Normalization suits systems that write a lot, like a shop's order system, because each update touches one row and data stays consistent. Analytics goes the other way: data warehouses often denormalize on purpose, repeating data into wide tables or a star schema so reports need fewer joins and run faster. Both are deliberate choices, not right and wrong.

Keep in mind

Go deeper

Related terms

More in Data