Database Normalization: A Complete Guide and Step-by-Step Examples

Last update: 30 June, 2025
  • Database normalization organizes and optimizes information to eliminate redundancies and ensure integrity.
  • The process is performed using normal forms (1NF, 2NF, 3NF, etc.), each with stricter rules.
  • Applied properly, normalization facilitates the maintenance, performance, and growth of any relational database.

Example of database normalization

Efficient data management is a fundamental pillar of any digital organization. If you've ever struggled with tables full of duplicate, inconsistent, or difficult-to-relate data, you've probably wondered how to avoid these problems. This is where database normalization comes in, a technique that, while it may sound academic, has a direct and practical impact on the day-to-day operations of any company.

Normalizing a database isn't just about following a trend or a technical guideline: it's about designing databases that are easy to maintain, robust against changes, and capable of scaling without becoming a nightmare. In this article, we'll delve into everything you need to know about normalization: what it is, its objectives, the steps involved, and practical examples so that, by the end of this article, you'll have a clear understanding of how to apply it to your own projects.

What is database normalization?

Database normalization is a structured process that reorganizes information into different tables and relationships to eliminate redundancies, avoid inconsistencies, and ensure the integrity of the stored data. This technique is based on applying a series of rules known as "normal forms" that, step by step, transform a large, disorganized table into a set of small, specialized, and perfectly linked tables.

Although much is said about relational databases —where this concept originates— the truth is that the principles of normalization can be applied in many contexts where data management and consistency are important.

The fundamental goal of standardization is to ensure that each piece of data is stored only once in the appropriate location, but is available wherever it is needed. This prevents conflicting versions, saves space, and, above all, simplifies updating and querying tasks.

What is the purpose of database normalization?

Normalizing a database is not just a good practice; it's a necessity to ensure that the data meets key characteristics for any digital business. The main benefits and uses of the process are detailed below:

  • Elimination of redundancies: Duplicate data takes up space and, worse, creates confusion and errors when it's out of sync. Normalization eliminates these duplicates.
  • Improved data integrity: By having all data in one place, the risk of contradictions and loss of relevant information is reduced.
  • Facilitates maintenance: Well-normalized databases are much easier to modify and expand. Adding new data or changing relationships is faster and less prone to errors.
  • Storage optimization: By reducing unnecessary data, you achieve more efficient use of hardware resources, which is vital in large systems or when managing millions of records.
  • Improve query performance: Although there are nuances, in general, queries to normalized databases are faster and more accurate, since the design is optimized to locate the exact information sought.
  • Avoid update anomalies: When data isn't well organized, it's easy for an update in one table to not be reflected in another, causing mismatches. Normalization prevents these situations.
  SQLite JavaScript: Database Management on the Web

Key principles and concepts before standardization

Before embarking on normalization, it's essential to understand some basic relational database concepts. These concepts appear continuously throughout the process:

  • Database: Set of interrelated tables that store information.
  • Table: Structure composed of rows (also called tuples or records) and columns (attributes or fields).
  • Primary key: An attribute or combination of attributes that uniquely identifies each record in a table.
  • Foreign key: Field(s) in a table that reference the primary key value in another table, allowing relationships to be established.
  • Composite key: Primary key formed by two or more columns.
  • Functional dependency: Relationship between fields where the value of one depends entirely on the value of another field or set of fields.
  • Atomic fields: Those that contain only one indivisible value per cell.

Database normalization process

What are the goals of standardization?

The normalization process is designed to address several recurring challenges in most databases:

  • Eliminate duplicate data and redundancy errors.
  • Prevent anomalies from occurring when inserting, updating, or deleting.
  • Improve data quality and accessibility.
  • Optimize the use of storage space.
  • Facilitate connection with other systems or applications.
  • Strengthen security by knowing exactly where each piece of data is stored.

Phases of normalization: normal forms

Normalization progresses through stages called normal forms. Each form builds upon the previous one and adds extra requirements. Although there are up to six normal forms, in practice, the process usually stops at the third or fourth, as covering more levels typically complicates the structure without clear advantages for most applications.

First Normal Form (1NF)

The main goal of 1NF is to make the data atomic, meaning that each cell in the table contains only one indivisible value and there are no repeating groups. To achieve this, some key principles must be followed:

  • Delete repeating groups (columns like Phone1, Phone2…)
  • Create a structure where each column has a single data type and one value per record.
  • Avoid duplicate rows and ensure that an identifiable primary key exists.
  • Do not allow variation in the number of columns.

Example: If you have a customer table where one field stores a comma-separated list of phone numbers, the table is not in 1NF. To make it compliant, you should create a new row for each phone number or a separate table for phone numbers.

Advantages of 1NF: It facilitates data access and processing, homogenizes tables, and paves the way for subsequent phases.

Second Normal Form (2NF)

In 2NF, partial dependencies are identified and eliminated. This means that all non-key attributes must be functionally dependent on the entire primary key, not just a part of it (as in the case of a composite key).

  • Have the table previously in 1NF.
  • Detect possible dependencies on only part of the primary key (when there are multiple columns).
  • Create separate tables for data that depends only on part of the composite key.

Example: If you have an invoice table where the primary key is "invoice number" and "invoice line", but the customer name depends only on the invoice number and not the line, then you should separate the customer data into another related table.

  Nested Queries in MySQL: Examples and Explanation

Third Normal Form (3NF)

3NF eliminates transitive functional dependencies. That is, no non-key attribute should depend on another non-key attribute; it should only depend on the primary key.

  • Have the table in 2NF.
  • Find dependencies where one field depends on another field that is not a key.
  • Separate this data into new tables linked by foreign keys.

Example: If you have an employees table where the department name and manager name are stored, and the manager's name depends on the department, not the employee, you should create a table for departments where both pieces of data are associated and reference it from the employees table.

Other normal forms: BCNF, 4NF and 5NF

BCNF (Boyce-Codd Normal Form): It is an extension of 3NF that solves complex dependency cases, especially when there are multiple candidate keys.

4NF (Fourth Normal Form): Here, any non-trivial multivalued dependencies disappear. This occurs when an attribute depends on several attributes independently.

5NF (Fifth Normal Form): This method focuses on dividing tables that can be broken down into smaller parts without loss of information. It is a very advanced form and is rarely used outside of extremely complex applications.

How to normalize a database: practical step-by-step examples

To make it easier to understand, let's look at the normalization process by applying the first three normal forms to a simple example, similar to real-life cases you might encounter:

Step 1: Non-normalized table

Imagine an “Invoices” table like the following:

Invoice Number Date Client Address Article 1 Article 2 Article 3
101 2024-02-15 Juan Perez Sol Street 7 Keyboard Mouse
102 2024-02-16 Lucía Gómez Av. Luna 3 Screen

Problems: Items are scattered across multiple columns, and customer data is repeated if there are multiple invoices.

Step 2: Apply 1NF

Repetition is eliminated and atomicity is ensured:

Invoice Number Date Client Address Article
101 2024-02-15 Juan Perez Sol Street 7 Keyboard
101 2024-02-15 Juan Perez Sol Street 7 Mouse
102 2024-02-16 Lucía Gómez Av. Luna 3 Screen

Step 3: Apply 2NF

Customer data depends only on the invoice number, so a specific table is created for this purpose:

Invoice Table:

Invoice Number Date Client Address
101 2024-02-15 Juan Perez Sol Street 7
102 2024-02-16 Lucía Gómez

Invoice Items Table:

Invoice Number Article
101 Keyboard
101 Mouse
102 Screen

Step 4: Apply 3NF

A table is created for the updated customers and relationships:

Clients Table:

Client Address
Juan Perez Sol Street 7
Lucía Gómez Av. Luna 3

Invoices Table (with updated data):

Invoice Number Date Client
101 2024-02-15 Juan Perez
102 2024-02-16 Lucía Gómez

Practical considerations and exceptions in standardization

In the real world, applying textbook normalization may not always be the most efficient approach. There are situations where it's more pragmatic to allow some redundancy for performance reasons, especially in extremely large systems or when certain queries are so frequent that having some duplicate data is beneficial (controlled denormalization).

Furthermore, some NoSQL databases or systems heavily geared towards massive reads may prefer less normalized designs to maximize speed. Therefore, while normal forms are the foundation for good design, it's advisable to analyze each case individually and adapt the solution to the actual business needs.

  Relational Databases: An Introduction

When is it appropriate to normalize a database?

In most cases, normalization is the recommended route, but it's worth analyzing the specific situation before taking the plunge.

  • Ideal for: Enterprise management databases, systems where integrity is key, applications that will change significantly over time or that must scale without losing control of the data.
  • Avoidable or nuanced in: Read-only analytical systems, temporary databases, experimental projects, or when resources and time are extremely limited.

Normalization helps keep data organized, consistent, and easy to manage over the long term, although in some specific cases, a less normalized design may be preferable to improve performance.

Advantages and possible disadvantages of standardization

The advantages of standardization are many and obvious, but some potential drawbacks must also be considered , especially in certain cases:

  • Saving space and more reliable data.
  • Ease of updates and maintenance.
  • Logical and hierarchical organization of data.
  • Sometimes consultations can get very complicated. because more joins need to be made between tables.
  • Performance may be affected if many tables need to be crossed simultaneously.
  • In read-only or highly specialized databases, it may not be necessary to take normalization to the extreme.

Common mistakes and best practices when normalizing a database

Among the most frequent errors when normalizing are failing to properly identify dependencies, creating unnecessary composite keys, or leaving multi-valued fields "for convenience." To avoid these problems, it is advisable to:

  1. Spend sufficient time analyzing requirements and relationships between data.
  2. Define primary and foreign keys well.
  3. Do not skip steps in the normalization process.
  4. Review the final model with other users or developers.
  5. Clearly document relationships, constraints, and design justifications.

By taking precautions and following these guidelines, normalization will cease to be a distant concept found in computer science textbooks and become a practical tool that truly improves your database projects.

After reviewing in detail what it is, what it is for, how it is carried out and the most common errors in the normalization process, it is clear that opting for well-normalized databases is the best way to avoid future headaches, improve efficiency and guarantee solid information management in any company or organization that works with data at a certain level.

What is data warehousing?
Related articles:
What is Data Warehousing: 7 Reasons It's Revolutionizing Data Management