Content deleted Content added
Quaker5567 (talk | contribs) No edit summary |
Quaker5567 (talk | contribs) No edit summary |
||
Line 1:
A check constraint is a rule that defines valid [[data]] when adding or updating an entry in a [[database]]. A check constraint is applied to a column in the database. The constraint must be a [[Boolean expression]].
For example, in a database containing products, you could add a check constraint such that the price of a product and quantity of a product is either zero or a positive value:
PRICE >= 0
Line 9:
If these constraints are not in place, it would be possible to have a negative price (-$30) or quantity (-3 items).
Check constraints are used to ensure the validity of data in a database i.e. provide [[data integrity]]. If they are used at the database level, applications which use the database will not be able to add invalid data or modify
|