1.2.2 非空约束
not null
CREATE TABLE student( Id int primary key, Name varchar(50) not null, Sex varchar(10) ); INSERT INTO student values(1,’tom’,null);
1.2.3 默认值约束
default
CREATE TABLE student( Id int primary key, Name varchar(50) not null, Sex varchar(10) default '男' ); insert intostudent1 values(1,'tom','女'); insert intostudent1 values(2,'jerry',default);