What is Normalization?

PRASANTH
2 min readSep 11, 2020

Before discussing about Normalization, why Normalization is required?

Scenario 1:

Imagine a table with 1000 columns. is it possible to view all the columns at a time? at least 100 columns!! No, right?

and if the same table having millions of records then what about performance of query?

So, divide the columns having similar data as separate table. So, you will get N number of tables based on grouping the columns. Each table has common key column,

Now, We create relation among the tables with common key column.

You can understand with Scenario 2 example

Scenario 2: If a column has sub columns in a table then how to access the sub column values.

Have a look at the DOJ and ADDRESS Columns in below image you will understand

Columns with sub columns

The above table is complex structure and imagine how it would be if it has 1000 columns.

better solution for the above 2 scenarios as shown in below image

Combine DOJ columns as single column and Separated sub columns of ADDRESS column as table with a common key

By looking at the image you can understand easily that the DOJ column is combined as single column and sub columns of ADDRESS columns as separate table.

Did You observe any thing other than these two?.

I will tell you, EMPID which is a common column for both EMP table and ADDRESS table. Using this common column, we can create relation between the tables.

Lets consider, both tables has a relation then i want to fetch the address details of employee ‘PQR’.

Employee “PQR’s” empid is 222. so, search 222 value in the EMPID column of ADDRESS table. The address is “ 5–432, AJO, CHN”.

Scenario 3: How to identify unique record in a table?

If you observe EMPID column values, you find 333 value twice.

If we want to fetch the EMPID with 333 data, we get two different employees data but, we should get only one.

To avoid these data issues, table should have a column which identifies a record uniquely

EMPID column to identify a record uniquely

Lets talk about normalization.

Normalization is a database design schema technique, by which an existing schema is modified to minimize redundancy(unwanted) and dependency (table relationships) of data

Next, We’re going to discuss about “Normal Forms” [ https://medium.com/@pk0411/normalization-forms-a664e575467f ]

--

--

PRASANTH
0 Followers

Techie | Investor | Freelancer | Blogger | Vegetarian