SQL NOT NULL Constraint

Posted by Sudheer Sharma 26 November 2008
What do you think of this post?
Awesome  Interesting  Useful 

[amazon-deals height="280" width="336"]1bb4e641-5c29-46e1-9302-d1032e9caad5[/amazon-deals] 

The NOT NULL constraint enforces a column to NOT accept NULL values.

The NOT NULL constraint enforces a field to always contain a value. This means that you cannot insert a new record, or update a record without adding a value to this field.

The following SQL enforces the “P_Id” column and the “LastName” column to not accept NULL values:

CREATE TABLE Persons
(
P_Id int NOT NULL,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Address varchar(255),
City varchar(255)
)
What do you think of this post?
Awesome  Interesting  Useful 

Leave a Reply

*


Fatal error: Call to undefined function is_new_post() in /hermes/web06/b862/moo.godasudheer/wp-content/themes/MagHo/MagHo/page.php on line 20