create table boat
(bid integer not null constraint c_bid primary key,
bname varchar(40),
color varchar(40)
constraint c_color check (color in ('Red','Blue','Light Green','Yellow')));
我在使用mysql workbench的脚本上使用此sql代码,并且单词contraint为红色,并且出现错误语法错误:意外'约束'(约束)。
当我运行脚本时,我得到:
Error Code: 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 'color_c constraint check (color in ('Red','Blue','Light Green','Yellow')))' at line 5 0.000 sec