直接复制你修改的
mysql> CREATE TABLE orderitem (
-> iid CHAR(32) PRIMARY KEY COMMENT '主键',
-> count INT COMMENT '数量',
-> subtotal DECIMAL(10,0) COMMENT '小计',
-> oid CHAR(32) COMMENT '所属订单',
-> bid CHAR(32) COMMENT '订单项所指的商品',
-> FOREIGN KEY (oid) REFERENCES orders (oid) COMMENT '建立主外键关系',
-> FOREIGN KEY (bid) REFERENCES book (bid) COMMENT '建立主外键关系'
-> );
ERROR 1064 (42000): 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 '建立主外键关系',
FOREIGN KEY (bid) REFERENCES book (bid) COMMENT' at line 7
mysql>