我正在尝试查找此查询中的错误,但我找不到括号错误。他们看起来对我不对。错误代码是:
ORA-00907: missing right parentheses
以下是查询:
CREATE TABLE GRADE
(
COURSE_NO VARCHAR(100),
STUDENT_ID VARCHAR(100),
GRADE VARCHAR(1),
PRIMARY KEY (COURSE_NO, STUDENT_ID)
FOREIGN KEY (COURSE_NO)
REFERENCES COURSE(COURSE_NO),
FOREIGN KEY (STUDENT_ID)
REFERENCES STUDENT(STUDENT_ID),
FOREIGN KEY (GRADE)
REFERENCES GRADE_POINT (GRADE)
);
答案 0 :(得分:2)
此行中缺少逗号:
PRIMARY KEY (COURSE_NO, STUDENT_ID)
您的SQL必须是:
CREATE TABLE GRADE
(
COURSE_NO VARCHAR(100),
STUDENT_ID VARCHAR(100),
GRADE VARCHAR(1),
PRIMARY KEY (COURSE_NO, STUDENT_ID),
FOREIGN KEY (COURSE_NO)
REFERENCES COURSE(COURSE_NO),
FOREIGN KEY (STUDENT_ID)
REFERENCES STUDENT(STUDENT_ID),
FOREIGN KEY (GRADE)
REFERENCES GRADE_POINT (GRADE)
);