Check constraint: Difference between revisions

Content deleted Content added
Addbot (talk | contribs)
m Bot: Migrating 1 interwiki links, now provided by Wikidata on d:q5089090
Normash (talk | contribs)
m clarification needed
Line 1:
A ' A check constraint is applied to each [[Row (database)|row]] in the [[Table (database)|table]].{{Clarification needed|April 2013}} The constraint must be a [[Predicate (mathematical logic)|predicate]]. It can refer to a single or multiple [[Column (database)|columns]] of the table. The result of the predicate can be either TRUE, FALSE, or UNKNOWN, depending on the presence of [[Null (SQL)|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 (SQL)|WHERE]] clauses in [[Select (SQL)|SELECT]] or [[Update (SQL)|UPDATE]] statements.
 
For example, in a table containing products, one could add a check constraint such that the price of a product and quantity of a product is a non-negative value: