Home Answers Viewqa SQL What is CHECK Constraint?

 
 


hemant kumar
What is CHECK Constraint?
1 Answer(s)      2 years and 6 months ago
Posted in : SQL

What is CHECK Constraint?

View Answers

November 19, 2010 at 1:02 PM


Hi,

The CHECK constraint is used to limit the value range that can be placed in a column.The SQL CHECK constraint ensures that all values in a column satisfy certain conditions,If you define a CHECK constraint on a single column it allows only certain values for this column.If you define a CHECK constraint on a table it can limit the values in certain columns based on values in other columns in the row.

CREATE TABLE newitems (
   newitem_num INTEGER CHECK (newitem_num > 10),
   manucode CHAR(3) NOT NULL,
   promotype INTEGER,
   descrip CHAR(20))

thanks.









Related Pages:

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.