91热爆

Anomalies

IDForenameSurnameDepartmentDepartment IDPhone number
1ColinArthurICT001300
2LauraBrownICT001300
3StephenMacLeodICT001300
4ScottSinclairEnglish002301
5MichelleWieEnglish002301
6RossDyettPE003302
7IanAndersonPE003302
8BettyFloodGeography004303
ID1
ForenameColin
SurnameArthur
DepartmentICT
Department ID001
Phone number300
ID2
ForenameLaura
SurnameBrown
DepartmentICT
Department ID001
Phone number300
ID3
ForenameStephen
SurnameMacLeod
DepartmentICT
Department ID001
Phone number300
ID4
ForenameScott
SurnameSinclair
DepartmentEnglish
Department ID002
Phone number301
ID5
ForenameMichelle
SurnameWie
DepartmentEnglish
Department ID002
Phone number301
ID6
ForenameRoss
SurnameDyett
DepartmentPE
Department ID003
Phone number302
ID7
ForenameIan
SurnameAnderson
DepartmentPE
Department ID003
Phone number302
ID8
ForenameBetty
SurnameFlood
DepartmentGeography
Department ID004
Phone number303

Insert anomaly

In the above example, it is not possible to add a new department to the database without also having to add a member of staff at the same time. The table expects a teacher鈥檚 details and the details of a department to be stored together as one record.

At the moment, there is no way to add the Maths department without also having to add a Maths teacher. This problem is known as an insert anomaly.

Delete anomaly

A delete anomaly is the opposite of an insert anomaly. When a delete anomaly occurs it means that you cannot delete data from the table without having to delete the entire record.

For example, if we want to remove Betty Flood from the table, we would also need to remove all data that is stored about the Geography department. This means we would lose data that we might not want to lose.

Update anomaly

Take a look at the table shown above again. If the phone number for the English department changed to 307 instead of 301 it would need to be changed in two different records.

If the change only happened in one of the two records, then an update anomaly would have taken place.

In small tables it can be easy to spot update anomalies and make sure that changes are made everywhere. However, large flat file tables would often contain thousands of records, meaning that it is difficult to make changes to every record. Update anomalies lead to inaccuracy and inconsistency in a database.