Anomalies

A situation where a change in data causes inconsistency or lose information.

Insertion Anomaly

Occurs when certain data cannot be inserted into a database without the presence of other, unrelated data.

Example:
Cannot add a new student unless they are enrolled in a course, because student and course details are stored in the same table.

Before

Enrollment
StudentIDStudentCourseIDCourse
1AnnDBDatabases
2BobOSOperating Systems
Add student Cathy, who has no course yet

After

Enrollment
StudentIDStudentCourseIDCourse
1AnnDBDatabases
2BobOSOperating Systems
3CathyNULLNULL

CourseID is part of the key, so it cannot be NULL. Cathy cannot be stored.

Underlined columns form the primary key.

Inserting a student without a course is rejected because CourseID is part of the key

Update Anomaly

Happens when data redundancy causes inconsistent updates across records.

Example:
If an instructor’s department name changes, it must be updated in multiple rows; missing one row leads to inconsistent data.

Before

Teaching
CourseIDInstructorDept
DBLeeCS
OSLeeCS
NWKimEE
Rename department CS to Computing

After

Teaching
CourseIDInstructorDept
DBLeeComputing
OSLeeCS
NWKimEE

1 row was missed. Lee now belongs to 2 departments.

Underlined columns form the primary key.

Renaming a department updates only one of the rows that repeat it, leaving inconsistent data

Deletion Anomaly

Occurs when deleting a record unintentionally removes valuable related information.

Example:
Deleting the last student enrolled in a course also deletes the course information itself.

Before

Enrollment
StudentIDStudentCourseIDCourse
1AnnDBDatabases
2BobOSOperating Systems
Delete Ann's enrollment

After

Enrollment
StudentIDStudentCourseIDCourse
1AnnDBDatabases
2BobOSOperating Systems

Ann was the last student in DB, so the course Databases is lost.

Underlined columns form the primary key.

Deleting the last enrollment of a course also deletes the only record of that course
Written by October 10, 2026 1 min read
Was this helpful?