Exploring Database Normalization in SQL

Learn SQL with Udemy

For an instructor lead, in-depth look at learning SQL click below.


Database normalization is a process used to organize a database into tables and columns. The goal with normalization is to minimize duplication and ensure data integrity.

Why Normalize a Database?

The main reasons for database normalization are to eliminate redundant (useless) data, ensure data dependencies make sense and to prevent data anomalies. Now let’s dive into the different forms of normalization with some SQL examples.

First Normal Form (1NF)

First Normal Form is achieved by ensuring the values in each column of a table are atomic. That is, they cannot be broken down any further.

In this table, all columns are atomic. The title, author’s name or genre cannot be usefully broken down any further, hence it is 1NF.

Second Normal Form (2NF)

A table is said to be in 2NF, if it is already in 1NF and all non-key columns are fully dependent on the primary key.

In this modified ‘books’ table, the ‘Author’ column is replaced by ‘AuthorID’, which refers to a separate table ‘authors’ that stores all author details. Therefore, ‘AuthorID’ fully depends on the primary key ‘BookID’, and the table is in 2NF.

Third Normal Form (3NF)

A table is in 3NF, if it is in 2NF and there are no transitive functional dependencies.

This ‘authors’ table is in 3NF as it is in 2NF, and there are no columns that are transitively dependent on the primary key.

In Conclusion

Database normalization is an essential part of database design. A good understanding of the underlying principles of normalization helps pave the way for creating robust, scalable SQL databases. Hopefully, these SQL examples have helped to visualize the concepts.

Leave a Comment