gpt4 book ai didi

mysql - 错误 1064 (42000) : Error near 'Match( match_id INT(30) NOT NULL, club1_id CHAR(5), club1_score_id INT(30), club' at line 1

转载 作者:行者123 更新时间:2023-11-29 21:54:20 24 4
gpt4 key购买 nike

不断收到此错误:

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 'Match( match_id INT(30) NOT NULL, club1_id CHAR(5), club1_score_id INT(30), club' at line 1

尝试使用一些外键创建此表:

CREATE TABLE Match(
match_id INT(30) NOT NULL,
club1_id CHAR(5),
club1_score_id INT(30),
club2_id CHAR(5),
club2_score_id INT(30),
start_time TIME,
end_time TIME,
day INT(2),
event_id INT(30),
Primary Key(match_id),
Foreign Key(club1_id) REFERENCES Club(club_id),
Foreign Key(club2_id) REFERENCES Club(club_id),
Foreign Key(club1_score_id) REFERENCES Score(score_id),
Foreign Key(club2_score_id) REFERENCES Score(score_id),
Foreign Key(event_id) REFERENCES Event(event_id));

虽然看不出有什么问题。有帮助吗?

这是数据库设计。也不介意对此进行一些反馈。

Database Design

最佳答案

Match 是保留字。我建议将其更改为 Matches 这样您在使用它时就不必引用它。我通常以复数形式命名我的表,因为它们包含多个实体,并且复数不太可能与保留字冲突。

保留字列表为here .

关于mysql - 错误 1064 (42000) : Error near 'Match( match_id INT(30) NOT NULL, club1_id CHAR(5), club1_score_id INT(30), club' at line 1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33320557/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com