gpt4 book ai didi

mysql - SQL 创建表错误?

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

<分区>

我在mysql中使用如下sql语句:

CREATE TABLE "User"(
userId int NOT NULL AUTO_INCREMENT,
userRoleId int NOT NULL,
taalId int NOT NULL,
hotelId int NOT NULL,
gebruikersnaam varchar(40) NOT NULL,
wachtwoord varchar(40) NOT NULL,
email varchar(50) NOT NULL,
FOREIGN KEY (userRoleId) REFERENCES UserRole (userRoleId),
FOREIGN KEY (taalId) REFERENCES Taal (taalId),
FOREIGN KEY (hotelId) REFERENCES Hotel (hotelId),
PRIMARY KEY(userId)
);

但我得到以下 Mysql 错误:

#1064 - 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 '"User"( userId int NOT NULL AUTO_INCREMENT, userRoleId int NOT NULL, taalI' at line 1

出了什么问题?

编辑:UserRole、Taal 和 Hotel 表已正确创建,没有问题。

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