Previous Topic

Next Topic

Need for Integrity Constraints

The need for integrity constraints arises because of the necessity that the data in a database must be valid and consistent at any point of time.

For example, in the table containing employee information, it is to be ensured that the employee numbers be unique. This can be ensured by specifying a constraint on the column containing the employee number. Similarly, for each order entry made in the orders table, it is to be ensured that the associated item entry be present in the items table. This can be ensured by specifying a referential integrity constraint on the column containing the item code in the orders table.