Skip to main content

Domain Constraints

A domain is defined as the set of all unique values permitted for an attribute. For example, a domain of Date is the set of all possible valid dates, a domain of Integer is all possible whole numbers, and a domain of day-of-week is Monday, Tuesday ... Sunday.

This in effect is defining rules for a particular attribute. If it is determined that an attribute is a date then it should be implemented in the database to prevent invalid dates being entered.

A classic example of this is where the data from a legacy system is loaded into a newly designed database. The new system is well designed. Columns that hold dates are defined as such whereas, in the old system, they were held as character strings. Much data is rejected because of invalid dates, eg 30 February 2000.

If the system supports domain constraints then this invalid data would not have stored in the first place. That is, the integrity of the database is being preserved.

Next: Entity Integrity