AdBlock Detected!
Our website is made possible by displaying ads to our visitors. Please supporting us by whitelisting our website.
SQL NOT NULL Constraint |
SQL > Constraint >
NOT NULL Constraint
By default, a column can hold NULL. If you do not want to allow NULL value in a column, you will want to place the NOT NULL constraint on this column. The NOT NULL constraint specifies that NULL is not an allowable value. For example, in the following statement, CREATE TABLE Customer
(SID integer NOT NULL, Last_Name varchar (30) NOT NULL, First_Name varchar(30)); Columns "SID" and "Last_Name" cannot include NULL, while "First_Name" can include NULL. An attempt to execute the following SQL statement, INSERT INTO Customer (Last_Name, First_Name) VALUES ('Smith', 'Ken');
will result in an error because this will lead to column "SID" being NULL, which violates the NOT NULL constraint on that column.
|
Our website is made possible by displaying ads to our visitors. Please supporting us by whitelisting our website.