Working with Domains

A domain is a type of integrity constraint you can use when defining a column. Domains specify the data type of the column. Domains may also specify a default value and a value constraint. When defining a column using a domain, the column inherits the properties of the domain (e.g., data type, default value, and value constraint) without requiring explicit specification.

Specifying the default value and value constraint using domains achieves the same results as specifying them in a standard column definition. If you specify a default value for a column, it will override the default value specified in a domain. Value constraints specified in the column definition, are used in addition to the value constraints specified in the domain. If you do define a column using a domain and specify additional value constraints, you should ensure the additional value constraints do not conflict with those defined in the domain.