In: Computer Science
Explain at least the first three normal forms of the normalization process.
Normal Form:
Normal Form is used in the DBMS(Database Management System) to reduce the redundancy and to avoid anomalies.
Redundancy is the duplicate data that means the same data is present at multiple locations.
The redundancy creates the problem of wastage storage and inconsistency.
Anomalies are the problem which arises due to data insertion, data update, or data deletion. This problem arises in a database that is unnormalized.
Update anomaly is data inconsistency after the update operation occurs. It arises due to partial updates and redundancy. In a partial update, some record is updated but some record is not updated or changes being made incorrectly.
When we can't insert a record into the database without the presence of some other attribute, then insertion anomalies occur.
When we delete a record from the database that has some attribute that should not be deleted, then deletion anomalies occur.
For example:
We are deleting a student record and he is the single student who is enrolled in an extra course but the extra course is also deleted with the student.
Normalization is used to avoid anomalies.
First Normal Form:
A table is said to be in first normal form if and only if each cell of the table contains the atomic value.
By default, every relation is in the first normal.
Second Normal Form:
If there is no partial dependency then the relation is said to be in second normal form.
A functional dependency A->B is a partial dependency if some attribute 'X' belongs to A, can be removed from X, and then dependency still holds.
If a relationship has no functional dependencies then it is in second normal form.
Third Normal Form:
A relation or table is in third normal form if there is no transitive dependency.
Transitive dependency is removed in the third normal form.