Normalization is the process of organizing the data and the attributes of a database.
It is performed to reduce the data redundancy in a database and ensure that data is stored logically.
Normalization is systematic approach of decomposing table to eliminate data redundancy and undesirable characteristics like insertion, update and delete.
Normalization is multi-step process that puts data in tabular form and remove duplicate data from relation tables.
Example Employees Table
In this table, we have data of office employees.
1. Insertion Anomaly
An insertion anomaly occurs in the relation database when some attributes or data items are inserted into database without existence of other attributes.
2. Updation Anomaly
Updation Anomaly occurs when the same data item is repeated with the same values are not linked to each other.
3. Deletion Anomalies
Deletion Anomalies occurs when deleting one part of the data deletes the other necessary information from the database.
1. 1NF (First Normal Form)
In 1NF relation, each table cell should contain a single value. Each record looks like unique.
Here in the Framework row, we stored two frameworks of course Name MySQL, PostgreSQL so it is *multi-valued attribute. * it is not 1NF relation. We need to convert it into 1NF.
Convert it into 1NF
It's a simple method to store Framework separately in 1NF. Now this is First Normal Form. 1NF wants to store unique information in table without data repetition.
2. 2NF (Second Normal Form)
In 2NF, relation must in 1NF. In the Second Normal Form, all non-key attributes are fully functionally dependent on the primary key.
|Full Stack Developer