CheckConstraints
CHECK constraints are a database-level mechanism that enforces domain integrity by validating each row against a boolean expression. Implemented as part of a table's schema, they can be defined as a table constraint or as an inline constraint on a single column, and are evaluated on INSERT and UPDATE operations. If the expression is false, the database rejects the change.
Syntax can vary slightly by database system, but common forms include: CREATE TABLE with a named table
Notes: Some constraints permit complex expressions using arithmetic, function calls, and comparisons; however, most systems disallow
Management: You can view constraints via system catalogs; drop with ALTER TABLE ... DROP CONSTRAINT constraint_name. If
Common use cases include enforcing nonnegative values, date ranges, or enumerated sets. CHECK constraints are a