CREATE TABLE invoice_inventory
(vendor_no char(4) not null,
invoice_no char(4) not null,
item_no char(4) not null references inventory_item(item_no),
quantity_added int not null,
item_paid decimal not null,
primary key (vendor_no,invoice_no,item_no))
FOREIGN KEY (vendor_no,invoice_no) REFERENCES invoice(vendor_no,invoice_no)
ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = INNODB CHARSET = tis620