ERROR 1604(42000)

时间:2016-10-26 13:39:56

标签: mysql ubuntu

我有一个mysql命令

mysql> create table enrolled (snum int,cname varchar(20), primary key (snum,cname), 
        foreign key(snum) references student (snum), 
        foreign key (came ) references class (cname) 
        on delete cascade );

当我运行它时,我得到一个错误

  

错误1604(42000):您的SQL语法中有错误;检查与您的MYSQL服务器版本相对应的手册,以便在' mysql>附近使用正确的语法。创建表注册(sum int,cname varchar(20)主键(snum,cnam'在第1行

1 个答案:

答案 0 :(得分:0)

更改

foreign key (came )

到此

foreign key (cname )