0% found this document useful (0 votes)
14 views2 pages

Database Assignment

An update anomaly occurs when the same data is stored in multiple rows, leading to inconsistencies if updates are not applied uniformly. This issue often arises from redundant data and poor database design, as illustrated by a Student_Course table example. To avoid update anomalies, it is recommended to normalize the database and store each fact only once.

Uploaded by

alirazaaadost
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views2 pages

Database Assignment

An update anomaly occurs when the same data is stored in multiple rows, leading to inconsistencies if updates are not applied uniformly. This issue often arises from redundant data and poor database design, as illustrated by a Student_Course table example. To avoid update anomalies, it is recommended to normalize the database and store each fact only once.

Uploaded by

alirazaaadost
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

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.

You might also like