How do I disallow NULL values in a table?

Joe Sam Shirah

Null capability is a column integrity constraint, normally aplied at table creation time. Note that some databases won't allow the constraint to be applied after table creation. Most databases allow a default value for the column as well. The following SQL statement displays the NOT NULL constraint:

CREATE TABLE CoffeeTable ( 
   Type   VARCHAR(25)   NOT NULL, 
   Pounds INTEGER       NOT NULL, 
   Price  NUMERIC(5, 2) NOT NULL 
                         )
0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact