Definition
Data Anomalies
Data Anomalies are problems that can occur in a databases due to redundant or improperly structured data.
Inconsistencies
Insertion Anomaly
Inability to add data due to the absence of other data.
Example:
Produkt | BestellNr. | Verkäufer | Abteilung | Kunde | PLZ | Strasse | Preis |
---|---|---|---|---|---|---|---|
Toaster | 1 | Eder | A | Maier | 1070 | Laudong. 1 | 21,90 |
Föhn | 1 | Eder | A | Maier | 1070 | Laudong. 1 | 14,30 |
Toaster | 2 | Blum | B | Müller | 1170 | Blumeng. 2 | 21,90 |
Messer | 3 | Sagner | C | Fritz | 1170 | Blumeng. 6 | 12,10 |
Can’t add order with an product, which has not been ordered yet, since there is no products table → absence of fundamental data.
Update Anomaly
Update of one data does not cause a global change, resulting in data inconsistencies.
Example:
Produkt | BestellNr. | Verkäufer | Abteilung | Kunde | PLZ | Strasse | Preis |
---|---|---|---|---|---|---|---|
Toaster | 1 | Eder | A | Maier | 1070 | Laudong. 1 | 21,90 |
Föhn | 1 | Eder | A | Maier | 1070 | Laudong. 1 | 14,30 |
Toaster | 2 | Blum | B | Müller | 1170 | Blumeng. 2 | 21,90 |
Messer | 3 | Sagner | C | Fritz | 1170 | Blumeng. 6 | 12,10 |
Changing
Maier
(Kunde
) of the first row does not cause a change in the second row. The result is data inconsistency.
Deletion Anomaly
Deletion of one data causes the loss of other data.
Produkt | BestellNr. | Verkäufer | Abteilung | Kunde | PLZ | Strasse | Preis |
---|---|---|---|---|---|---|---|
Toaster | 1 | Eder | A | Maier | 1070 | Laudong. 1 | 21,90 |
Föhn | 1 | Eder | A | Maier | 1070 | Laudong. 1 | 14,30 |
Toaster | 2 | Blum | B | Müller | 1170 | Blumeng. 2 | 21,90 |
Messer | 3 | Sagner | C | Fritz | 1170 | Blumeng. 6 | 12,10 |
C
(Abteilung
) gets lost when deletingMesser
(Product
).