【发布时间】:2015-10-25 00:48:47
【问题描述】:
不断收到此错误:
ERROR 1064 (42000):您的 SQL 语法有错误;检查 与您的 MySQL 服务器版本相对应的手册 'Match(match_id INT(30) NOT NULL, club1_id) 附近使用的语法 CHAR(5), club1_score_id INT(30), club' 在第 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));
但看不出有什么问题。帮忙?
这是数据库设计。也不介意一些反馈。
【问题讨论】:
-
尝试在第一行的 Match 和 (
-
@scaisEdge 试过了,还是有问题。其他表之间也没有空格,并且有效。