DATABASE ASSIGNMENT # 3
Name : Syed Ali Raza
CMS : 2447-2024 (BSCS-3A)
Instructor : Sir Afzal Hussain
Update Anomaly
Definition
An update anomaly occurs in a database when the same data is stored in multiple rows, and
updating it in one place but not all places leads to data inconsistency.
This problem usually arises in unnormalized or poorly designed tables.
Example
Consider the following Student_Course table:
Student_I
Student_Name Course Instructor
D
101 Ali DSA Sir Suleman
102 Ahmed DBMS Sir Shayan
103 Sara OOP Sir Afzal
Here, the course DBMS is taught by Mr. Afzal, and his name is repeated in multiple rows.
Update Anomaly Scenario
Suppose Sir. Afzal changes his name to “Dr. Afzal Hussain”.
If we update only one row:
Student_I
Student_Name Course Instructor
D
101 Ali OOP Dr. Afzal Hussain
Student_I
Student_Name Course Instructor
D
102 Ahmed DSA Sir Suleman
Now the database shows two different instructor names for the same course, which is
incorrect and inconsistent.
This inconsistency is called an Update Anomaly.
Why It Happens
Redundant data
Poor database design
Lack of normalization
How to Avoid Update Anomaly
Normalize the database (e.g., split into Student, Course, and Instructor tables)
Store each fact only once
Conclusion
An update anomaly leads to inconsistent data when changes are not applied uniformly across all
records. Proper database normalization helps eliminate update anomalies and ensures data
accuracy.