CREATE TABLE BILL(
BillNo INTEGER PRIMARY KEY,
StoreName VARCHAR2(20),
Shopperid NUMBER,
ArCode CHAR(5),
Amount NUMBER(5,2),
BillDate DATE,
Quantity NUMBER(4) DEFAULT 1 CHECK(Quantity>0),
CONSTRAINT storename_fk FOREIGN KEY(StoreName) REFERENCES STORE(StoreName),
CONSTRAINT shopperid_fk FOREIGN KEY(Shopperid) REFERENCES
SHOPPER(ShopperId),
CONSTRAINT Arcode_fk FOREIGN KEY(ArCode) REFERENCES ARTICLE(ArCode)
);
在INFYTQ在线门户中
CREATE TABLE BILL(
BillNo INTEGER PRIMARY KEY,
StoreName VARCHAR2(20),
Shopperid NUMBER,
ArCode CHAR(5),
Amount NUMBER(5,2),
BillDate DATE,
Quantity NUMBER(4) DEFAULT 1 CHECK(Quantity>0),
CONSTRAINT storename_fk FOREIGN KEY(StoreName) REFERENCES STORE(StoreName),
CONSTRAINT shopperid_fk FOREIGN KEY(Shopperid) REFERENCES
SHOPPER(ShopperId),
CONSTRAINT Arcode_fk FOREIGN KEY(ArCode) REFERENCES ARTICLE(ArCode)
);