Content deleted Content added
Update link to up-to-date Postgresql (the text of the chapter did not change) |
SimLibrarian (talk | contribs) mNo edit summary Tags: Mobile edit Mobile app edit iOS app edit |
||
Line 1:
{{Short description|Type of integrity constraint in SQL}}
A '''check constraint''' is a type of [[integrity constraint]] in [[SQL]] which specifies a requirement that must be met by each [[row (database)|row]] in a database [[table (database)|table]]. The constraint must be a [[Predicate (mathematical logic)|predicate]]. It can refer to a single column, or multiple [[Column (database)|columns]] of the table. The result of the predicate can be either <code>TRUE</code>, <code>FALSE</code>, or <code>UNKNOWN</code>, depending on the presence of [[Null (SQL)|NULLs]]. If the predicate evaluates to <code>UNKNOWN</code>, then the constraint is not violated and the row can be inserted or updated in the table. This is contrary to predicates in <code>[[Where (SQL)|WHERE]]</code> clauses in <code>[[Select (SQL)|SELECT]]</code> or <code>[[Update (SQL)|UPDATE]]</code> statements.
|