第一次手打报错,复制手打再来就成功了


create table `sc`(
`sno` char(9) not null comment '学号',
`cno` char(4) not null comment '课程编号',
`grade` float default null comment '成绩',
primary key (`sno`,`cno`)
);
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 ')

create table `sc`(
`sno` char(9) not null comment '学号',)

create t' at line 1
mysql> create table `sc`(
`sno` char(9) not null comment '学号',
`cno` char(4) not null comment '课程编号',
`grade` float default null comment '成绩',
primary key (`sno`,`cno`)
);
Query OK, 0 rows affected

第一次手打报错,复制手打再来就成功了,给我整蒙了

看报错信息,貌似你贴出来的代码和出错代码并不一样,可能是引号打错了

多了个括号

img