我为nfl团队创建了一个数据库。我创建了一个名为player的表,其中包含bios信息。现在我想创建一个名为交易的表格,该表格显示交易交易,但玩家根据玩家的主键显示活跃的名单。但我不断收到此错误: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 'KEY(idplayer) REFERENCES players(playersid))' at line 8.
`
create table transactions(
transid INT UNSIGNED NOT NULL AUTO_INCREMENT,
type VARCHAR(30),
fromteam VARCHAR(30),
toteam VARCHAR(30),
idplayer INT UNSIGNED NOT NULL,
PRIMARY KEY(transid),
FORIEGN KEY(idplayer) REFERENCES players(playersid));
请有人帮我解决类似的经历。
答案 0 :(得分:1)
我想你刚拼错外国人: - )
答案 1 :(得分:0)
错字,改变
FORIEGN KEY(idplayer) REFERENCES players(playersid));
到
FOREIGN KEY(idplayer) REFERENCES players(playersid));