create table productinfotwo
(
productId number(10),
CONSTRAINT primary_pk Primary Key(productId),
productname varchar2(100),
SUBCATEGORYID number(10),
CONSTRAINT subcategory_fk Foreign Key(SUBCATEGORYID ) REFERENCES ProductSubCategory(SUBCATEGORYID ),
COMPANYID varchar2(20),
CONSTRAINT company_fk Foreign Key(COMPANYID ) References CompanyInfo(COMPANYID ),
price float,
quantity number(10),
description varchar2(1000),
);
答案 0 :(得分:1)
您需要按顺序使用
代码应为
CREATE TABLE productinfotwo
(
productid NUMBER(10),
CONSTRAINT primary_pk PRIMARY KEY(productid),
productname VARCHAR2(100),
subcategoryid NUMBER(10),
CONSTRAINT subcategory_fk FOREIGN KEY(subcategoryid ) REFERENCES
productsubcategory(subcategoryid ),
companyid VARCHAR2(20),
CONSTRAINT company_fk FOREIGN KEY(companyid ) REFERENCES companyinfo(
companyid ),
price NUMBER(4, 2),
quantity NUMBER(10),
description VARCHAR2(1000)
);