Referential integrity requires that data that has been affected by a procedure must satisfy all integrity rules for that procedure to execute successfully. For example, when an ORDER is created, at least one ORDER ITEM must also be created.
Referential integrity considerations for database and application design:
Any physical boundary between related data can cause extra data accesses and checking to maintain referential integrity. The boundary should be positioned to minimize access by procedures to related data stored in more than one location.
For example, assume that CUSTOMERS may be stored in one location and EMPLOYEES in another location, and that each CUSTOMER must be the responsibility of an EMPLOYEE. The name of the RESPONSIBLE EMPLOYEE is defined as an attribute of CUSTOMER. When a CUSTOMER is created, the procedure checks the existence of a responsible EMPLOYEE. When an EMPLOYEE is deleted, a procedure checks that there is no CUSTOMER who is the responsibility of the EMPLOYEE.
Ideally, the DBMS should make all checks. If this is not possible, data integrity should be maintained by procedures.
|
Copyright © 2013 CA.
All rights reserved.
|
|