gpt4 book ai didi

mysql - SQL : a symbol name was expected

转载 作者:行者123 更新时间:2023-11-29 07:03:05 25 4
gpt4 key购买 nike

尝试将其实现到数据库中,到目前为止,其他类似的方法都有效。

create table participation (
team_id int(11) not null,
driver_id int(11) not null,
race_id int(11) not null,
points_earned int(11),
constraint part_pk primary key (team_id, driver_id, race_id),
constraint part_fk foreign key (team_id) references team (team_id) ON update cascade,
constraint part_fktwo foreign key (driver_id) references driver (driver_id) ON update cascade,
constraint part_fkthree foreign key (race_id) references race (race_id) ON update cascade,
)
engine=innodb;

最后一个括号处出现错误。

最佳答案

查询末尾有一个额外的逗号(最后一个外键约束):

create table participation (
team_id int(11) not null,
driver_id int(11) not null,
race_id int(11) not null,
points_earned int(11),
constraint part_pk primary key (team_id, driver_id, race_id),
constraint part_fk foreign key (team_id) references team (team_id) ON update cascade,
constraint part_fktwo foreign key (driver_id) references driver (driver_id) ON update cascade,
constraint part_fkthree foreign key (race_id) references race (race_id) ON update cascade
)
engine=innodb;

关于mysql - SQL : a symbol name was expected,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42680537/

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