Database Anomalies

Piyush Kulkarni
1 min readMar 18, 2022

If you want the same concepts explained in Marathi, its here.

In order to design a good database, we need to learn some rules in order to avoid anomalies.

Typically, following anomalies are often found.

Insertion anomaly

Update anomaly

Deletion anomaly

What’s wrong with this table?

Here, rows are repeated, causing Redundancy.

Update anomaly

Let’s assume one person works just in one department at a time. Any employee changing a department would imply we need to update multiple rows. If one row stays, un-updated you will run into Logical Inconsistency.

Deletion anomaly

Say Project # 3 is completed and you want to remove the project from data base. Deleting the rows containing project 3 will also remove the other info like Dept and Name and the corresponding Emp ID. This will lead to Deletion Anomaly.

Insertion anomaly

Let’s assume the table can’t be updated with NULL value in project #. Now any employee who is on-boarded but not assigned a project can not be stored here. Thus, leading to Insertion Anamoly.

Then how do we avoid anomalies exactly?

Stay tuned for the next post!

Piyush Kulkarni

--

--