错误:在MySQL中创建表时,您的SQL语法中有错误
我知道什么是语法错误,但在创建此表时找不到任何错误: 我的代码
CREATE TABLE branch supplier (
branch_id INT,
supplier_name VARCHAR(40),
supply_type VARCHAR(40),
PRIMARY KEY (branch_id, supplier_name),
FOREIGN KEY (branch_id) REFERENCES branch(branch_id) ON DELETE CASCADE
);
和错误
您在SQL语法中有错误;查看与您的MySQL Server版本相对应的手册,以获取合适的语法,以便在“供应商”附近使用(branch_id int,supplier_name varchar(40),supply_type'在第1行
I know what a syntax error is but cannot find any error when creating this table:
my code
CREATE TABLE branch supplier (
branch_id INT,
supplier_name VARCHAR(40),
supply_type VARCHAR(40),
PRIMARY KEY (branch_id, supplier_name),
FOREIGN KEY (branch_id) REFERENCES branch(branch_id) ON DELETE CASCADE
);
and the error I'm getting
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 'supplier ( branch_id INT, supplier_name VARCHAR(40), supply_type ' at line 1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
除非您使用````否则不允许将表名与空间使用。这意味着您需要将其更改为...
或没有空间的东西,例如
It is not allowed to use table names with space(s) unless you use `. This means you need to change this to...
or to something without space, as example