CHECK Constraint
noun
say it: “CHEK kun-STRAYNT” /tʃɛk kənˈstreɪnt/
A rule that each row must pass a condition, such as UnitPrice >= 0.
What does CHECK Constraint do in a relational database?
CHECK Constraint — A constraint requiring inserted or updated rows to satisfy a search condition.
CREATE TABLE customer (
customer_id INTEGER PRIMARY KEY,
email CHARACTER VARYING(255) NOT NULL,
status CHARACTER VARYING(20) DEFAULT 'active'
);
In a sentence
- “A CHECK constraint refuses any product with a price below zero.”
Level: Novice · More SQL terms at this level
Updated