Why Do We Need To Create Domains, Defaults Check Constraints
Why Do We Need To Create Domains, Defaults Check Constraints
Constraints?
When you create domains, defaults and attach them to the columns in a data model, you are
actually speeding up the data model creation process by using the pre-defined datatypes for
all the similar columns. Metadata/data in the database and data structures will be consistent
across the data models so that conflicts can be reduced. Check constraints enforce some rules
on columns in the data model as per your instructions.
In this section, you will see how you can create domain, defaults and check constraints by
using TOAD Data Modeler for the sample data shown below. To know more about the
definitions and meaning of a domain, defaults and check constraints, please refer our earlier
section Data Modeling Objects listed under the category Data Modeling.
Sample Data:
FULL_NAME NAME_DOMAIN NN
STREET_NAME NAME_DOMAIN NN
CITY_NAME NAME_DOMAIN NN
GENDER Char(1) NN
SSN Char(9) NN
RECORD_DATE Date NN
USER_NAME NAME_DOMAIN NN
In few columns, you see NAME_DOMAIN. The domain that you attached is displayed here
instead of data type.