CREATE TABLE detectives(
id INTEGER NOT NULL AUTO_INCREMENT,
first_name VARCHAR(50),
last_name VARCHAR(50) NOT NULL,
phone_number VARCHAR(10) NOT NULL,
certification_date DATE NOT NULL,
CONSTRAINT detectives_pk PRIMARY KEY (id
);
它说:' AUTO_INCREMENT'附近的语法不正确。
对此有何帮助?
答案 0 :(得分:2)
缺少结束)
并使用IDENTITY
字段的错误语法。
CREATE TABLE detectives(
id INT IDENTITY,
first_name VARCHAR(50),
last_name VARCHAR(50) NOT NULL,
phone_number VARCHAR(10) NOT NULL,
certification_date DATE NOT NULL,
CONSTRAINT detectives_pk PRIMARY KEY (id)
)
答案 1 :(得分:0)
更改
id INTEGER NOT NULL AUTO_INCREMENT,
要
ID INT NOT NULL IDENTITY(1,1),
答案 2 :(得分:0)
CREATE TABLE detectives(
id INT NOT NULL IDENTITY (1, 1),
first_name VARCHAR(50),
last_name VARCHAR(50) NOT NULL,
phone_number VARCHAR(10) NOT NULL,
certification_date DATE NOT NULL,
CONSTRAINT detectives_pk PRIMARY KEY (id)
);