非空约束not null 约束的字段不能为null
create table t_vip(id int,name varchar(255) not null);insert into t_vip(id,name) values(1,'张三');insert into t_vip(id,name) values (2,'李四');insert into t_vip(id,name) values (3); #报错,设有not null 的字段不能为空,必须插入数据
not null只有列级约束,没有表级约束
