Normalization
o Normalization is the process of organizing the data in the database.
o Normalization is used to minimize the redundancy from a relation or set of relations. It is also used to eliminate the
undesirable characteristics like Insertion, Update and Deletion Anomalies.
o Normalization divides the larger table into the smaller table and links them using relationship.
o The normal form is used to reduce redundancy from the database table.
If a database design is not perfect, it may contain anomalies, which are like a bad dream for any database administrator. Managing a database with
anomalies is next to impossible.
Update anomalies − If data items are scattered and are not linked to each other properly, then it could lead to strange situations. For
example, when we try to update one data item having its copies scattered over several places, a few instances get updated properly while
a few others are left with old values. Such instances leave the database in an inconsistent state.
Deletion anomalies − We tried to delete a record, but parts of it was left undeleted because of unawareness, the data is also saved
somewhere else.
Insert anomalies − We tried to insert data in a record that does not exist at all.
Normalization is a method to remove all these anomalies and bring the database to a consistent state.
1nf
each column should have atomic/single values.
A column should contain values that are of the same type.
Each column should have a unique name.
order in which data is saved doesn't matter.
2nf
table should be in 1nf.
table should not have any partial dependencies.
Dependency / Functional dependency (Full functional dependency, partial dependency)
Partial dependency
In below table Teacher is only depend on subject and not on student. this is known as partial
dependency.
3nf
Table should be in 2nf.
Table should not have transitive dependency.
Transitive dependency
Below score table in third normal form
BCNF (Boycee Codd) (3.5nf)
Table should be 3nf.
For any dependency A -> B, A should be super key.
In the above table subject is depend on professor but professor in not super key, so it is not in bcnf.
4nf
It should satisfy BCNF.
It should not have multi valued dependency.
Multi valued dependency
Now 4nf
5nf
Table should be in 4nf.
Table should not have join dependency. (5nf is also known as PJNF or Project Join Normal Form).
************************************************************