liveBook · Manning

Database normalization

As explained in 100 SQL Server Mistakes and How to Avoid Them

Database normalization is the relational database design process of structuring tables to reduce redundant data and dependency anomalies.

Database normalization is a formal process for structuring relational tables so that each fact is stored once, values are meaningful on their own, and dependencies do not create unnecessary duplication. It replaces a design-by-judgment approach with rules that make a schema easier to maintain and more efficient to query. section 4.1 section 4.1.3

The tempting mistake is to put all available sales, customer, product, supplier, and delivery details into a few broad tables. That design appears convenient, but repeated category, sales-area, and contact data increases table size, memory use, and index cost. More importantly, one business change can require updates to many rows, creating inconsistent data when any update is missed. section 4.0 section 4.1.2

Normalize a schema methodically rather than splitting tables at random:

  • Start with first normal form (1NF): use atomic, uniquely named attributes; move repeating groups into separate entities; do not rely on attribute or row order. section 4.1.3
  • Apply second normal form (2NF): when a table has a composite primary key, move attributes that do not depend on the whole key into another entity. section 4.1.3
  • Apply third normal form (3NF): move attributes that depend on non-key attributes into separate entities, then relate the entities with primary and foreign keys. section 4.1.3 section 4.1.2
  • Validate the result with an entity relationship diagram (ERD), showing entities, attributes, keys, and relationships. section 4.1 section 4.4

Separating repeated sales-area details

If every sales order stores SalesAreaName and SalesAreaManager, the same area details repeat across orders. Put sales-area details in a Sales Areas entity, retain its key in Sales as a foreign key, and update the manager in one place. The same pattern applies when product categories and subcategories were combined: split them so category details are not copied for every subcategory. section 4.1.2 section 4.1.3

Figure 4.5 ERD from normalized design

Use the ERD to inspect whether the normalized entities are connected through explicit primary and foreign keys rather than duplicated descriptive values. section 4.1.3

Do not treat normalization as an absolute rule to maximize table count. Most designs need not go beyond 3NF, and overnormalization can introduce problems. Intentional denormalization can be appropriate for JSON addresses, analytical data, or staging tables, but it should be a conscious exception after understanding the data and business rules. section 4.1.2 section 4.1.3

A safer final check is simple: keep values atomic, store each business fact in the entity it describes, use foreign keys for related tables, and confirm that a change to a category, contact, or area has one authoritative update location. section 4.1.2 section 4.4

How 100 SQL Server Mistakes and How to Avoid Them covers it

How deep it goes
Explains 1NF through 3NF with dependency rules and ERD validation, while deferring higher normal forms beyond practical need.
Examples
Uses MagicChoc sales, product-category, sales-area, supplier-contact, and normalized ERD examples.
What it assumes
Starts from practical business attributes and teaches normalization rules without assuming deep DBA expertise.
What you can do after
Apply it by modeling data through 1NF, 2NF, and 3NF, then validating entities and key relationships with an ERD.
How it connects
Connects atomic values, primary keys, foreign keys, entity relationship diagrams, data generalization, and denormalization.

Also explained in

Compare how 2 books explain database normalization →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of 100 SQL Server Mistakes and How to Avoid Them. The section links point to the parts of the book it draws on.