Database Reference
In-Depth Information
The motive of relational database theory is to remove anomalies from occurring in a data-
base. Anomalies can occur during changes to a database. Due to anomaly, data can become
logically corrupted. An anomaly with respect to relational database design is essentially an
erroneous change to data, more specifically to a single record. There are mainly three types
of anomalies that can corrupt data
5.3.1 Insert anomaly
Insert anomaly occurs when a record is inserted to a detail table, with no related record
existing in a master table. Addition of a new subject in detail table (see following figure)
requires that the teacher should be added first in master table, assuming, that the teacher
does not already exist.
5.3.2 Delete anomaly
The delete anomaly is just the opposite of the insert anomaly. Delete anomaly occurs when
a record is deleted from a master table, without first deleting all sibling records, in a detail
table. In cascade deletion, deletion of a master record automatically deletes all child records
in all related detail tables, before deleting the parent record in the master table. For ex-
ample, referring following figure, deleting a Teacher requires initial deletion of any Subject
that a teacher might have studied. If a Teacher was deleted from master table and subject
Search WWH ::




Custom Search