在Oracle sql live上运行时缺少右括号


CREATE TABLE Enrollment
(
OfferNo  NUMBER(10)  NOT NULL,
StdNo    CHAR(11)    NOT NULL,
EnrGrade NUMBER(3,2) NULL,
CONSTRAINT EnrollmentPK 
PRIMARY KEY (OfferNo, StdNo),
CONSTRAINT OfferingFK 
FOREIGN KEY (OfferNo) REFERENCES Offering
ON DELETE CASCADE
ON UPDATE CASCADE,
CONSTRAINT StudentFK 
FOREIGN KEY (StdNo) REFERENCES Student
ON DELETE CASCADE
ON UPDATE CASCADE
);

您缺少约束引用的列:

CREATE TABLE Enrollment(
OfferNo       NUMBER(10)       NOT NULL,
StdNo         CHAR(11)      NOT NULL,
EnrGrade      NUMBER(3,2)  NULL,
CONSTRAINT EnrollmentPK PRIMARY KEY (OfferNo, StdNo),
CONSTRAINT OfferingFK FOREIGN KEY (OfferNo) REFERENCES Offering(OfferNo)
-- Here --------------------------------------------------------^
ON DELETE CASCADE
ON UPDATE CASCADE,
CONSTRAINT StudentFK FOREIGN KEY (StdNo) REFERENCES Student(StdNo)
-- And here ------------------------------------------------^
ON DELETE CASCADE
ON UPDATE CASCADE
);

相关内容

  • 没有找到相关文章

最新更新