我在'CREATE TABLE ORDER(')的以下Test-SQL-Code中收到语法错误:
CREATE TABLE CLIENT(
CLIENT_ID BIGINT AUTO_INCREMENT PRIMARY KEY,
LAST_NAME VARCHAR(16) NOT NULL,
FIRST_NAME VARCHAR(16) NOT NULL,
STREET_ADDRESS VARCHAR(100) NOT NULL,
APARTMENT_NUMBER VARCHAR(20) NOT NULL,
CITY VARCHAR(50) NOT NULL,
ZIP_CODE VARCHAR(10) NOT NULL
);
CREATE TABLE ORDER(
ORDER_ID BIGINT AUTO_INCREMENT PRIMARY KEY,
CLIENT_ID BIGINT NOT NULL,
DATE_ORDERED BIGINT NOT NULL,
SUM FLOAT NOT NULL
);
答案 0 :(得分:1)
order是最好不要使用的关键字,但是如果需要,请使用双引号
CREATE TABLE "ORDER"(
ORDER_ID BIGINT AUTO_INCREMENT PRIMARY KEY,
CLIENT_ID BIGINT NOT NULL,
DATE_ORDERED BIGINT NOT NULL,
SUM FLOAT NOT NULL
);