Check Constraint

May 18, 2019 · Team EasyExamNotes · 1 min read (est.) · 0 comments

Share on WhatsApp
CHECK CONSTRAINT


The CHECK constraint is used to limit the value range that can be placed in a column.
The  CHECK constraint allows only certain values for a column.

How to create a CHECK constraint?

Check constraint can be created in this way:

CREATE TABLE Student(
RollNumber INT NOT NULL,
Name varchar(255), 
Age INT,
CHECK (Age>=18)
);

How to delete a CHECK constraint?

ALTER TABLE Student DROP CHECK Age;

Discussion

Ask a question, share your thoughts or report an error.

Sign in to participate in the discussion.

Join the discussion