Introduction

This article is intended for audiences who are aware of designing the database but are not sure about the Normalization process.

What is Normalization?

When we want to store some piece of information, we store it in a database. Now storing a data in database means it should be stored properly so that while retrieving it, it should be easy. So we say to store it in a Normalized way. In short, Normalization can be defined as the process of organizing the data in a database efficiently. The result of normalization is a logical database design and is called Normal Form.

Why Normalization?

The goals of the Normalization process are

  1. It helps you to eliminate the redundant data from the same table.
  2. It ensures the data dependencies between the tables are proper.
  3. A Normalized database design makes it easy to change in modification is required.

Advantages of Normalization

  1. Data redundancy is removed
  2. Faster update as redundant columns from tables are removed.
  3. Easy understanding of the structure
  4. Improvement in Index as be achieved
  5. Long-term maintainability of the database gets easier

Disadvantages of Normalization

  1. Query, to some extent, gets complicated
  2. Performance may degrade due to multiple joins

Suppose I have some data with me, say

UnNormalized Table

unnormalized table

As you can see above, the table is not properly managed

The normalization process is mainly divided into stages which we call Normal Form. Let’s talk about each Normal Form one by one with an example. Basically, a database can be normalized into various normal forms, such as

But today I would like to talk about only up to Boyce Codd Normal Form because Fourth Normal Form and others are rarely used in the database design.

First Normal Form (1NF)

1nf

As you can see above,

Second Normal Form (2NF)

2nf

As you can see above,

Third Normal Form (3NF)

Let’s suppose I want to add new columns in Employee Table Manager and Project

unnormalized table

Now, adding these 2 columns violates the third Normal Form because the non-key column Project is dependent on another not key column i.e. - Manager. So we will normalize the table by separating the nondependent column to another table. This way, we can achieve the third Normal Form.

3NF

Boyce Codd Normal Form (BCNF)

Note: If there is only one candidate key, then 3NF and BCNF are the same.

Consider another column below the table, say ProjectTechnology

UNNORMAL TABLE

As shown above, each manager will be handling a unique project, so we can say a particular project is determined by a particular manager where Manager and Project depict a candidate key.

If we delete the entry of Manager Ronnie from the table, we lose not only information about Project BCF but also the fact that the project was developed in Asp.Net technology. We cannot make the entry of the fact that the BCF project was developed using Asp.Net.

So let’s break this into separate tables

BCNF

Fourth Normal Form (4NF)

I hope you got what actually is the process of Normalization.

Conclusion

Thus concluding it, Normalization is a process which is a must to design any database. Hope you like this article. Please share your comments whether it’s good or bad. Your comments are valuable to me to get better.