mysql NOT NULL constraint


  Translation results:

not

UK[nɒt] US[nɑ:t]

adv.No; [used to express negation, denial, rejection, prohibition, etc.] No ; Hardly; Not necessarily, no [used to negate the following word or phrase]

null

UK[nʌl] 美[nʌl]

adj.<Art>zero value; equal to zero; (agreement) has no legal effect; invalid

mysql NOT NULL constraintsyntax

Function: Constraint forces the column not to accept NULL values.

Description: NOT NULL constraint forces the field to always contain a value. This means that you cannot insert a new record or update a record without adding a value to the field.

mysql NOT NULL constraintexample

//强制 "Id_P" 列和 "LastName" 列不接受 NULL 值
CREATE TABLE Persons(Id_P int NOT NULL,LastName varchar(255) NOT NULL,FirstName varchar(255),Address varchar(255),City varchar(255));

Popular Recommendations

Home

Videos

Q&A