CREATE TABLE SORDER (
C_NO CHAR(4),
P_NO CHAR(4),
QUANTITY SMALLINT,
PRIMARY KEY (C_NO, P_NO),
CONSTRAINT CNO_FK FOREIGN KEY (C_NO) REFERENCES CUSTOMER ON DELETE RESTRICT,
CONSTRAINT PNO_FK FOREIGN KEY (P_NO) REFERENCES PRODUCT2 ON DELETE RESTRICT
);
ORA-00905: 缺少关键字
这是另外两张桌子。
CREATE TABLE PRODUCT2 (
P_NO CHAR(4) PRIMARY KEY,
P_NAME CHAR(6),
PRICES DECIMAL(3,2),
STOCK SMALLINT
);
CREATE TABLE CUSTOMER2 (
C_NO CHAR(4) PRIMARY KEY,
C_NAME CHAR(6),
CITY CHAR(11)
);