Database Designers and DBAs

What is the role of normalization in database design?

Normalization splits tables so each fact is stored once, cutting repeated data and update errors. Learn the first three normal forms and when to bend them.

On this page
  1. Short answer
  2. The problems normalization prevents
  3. The first three normal forms
  4. The normalized version
  5. When to bend the rules
  6. Where normalization fits

Short answer

Normalization is the process of organizing tables and columns so that each fact is stored in one place. In database design, its role is to cut repeated data and prevent the update, insert and delete problems that repeated data causes. Designers usually apply it during logical design, before the physical tables are built.

The problems normalization prevents

Consider one orders table that records customer and product details on every row:

order_id customer_name customer_city product_name product_price quantity
1001 Alex Kim Denver Desk lamp 25.00 1
1002 Alex Kim Denver Desk lamp 25.00 2
1003 Priya Shah Austin Notebook 4.50 3

This design causes three problems:

  • Update problem. If Alex Kim moves to Boston, every row that holds the old city must change. Miss one, and the database contradicts itself.
  • Insert problem. A new customer cannot be recorded until they place an order, because their details exist only on order rows.
  • Delete problem. Deleting order 1003 also deletes the only record of Priya Shah’s city.

The first three normal forms

Each normal form is a rule, and each one builds on the one before it.

First normal form (1NF) requires that each column hold a single value, with no repeating groups such as product_1, product_2 and product_3 columns. Each row is identified by a primary key.

Second normal form (2NF) requires that every non-key column depend on the whole key. In a table keyed by order and product, the product’s name and price depend on the product alone, so they belong in a products table.

Third normal form (3NF) requires that non-key columns depend only on the key, not on other non-key columns. The customer’s city depends on the customer, not on the order, so it belongs in a customers table.

Boyce-Codd normal form (BCNF) is a stricter version of third normal form that handles some edge cases. Fourth and fifth normal forms deal with less common dependencies and are rarely needed in practice. Microsoft’s guidance on normalization describes third normal form as the highest level needed for most applications.

The normalized version

Splitting the orders table gives four tables:

  • Customers: customer_id, customer_name, customer_city
  • Products: product_id, product_name, product_price
  • Orders: order_id, customer_id
  • Order_items: order_id, product_id, quantity

Now a city is stored once, so a change is a single update. A customer can exist before placing an order, and deleting an order no longer deletes the customer.

The split only works if each table has a key. Readers new to keys can start with “What is a PK and FK?”

Real designs sometimes keep the price on each order item on purpose. The price at the time of sale is a fact about that sale, not about the product today, so keeping a copy there is a deliberate choice rather than a normalization error.

When to bend the rules

Normalization has costs:

  • Many small tables mean more joins, and joins can slow queries. Microsoft’s guidance warns that many small tables may degrade performance.
  • Reporting and analytics systems often store repeated data on purpose, because queries run faster and are simpler when the data is combined ahead of time. Data warehouses commonly use denormalized star schemas for this reason.
  • Each deliberate exception should be documented, and the application should keep the repeated copies consistent.

Where normalization fits

Normalization belongs to logical design. The designer has the entities and relationships in hand and checks each table against the rules. For the wider job, see the role of database designer in dbms.

The complete guide to database designers and dbas

The Role of the Database Designer in DBMS
Read the guide

Keep exploring

Guides from other topics

All topics →