我是Oracle SQL的新手,并且在我们学习时学习它。我想知道我的SQL语句出了什么问题。我收到missing right parenthesis
错误:
CREATE TABLE hotel(
hotel_id number(8)
NOT NULL
CONSTRAINT hotel_pk
PRIMARY KEY,
user_id number(8)
NOT NULL,
CONSTRAINT user_fk FOREIGN KEY (user_id) REFERENCES users (user_id),
hotel_name varchar2(1024)
NOT NULL,
creation_date timestamp
NOT NULL
DEFAULT CURRENT_TIME
);
答案 0 :(得分:1)
您还有一个逗号,请参见下面的评论:
CREATE TABLE hotel(
hotel_id number(8)
NOT NULL
CONSTRAINT hotel_pk
PRIMARY KEY,
user_id number(8)
NOT NULL -- Comma was here
CONSTRAINT user_fk FOREIGN KEY (user_id) REFERENCES users (user_id),
hotel_name varchar2(1024)
NOT NULL,
creation_date timestamp
NOT NULL
DEFAULT CURRENT_TIME
);