Databases Reference
In-Depth Information
133
RepNum does not
match any value in the
Rep table
Message indicating you
cannot add a record because
the RepNum is invalid
FIGURE 4-19
Referential integrity violation when attempting to add a record
Deleting a sales rep who currently has customers on file would also violate referential integrity because
the sales rep's customers would no longer match any sales rep in the Rep table. The DBMS must refuse to carry
out this type of deletion and then produce an error message, such as the one shown in Figure 4-20. If sales
rep 20 leaves Premiere Products, all of her customers would need to be assigned to other sales reps before her
record would be deleted from the Rep table.
Message indicating you
cannot delete sales rep 20
because related customer
records exist
FIGURE 4-20
Referential integrity violation when attempting to delete a record
Legal-Values Integrity
In addition to the two integrity rules defined by Codd, there is a third type of integrity, called legal-values
integrity . Often there is a particular set of values, called the legal values, that are allowable in a field. Legal-
values integrity is the property that states that no record can exist in the database with a value in the field
other than one of the legal values. For example, the only legal values for the CreditLimit field are $5,000,
$7,500, $10,000, and $15,000. A record on which the credit limit is $12,500 would not be permitted.
 
Search WWH ::




Custom Search