问题遇到的现象和发生背景
跟着别人的视频学习创建一个表,运行的时候一直报错
问题相关代码,请勿粘贴截图
create table user(
id int primary key auto_increment comment '主键',
name varchar(10) not null unique comment '名字',
age char(1) check ( age > 0 && age < 120 ) comment '年龄',
status char(1) default '1' comment '状态',
gender char(1)
) comment '用户表';
运行结果及报错内容
报错内容:42000][1064] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'comment '年龄', status char(1) default '1' comment '状态', gender ' at line 4
我的解答思路和尝试过的方法
将comment '年龄'注释掉后程序能正常运行
我想要达到的结果
想请教一下各位,这是怎么回事?