Check constraint
A check constraint is a type of integrity constraint in SQL which specifies a requirement that must be met by each row in a database table. The constraint must be a predicate. It can refer to a single or multiple columns of the table. The result of the predicate can be either TRUE
, FALSE
, or UNKNOWN
, depending on the presence of NULLs. If the predicate evaluates to UNKNOWN
, then the constraint is not violated and the row can be inserted or updated in the table. This is contrary to predicates in WHERE clauses in SELECT or UPDATE statements.