Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa SQL What is CHECK Constraint?
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


hemant kumar
What is CHECK Constraint?
1 Answer(s)      4 years and a month ago
Posted in : SQL


What is CHECK Constraint?


Advertisement
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 Tutorials/Questions & Answers:
Advertisements
 

 

 

DMCA.com