What is Normalization?
Normalization is the process of assigning attributes to relations in such a way that data redundancies and Modification Abnormalities are reduced or eliminated.
Problems in Unnormalized Database
Data Redundancy
Anomalies
Data Redundancy
- Data redundancy in a database means that the same data is present in more than one table.
Disadvantages Of Data Redundancy
- Increases the size of the database unnecessarily.
- Causes data inconsistency.
- Decreases efficiency of database.
Example for Data Redundancy
- Table School: RegistrationNumber, Name, FatherName, DateOfBirth, Address, ContactNumber
- Table Fees: ReceiptNumber, StudentName, FeesMonth, FeesAmount, PaidDate Student Name is appeared in two tables. So this attribute is redundant
Modification Abnormalities/Anomalies
- Anomalies are problems that can occur in poorly planned, un-normalised databases where all the data is stored in one table
Modification Abnormalities/Anomalies
- Update Anomaly: Means possible Inconsistent Data
- Insertion Anomaly: No Place to Hold New Information
- Deletion Anomaly: Loss of Information that we wanted to keep.
- Update Anomaly: Means possible Inconsistent Data
Update Anomaly
- This occurs when updating data in one part of the database does not properly update to other related parts.
- As a result, inconsistencies may happen between different parts of the database.
Example: If you update the salary of an employee in one table but forget to update it in another table that contains historical salary information, you may end up with inconsistent salary records, leading to an update anomaly.
Insert Anomaly
- This occurs when certain data cannot be added to the database without the presence of other data.
- In other words, you cannot insert a new record into the database without including data that depends on it. This can lead to incomplete or incorrect information.
Example: Suppose you have a table that stores information about Students and their courses. If you try to insert a new course without assigning it to an existing Student, the database may not allow it, that leading to an insert anomaly.
Delete Anomaly
- This occurs when deleting a record unintentionally removes other related data.
- Deleting a record may inadvertently result in the loss of data that is still relevant to other parts of the database.
Example: If you delete an employee from a table that contains both employee information and project assignments, you might lose information about the projects associated with that employee, leading to a delete anomaly.