SQL CHECK


The CHECK Constraint enables a condition to check the value being entered into a record. If the condition evaluates to false, the record violates the constraint and isn't entered into the table.

Example

CREATE TABLE stud(sid int NOT NULL CHECK(s_id > 0), sname VARCHAR(60) NOT NULL)

Share this article on