What Is Normalization in DBMS (SQL) - 1NF, 2NF, 3NF, BCNF Database With Example
What Is Normalization in DBMS (SQL) - 1NF, 2NF, 3NF, BCNF Database With Example
https://www.guru99.com/database-normalization.html 1/8
7/2/2021 What is Normalization in DBMS (SQL)? 1NF, 2NF, 3NF, BCNF Database with Example
The Theory of Data Normalization in MySQL server is still being developed further. For
example, there are discussions even on 6th Normal Form. However, in most practical
applications, normalization achieves its best in 3rd Normal Form. The evolution of
Normalization in SQL theories is illustrated below-
Here you see Movies Rented column has multiple values. Now let's move into 1st
Normal Forms:
1NF Example
Note: Columns in a table that are NOT used to identify a record uniquely are called non-
key columns.
https://www.guru99.com/database-normalization.html 3/8
7/2/2021 What is Normalization in DBMS (SQL)? 1NF, 2NF, 3NF, BCNF Database with Example
In our database, we have two people with the same name Robert Phil, but they live in
different places.
Hence, we require both Full Name and Address to identify a record uniquely. That is a
composite key.
It is clear that we can't move forward to make our simple database in 2ndNormalization
form unless we partition the table above.How to write a TEST CASE Software Testing Tu…
https://www.guru99.com/database-normalization.html 4/8
7/2/2021 What is Normalization in DBMS (SQL)? 1NF, 2NF, 3NF, BCNF Database with Example
We have divided our 1NF table into two tables viz. Table 1 and Table2. Table 1 contains
member information. Table 2 contains information on movies rented.
We have introduced a new column called Membership_id which is the primary key for
table 1. Records can be uniquely identified in Table 1 using membership id
Foreign Key references the primary key of another Table! It helps connect your Tables
https://www.guru99.com/database-normalization.html 5/8
7/2/2021 What is Normalization in DBMS (SQL)? 1NF, 2NF, 3NF, BCNF Database with Example
You will only be able to insert values into your foreign key that exist in the unique key in
the parent table. This helps in referential integrity.
https://www.guru99.com/database-normalization.html 6/8
7/2/2021 What is Normalization in DBMS (SQL)? 1NF, 2NF, 3NF, BCNF Database with Example
The above problem can be overcome by declaring membership id from Table2 as
foreign key of membership id from Table1
Now, if somebody tries to insert a value in the membership id field that does not exist in
the parent table, an error will be shown!
Consider the table 1. Changing the non-key column Full Name may change Salutation.
To move our 2NF table into 3NF, we again need to again divide our table.
3NF Example
Below is a 3NF example in SQL database:
https://www.guru99.com/database-normalization.html 7/8
7/2/2021 What is Normalization in DBMS (SQL)? 1NF, 2NF, 3NF, BCNF Database with Example
We have again divided our tables and created a new table which stores Salutations.
There are no transitive functional dependencies, and hence our table is in 3NF
Now our little example is at a level that cannot further be decomposed to attain higher
normal form types of normalization in DBMS. In fact, it is already in higher normalization
forms. Separate efforts for moving into next levels of normalizing data are normally
needed in complex databases. However, we will be discussing next levels of
normalisation in DBMS in brief in the following.
https://www.guru99.com/database-normalization.html 8/8