AI engineering glossary · SQL databases
What is CHECK (check constraint)?
Check constraint (also called CHECK): A rule that attaches a true-or-false condition to a column or row; any insert or update that makes the condition false is rejected. It enforces business limits directly in the database.
Check constraint: an example
CHECK (rating BETWEEN 1 AND 5) rejects a review with rating 7.
Related terms
- Constraint
- NOT NULL
- Data integrity
More SQL databases terms
- Clustered index
- COALESCE
- Column
- COMMIT and ROLLBACK
- Common table expression
- Composite index
- Connection pool
- Correlated subquery
Where you learn it
Check constraint is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.