Schema design basics

SQL Data Modeling and Normalization for Cleaner Systems

Design normalized SQL tables that reduce duplication and update errors, while keeping analytics and application queries understandable as business requirements evolve.

How this page is maintained

Written for learners, checked against the sources below, and reviewed every year. Last reviewed July 22, 2026.

Short answer

Normalization organizes data into related tables so each fact is stored once and linked by keys. This reduces anomalies and keeps updates consistent across operational workflows.

  • Separate entities such as customers, products, and orders into distinct tables.
  • Use primary and foreign keys to enforce relationships.
  • Balance normalization with query patterns and reporting needs.

Why normalization matters in operations

Northstar initially kept order and customer details in one wide table. Address changes and customer segment updates caused conflicting values across rows.

Splitting into customers, orders, and order_items reduced duplication and made updates safer because each business fact had one home.

Apply normal forms pragmatically

First normal form removes repeating groups, second normal form removes partial dependency on composite keys, and third normal form removes transitive dependency. These rules help detect risky table designs.

In analytics layers, selective denormalization can be useful, but operational source tables should stay clean first.

  • Define natural versus surrogate keys intentionally.
  • Use constraints to enforce data quality at write time.
  • Document relationship cardinality for future developers.

Refactor duplicated customer attributes

Order rows repeated customer_email and customer_segment, causing inconsistent updates across historical records.

  1. Create customers table with customer_id as primary key and one row per customer.
  2. Move customer attributes to customers and keep customer_id on orders as foreign key.
  3. Validate no orphan orders remain and update downstream joins.
Result: Customer attributes are stored once, update anomalies drop, and order history remains linked through stable keys.

Common mistakes

  • Embedding repeated customer fields in every transaction row.
  • Skipping foreign key constraints and relying on application code alone.
  • Over-normalizing small lookup data without practical benefit.
  • Changing key definitions without migration and backfill planning.

Try one

What problem does normalization primarily prevent in transactional systems?

It prevents duplicate fact storage that leads to inconsistent updates, inserts, and deletes across related records.

Sources

Learn this with a tutor

Tell LearnLive what you already know and what you need to do with data modeling.

Build this course