Soft Technology Classroom: SQL constraints of NOTNULL

SQL NOT NULL constraints

NOT NULL constraint force column does not accept NULL values.

NOT NULL constraint mandatory field always contains a value. This means that if you do not add value to the field, you can not insert a new record or update the record.

The following SQL statement forces "Id_P" column and the "LastName" column does not accept NULL values:

CREATE TABLE Persons
(
Id_P int NOT NULL,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Address varchar(255),
City varchar(255)
)

Guess you like

Origin www.cnblogs.com/sysoft/p/11546752.html