Constraints are used to restrict allowable data values in table column(s). Constraints are useful for error checking by enforcing rules on the data values. The section below discusses the possible different rules a constraint can enforce. Some of these rules are implicitly defined by others.
A constraint can be created only during table creation. There are two types of constraints. The first constraint is on a table in the database and the second constraint is on a column in the table. Constraints on the table apply to one or more columns while constraints on a column apply to only that one column.