The c_items.sql command file

The following command file creates the items table:
CREATE TABLE items
   (
   item_num          SMALLINT,
   order_num         INTEGER,
   stock_num         SMALLINT NOT NULL,
   manu_code         CHAR(3) NOT NULL,
   quantity          SMALLINT CHECK (quantity >= 1),
   total_price       MONEY(8),
   PRIMARY KEY (item_num, order_num),
   FOREIGN KEY (order_num) REFERENCES orders (order_num),
   FOREIGN KEY (stock_num, manu_code) REFERENCES stock
      (stock_num, manu_code)
   );

Copyright© 2019 HCL Technologies Limited