RDBMS Fundamentals

CHECK Constraint

English

Overview

A constraint that guarantees a column's value satisfies a specified condition.

Details

A constraint that guarantees a column's value satisfies a specified condition, used for things like range checks. Beyond a simple range check like 'age must be 0 or greater,' it can also reference conditions spanning multiple columns -- though for a long time MySQL accepted the syntax without actually enforcing it, which is worth knowing if you're relying on it there.

More Database terms