create table Students(
id varchar auto_increment not null,
username varchar(30) not null,
sex varchar(30) not null,
age int(30) not null,
professional varchar(30) not null,
weight double(30) not null,
phone varchar(11) not null,
address varchar(50) not null,
primary key(id)
)
你给id设置为自动递增,字符类型怎么能自增?自增的是数值类型。
id类型改为int类型,或者去掉自动递增。
id varchar auto_increment not null,
改为
id int(11) auto_increment not null,
create table Students(
id int(11) auto_increment not null,
username varchar(30) not null,
sex varchar(30) not null,
age int(30) not null,
professional varchar(30) not null,
weight float(30) not null,
phone varchar(11) not null,
address varchar(50) not null,
primary key(id)
)
id varchar?id不应该是int吗,varchar类型哪支持自增呢