Subsection 1.3.7 Database Integrity Constraints
Maintaining the integrity and consistency of data in large databases is hard. People make input errors, for example. So most practical database systems exploit a collection of rules that check to make sure that data have not become corrupted. Like other specifications, these rules are written as statements that must be guaranteed to become and remain true.
Claim 1.3.8.
Every employee is assigned to at least one project.
Claim 1.3.9.
Every supervisor supervises at least one employee.
Claim 1.3.10.
No one may be his/her own supervisor.
Problems 1.3.13.
Database integrity constraints can serve multiple purposes, including checking for data errors and checking for policy violations.
(a)
Assume that our corporate Human Relations (HR) database contains the constraint: All employees are at least 18 years old.
Claim 1.3.11.
If an employee record violates this rule:
It’s almost certainly a data entry error.
There has almost certainly been a policy violation.
Either a data entry error or a policy violation (or both) could have occurred.
(b)
Assume that our corporate (HR) database contains the constraint: For all employees, hiring date comes after birthdate.
Claim 1.3.12.
If an employee record violates this rule:
It’s almost certainly a data entry error.
There has almost certainly been a policy violation.
Either a data entry error or a policy violation (or both) could have occurred.