--Databases

CREATE DATABASE PROD1;
CREATE DATABASE PROD2;
CREATE DATABASE PROD3;
CREATE DATABASE SYSTEST;


--PROD1 tables and data


DROP TABLE EXT.SUPPLIER;

DROP TABLE EXT.ADDRESS;

DROP TABLE EXT.CUSTOMER;

CREATE SCHEMA EXT;

CREATE TABLE EXT.SUPPLIER (
  ID INT NOT NULL,
  NAME VARCHAR(100),
  ADDRESS_ID INT, 
  PRIMARY KEY (ID)
  );
INSERT INTO EXT.SUPPLIER (ID,NAME,ADDRESS_ID) VALUES (1,'Morton Building Supplies Inc',15);
INSERT INTO EXT.SUPPLIER (ID,NAME,ADDRESS_ID) VALUES (2,'Z und B GmbH',14);
INSERT INTO EXT.SUPPLIER (ID,NAME,ADDRESS_ID) VALUES (3,'Betta Bricks Pty Ltd',13);
INSERT INTO EXT.SUPPLIER (ID,NAME,ADDRESS_ID) VALUES (4,'Zieglemann GmbH',12);
INSERT INTO EXT.SUPPLIER (ID,NAME,ADDRESS_ID) VALUES (5,'Cyclops Circuits Inc.',10);
INSERT INTO EXT.SUPPLIER (ID,NAME,ADDRESS_ID) VALUES (6,'Indian Lime Inc.',11);
INSERT INTO EXT.SUPPLIER (ID,NAME,ADDRESS_ID) VALUES (7,'Wang Lee Electric Corp.',16);
INSERT INTO EXT.SUPPLIER (ID,NAME,ADDRESS_ID) VALUES (8,'Elektro-Baumann GmbH',17);
INSERT INTO EXT.SUPPLIER (ID,NAME,ADDRESS_ID) VALUES (9,'ChemMix GmbH',18);

CREATE TABLE EXT.ADDRESS (
  ID INT NOT NULL,
  STREET VARCHAR(100), 
  TOWN VARCHAR(100),
  POSTAL_CODE VARCHAR(10), 
  COUNTRY VARCHAR(100), 
  TELEPHONE VARCHAR(20), 
  "E-MAIL" VARCHAR(100), 
  PRIMARY KEY (ID)
  );
INSERT INTO EXT.ADDRESS (ID, STREET, TOWN, POSTAL_CODE, COUNTRY, TELEPHONE, "E-MAIL") VALUES (1,'Industriestr. 19','Hünfeld',36888,'Germany','+49 8825 987409','info@argusman.de');
INSERT INTO EXT.ADDRESS (ID, STREET, TOWN, POSTAL_CODE, COUNTRY, TELEPHONE, "E-MAIL") VALUES (2,'88 Stark St','Gloversville NY',12078,'USA','+1 518 585 12345','info@samson-contruct.com');
INSERT INTO EXT.ADDRESS (ID, STREET, TOWN, POSTAL_CODE, COUNTRY, TELEPHONE, "E-MAIL") VALUES (3,'Langstr. 23','Zurich',8038,'Switzerland','+41 4498 7654','kontakt@schockland.ch');
INSERT INTO EXT.ADDRESS (ID, STREET, TOWN, POSTAL_CODE, COUNTRY, TELEPHONE, "E-MAIL") VALUES (4,'Schwannenweg 13','Gummersbach',51644,'Germany','+49 2233 4455','kontakt@schaffmann.eu');
INSERT INTO EXT.ADDRESS (ID, STREET, TOWN, POSTAL_CODE, COUNTRY, TELEPHONE, "E-MAIL") VALUES (5,'46 King St','Macquarie Fields NSW',2564,'Australia','+61 9145 8033','info@widgetry.com.au');
INSERT INTO EXT.ADDRESS (ID, STREET, TOWN, POSTAL_CODE, COUNTRY, TELEPHONE, "E-MAIL") VALUES (6,'29 Wanderers Ave','Johnstown NY',12095,'USA','+1 519 635 87654','contact@circularparts.com');
INSERT INTO EXT.ADDRESS (ID, STREET, TOWN, POSTAL_CODE, COUNTRY, TELEPHONE, "E-MAIL") VALUES (7,'Unter den Linden','Duisburg',48999,'Germany','+49 0288 35614','info@fapp-farben.de');
INSERT INTO EXT.ADDRESS (ID, STREET, TOWN, POSTAL_CODE, COUNTRY, TELEPHONE, "E-MAIL") VALUES (8,'Springerallee 49','Leipzig',04199,'Germany','+49 7341 88867','info@muellerraeder.de');
INSERT INTO EXT.ADDRESS (ID, STREET, TOWN, POSTAL_CODE, COUNTRY, TELEPHONE, "E-MAIL") VALUES (9,'1012 Fifteenth Ave','Chicago IL',50484,'USA','+1 876 54541','info@braeger.com');
INSERT INTO EXT.ADDRESS (ID, STREET, TOWN, POSTAL_CODE, COUNTRY, TELEPHONE, "E-MAIL") VALUES (10,'112 Central Ave','Fitzroy VIC',3049,'Australia','+61 9876 5454','info@cyclops-circuits.com');
INSERT INTO EXT.ADDRESS (ID, STREET, TOWN, POSTAL_CODE, COUNTRY, TELEPHONE, "E-MAIL") VALUES (11,'Peenya Industrial Area','Bangalor',561158,'India','+91 28377018','service@indianlime.com');
INSERT INTO EXT.ADDRESS (ID, STREET, TOWN, POSTAL_CODE, COUNTRY, TELEPHONE, "E-MAIL") VALUES (12,'Hochstr. 22-24','Pullach',89643,'Germany','+49 89 8080 1711','service@ziegelmann.de');
INSERT INTO EXT.ADDRESS (ID, STREET, TOWN, POSTAL_CODE, COUNTRY, TELEPHONE, "E-MAIL") VALUES (13,'8 Stockton St','Manchester','M2 4WU','UK','+44 0161 123 4567','info@bettabricks.co.uk');
INSERT INTO EXT.ADDRESS (ID, STREET, TOWN, POSTAL_CODE, COUNTRY, TELEPHONE, "E-MAIL") VALUES (14,'Kaltenheimerstr 25','Hannover',30499,'Germany','+49 2495 6776','Kontakt@zunb-hannover.eu');
INSERT INTO EXT.ADDRESS (ID, STREET, TOWN, POSTAL_CODE, COUNTRY, TELEPHONE, "E-MAIL") VALUES (15,'95 Main St','Cleveland Oh.',44147,'USA','+1 581 678 12345','info@mortonbs.com');
INSERT INTO EXT.ADDRESS (ID, STREET, TOWN, POSTAL_CODE, COUNTRY, TELEPHONE, "E-MAIL") VALUES (16,'1091 Ruiguang Rd','Taipei',11688,'Taipei','+886 938 4691','service@wang-lee-electric.com.tw');
INSERT INTO EXT.ADDRESS (ID, STREET, TOWN, POSTAL_CODE, COUNTRY, TELEPHONE, "E-MAIL") VALUES (17,'Hellmannstr. 96','Düsseldorf',53600,'Germany','+204 2345 9876','info@elektro-baumann.de');
INSERT INTO EXT.ADDRESS (ID, STREET, TOWN, POSTAL_CODE, COUNTRY, TELEPHONE, "E-MAIL") VALUES (18,'Münchallee 42','Wuppertal',50591,'Germany','+49 2555 9187','info@chem-mix.de');

CREATE TABLE EXT.CUSTOMER (
  ID INT NOT NULL,
  NAME VARCHAR(100),
  ADDRESS_ID INT,  
  PRIMARY KEY (ID)
  );
INSERT INTO EXT.CUSTOMER (ID,NAME,ADDRESS_ID) VALUES(1,'Argus Manufacturing GmbH',1);
INSERT INTO EXT.CUSTOMER (ID,NAME,ADDRESS_ID) VALUES(2,'Samson Construction Corp.',2);
INSERT INTO EXT.CUSTOMER (ID,NAME,ADDRESS_ID) VALUES(3,'Schockland AG',3);
INSERT INTO EXT.CUSTOMER (ID,NAME,ADDRESS_ID) VALUES(4,'Schaffmann Chemie GmbH',4);
INSERT INTO EXT.CUSTOMER (ID,NAME,ADDRESS_ID) VALUES(5,'Widget Creations Pty Ltd',5);
INSERT INTO EXT.CUSTOMER (ID,NAME,ADDRESS_ID) VALUES(6,'Circular Parts Inc.',6);
INSERT INTO EXT.CUSTOMER (ID,NAME,ADDRESS_ID) VALUES(7,'FAPP GmbH',7);
INSERT INTO EXT.CUSTOMER (ID,NAME,ADDRESS_ID) VALUES(8,'Müller Autoräder GmbH',8);
INSERT INTO EXT.CUSTOMER (ID,NAME,ADDRESS_ID) VALUES(9,'Braeger Paints Pty Ltd',9);
INSERT INTO EXT.CUSTOMER (ID,NAME,ADDRESS_ID) VALUES(10,'Cyclops Circuits Inc.',10);


--PROD2 tables and data


DROP TABLE INV.ITEMS;

DROP TABLE INV.ITEM_SUPPLIER;

DROP TABLE INV.PROC_ORDER;

CREATE SCHEMA INV;

CREATE TABLE INV.ITEMS(
  ID INT NOT NULL, 
  DESCRIPTION VARCHAR(254), 
  QUANTITY_IN_STOCK INT,
  MINIMUM_QUANTITY INT, 
  UNITS VARCHAR(20), 
  LOCATION VARCHAR(100),
  PRIMARY KEY (ID)
  );
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (1,'screw 5mm x 50mm',8000,1000,'Packet 100','SB01');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (2,'screw 5mm x 80mm',9000,1000,'Packet 100','SB02');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (3,'screw 8mm x 50mm',8500,1000,'Packet 100','SB03');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (4,'screw 8mm x 100mm',9500,1000,'Packet 100','SB04');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (5,'nut 5mm',7500,2000,'Packet 100','SB05');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (6,'nut 8mm',7500,2000,'Packet 100','SB06');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (7,'washer 5.2mm diameter 10mm',8000,1000,'Packet 100','SB07');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (8,'washer 5.2mm diameter 15mm',6000,1000,'Packet 100','SB08');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (9,'washer 8.2mm diameter 15mm',8000,1000,'Packet 100','SB09');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (10,'washer 8.2mm diameter 20mm',8000,1000,'Packet 100','SB10');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (11,'bolt 10mm x100mm',5000,500,'Packet 50','SB11');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (12,'bolt 10mm x150mm',5000,500,'Packet 50','SB12');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (13,'bolt 12mm x100mm',8000,500,'Packet 50','SB13');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (14,'bolt 12mm x150mm',9000,500,'Packet 50','SB14');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (15,'nut 10mm',0,1000,'Packet 50','SB15');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (16,'nut 12mm',2000,1000,'Packet 50','SB16');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (17,'washer 10.2mm diameter 20mm',0,500,'Packet 50','SB17');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (18,'washer 12.2mm diameter 20mm',2000,500,'Packet 50','SB18');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (19,'washer 10.2mm diameter 28mm',5000,500,'Packet 50','SB19');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (20,'washer 12.2mm diameter 28mm',5000,500,'Packet 50','SB20');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (101,'linseed oil',350,50,'liter','P01');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (102,'benzol',300,50,'liter','P02');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (103,'acetone',290,50,'liter','P03');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (104,'blue pigment',35,10,'500ml tube','P04');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (105,'green pigment',50,10,'500ml tube','P05');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (106,'red pigment',30,10,'500ml tube','P06');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (107,'yellow pigment',40,10,'500ml tube','P07');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (108,'orange pigment',100,10,'500ml tube','P08');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (109,'violet pigment',100,10,'500ml tube','P09');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (110,'titanium oxide',10,20,'kilogram','P10');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (111,'soya bean oil',550,50,'liter','P11');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (112,'acrylic resin',1100,50,'liter','P12');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (201,'box girder',400,20,'10 meters each','C01');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (202,'20cm I-beam',400,20,'10 meters each','C02');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (203,'30cm I-beam',450,15,'10 meters each','C03');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (204,'wooden joist 4cm x 6cm',60,30,'4 meters each','C04');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (205,'wooden joist 5cm x 8cm',40,30,'4 meters each','C05');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (206,'wood beam 10cm x 20cm',30,20,'8 meters each','C06');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (207,'brick 194 × 92 × 57mm',5100,1000,'Packet 50','C07');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (208,'brick 240 × 115 × 71mm',7200,1000,'Packet 50','C08');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (209,'nail 10cm',11350,5000,'Packet 50','C09');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (210,'nail 15cm',9950,5000,'Packet 50','C10');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (211,'nail 6 cm',18100,5000,'Packet 100','C11');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (212,'cement',500,100,'20 kilogram sack','C12');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (213,'sand',380,50,'tonne','C13');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (301,'copper wire 1mm',550,100,'meter','EL01');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (302,'copper wire 2mm',610,100,'meter','EL02');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (303,'copper wire 3mm',380,100,'meter','EL03');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (304,'insulation tape',310,50,'20 meter roll','EL04');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (305,'electric cable',599,100,'meter','EL05');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (306,'solder',2155,100,'kilogram','EL06');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (307,'solder',250,50,'5 meter roll','EL07');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (308,'carbon brushes 5mm x 10mm',190,100,'piece','EL08');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (309,'carbon brushes 10mm x 20mm',100,100,'piece','EL09');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (310,'carbon brushes 15mm x 30mm',200,100,'piece','EL10');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (401,'500W generator',15,2,'piece','EL11');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (402,'2000W generator',4,2,'piece','EL12');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (501,'controller/regulator',20,2,'piece','EL13');
INSERT INTO INV.ITEMS (ID, DESCRIPTION, QUANTITY_IN_STOCK, MINIMUM_QUANTITY, UNITS, LOCATION) VALUES (502,'thermostat',8,2,'piece','EL14');


CREATE TABLE INV.ITEM_SUPPLIER (
  ITEM_ID INT NOT NULL,
  SUPPLIER_ID INT NOT NULL, 
  SOURCE_ID INT, 
  DIRECT_SUPPLIER CHAR(1), 
  PRIMARY KEY (ITEM_ID, SUPPLIER_ID)
  );
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(1,1,null,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(2,1,null,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(3,1,null,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(4,1,null,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(1,4,2,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(2,4,2,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(3,4,2,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(4,4,2,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(5,1,null,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(6,1,null,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(7,1,null,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(8,1,null,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(9,1,null,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(10,1,null,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(11,1,null,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(12,1,null,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(13,1,null,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(14,1,null,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(15,1,null,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(16,1,null,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(17,1,null,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(18,1,null,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(19,1,null,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(20,1,null,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(1,2,null,'N');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(2,2,null,'N');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(3,2,null,'N');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(4,2,null,'N');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(5,4,2,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(6,4,2,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(7,4,2,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(8,4,2,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(9,4,2,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(10,4,2,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(11,4,2,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(12,4,2,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(13,4,2,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(14,4,2,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(15,4,2,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(16,4,2,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(17,4,2,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(18,4,2,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(19,4,2,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(20,4,2,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(101,9,null,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(102,9,null,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(103,9,null,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(104,9,6,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(105,9,6,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(106,9,6,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(107,9,6,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(108,9,6,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(109,9,6,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(110,9,null,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(111,9,null,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(112,9,null,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(5,2,null,'N');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(6,2,null,'N');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(7,2,null,'N');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(8,2,null,'N');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(9,2,null,'N');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(10,2,null,'N');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(11,2,null,'N');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(12,2,null,'N');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(13,2,null,'N');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(14,2,null,'N');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(15,2,null,'N');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(16,2,null,'N');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(17,2,null,'N');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(18,2,null,'N');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(19,2,null,'N');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(20,2,null,'N');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(104,6,null,'N');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(105,6,null,'N');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(107,6,null,'N');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(108,6,null,'N');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(109,6,null,'N');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(201,2,1,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(202,2,1,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(203,2,1,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(204,2,1,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(205,2,1,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(206,2,1,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(207,3,null,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(208,3,null,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(209,3,4,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(210,3,4,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(211,3,4,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(212,3,4,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(213,3,4,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(201,1,null,'N');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(202,1,null,'N');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(203,1,null,'N');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(204,1,null,'N');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(205,1,null,'N');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(206,1,null,'N');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(209,4,null,'N');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(210,4,null,'N');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(211,4,null,'N');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(212,4,6,'N');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(212,6,null,'N');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(213,4,null,'N');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(301,8,null,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(302,8,null,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(303,8,null,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(304,8,null,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(305,8,null,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(306,8,null,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(307,8,null,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(308,8,7,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(309,8,7,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(310,8,7,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(401,8,7,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(402,8,7,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(501,7,null,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(502,7,null,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(501,10,null,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(502,10,null,'Y');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(308,7,null,'N');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(309,7,null,'N');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(310,7,null,'N');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(401,7,null,'N');
INSERT INTO INV.ITEM_SUPPLIER (ITEM_ID, SUPPLIER_ID, SOURCE_ID, DIRECT_SUPPLIER) VALUES(402,7,null,'N'); 


CREATE TABLE INV.PROC_ORDER (
  ID INT NOT NULL, 
  ITEM_ID INT, 
  SUPPLIER_ID INT, 
  QUANTITY INT, 
  DATE_OF_ORDER DATE,
  FULFILLED CHAR(1) DEFAULT 'N',
  PRIMARY KEY (ID)
  );
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(1,1,1,10000,'2022-05-03','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(2,2,1,10000,'2022-05-03','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(3,3,1,10000,'2022-05-03','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(4,4,1,10000,'2022-05-03','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(5,1,4,10000,'2022-05-31','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(6,2,4,10000,'2022-05-31','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(7,3,4,10000,'2022-05-31','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(8,4,4,10000,'2022-05-31','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(9,5,1,10000,'2022-05-31','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(10,6,1,10000,'2022-05-31','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(11,7,1,10000,'2022-05-31','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(12,8,1,5000,'2022-05-31','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(13,9,1,10000,'2022-05-31','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(14,10,1,10000,'2022-05-31','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(15,11,1,10000,'2022-05-31','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(16,12,1,5000,'2022-05-31','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(17,13,1,5000,'2022-05-31','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(18,14,1,5000,'2022-05-31','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(19,15,1,10000,'2022-05-31','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(20,16,1,10000,'2022-05-31','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(21,17,1,10000,'2022-05-31','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(22,18,1,5000,'2022-05-31','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(23,19,1,5000,'2022-05-31','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(24,20,1,5000,'2022-05-31','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(25,101,9,500,'2022-05-31','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(26,102,9,500,'2022-05-31','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(27,103,9,500,'2022-05-31','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(28,104,9,100,'2022-05-31','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(29,105,9,100,'2022-05-31','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(30,106,9,100,'2022-05-31','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(31,107,9,100,'2022-05-31','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(32,108,9,100,'2022-05-31','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(33,109,9,100,'2022-05-31','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(34,110,9,200,'2022-05-31','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(35,111,9,1000,'2022-05-31','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(36,112,9,1500,'2022-05-31','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(37,201,2,500,'2202-06-01','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(38,202,2,500,'2202-06-01','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(39,203,2,500,'2202-06-01','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(40,204,2,100,'2202-06-01','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(41,205,2,100,'2202-06-01','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(42,206,2,100,'2202-06-01','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(43,207,3,9000,'2202-06-01','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(44,208,3,9000,'220-06-01','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(45,209,3,15000,'2202-06-01','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(46,210,3,15000,'2202-06-01','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(47,211,3,20000,'2202-06-01','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(48,212,3,600,'2202-06-01','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(49,213,3,400,'2202-06-01','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(50,301,8,1000,'2202-06-01','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(51,302,8,1000,'2202-06-01','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(52,303,8,1000,'2202-06-01','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(53,304,8,500,'2202-06-01','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(54,305,8,1000,'2202-06-01','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(55,306,8,2500,'2202-06-01','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(56,307,8,300,'2202-06-01','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(57,308,8,300,'2202-06-01','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(58,309,8,250,'2202-06-01','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(59,310,8,250,'2202-06-01','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(60,401,8,5,'2202-06-01','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(61,402,8,5,'2202-06-01','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(62,501,7,15,'2202-06-01','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(63,502,7,5,'2202-06-01','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(64,501,10,15,'2202-06-06','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(65,502,10,10,'2202-06-06','Y');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(66,15,1,20000,'2022-10-06','N');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(67,12,1,10000,'2022-10-06','N');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(68,17,1,20000,'2022-10-06','N');
INSERT INTO INV.PROC_ORDER (ID, ITEM_ID, SUPPLIER_ID, QUANTITY, DATE_OF_ORDER, FULFILLED) VALUES(69,110,9,200,'2022-10-17','N');


--PROD3 tables and data


DROP TABLE ORD.ORDER_ITEMS;

DROP TABLE ORD.CUST_ORDER;

DROP TABLE ORD.DISPATCH;

CREATE SCHEMA ORD;

CREATE TABLE ORD.ORDER_ITEMS (
  ORDER_ID INT NOT NULL, 
  ITEM_ID INT NOT NULL, 
  QUANTITY INT,  
  PRIMARY KEY (ORDER_ID, ITEM_ID)
  );
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(1,301,300);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(1,302,300);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(1,303,300);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(1,304,190);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(1,305,300);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(1,306,345);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(1,501,10);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(2,305,101);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(2,301,150);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(2,302,90);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(2,303,220);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(2,307,50);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(2,308,110);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(2,309,150);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(2,310,50);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(3,501,5);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(3,502,7);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(4,212,60);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(4,213,10);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(4,209,400);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(4,210,3000);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(4,211,1000);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(4,204,20);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(4,205,30);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(4,206,40);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(4,201,100);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(4,202,100);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(4,203,50);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(5,212,40);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(5,213,10);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(5,209,250);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(5,210,2050);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(5,211,900);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(5,204,20);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(5,205,30);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(5,206,30);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(6,1,1000);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(6,3,1000);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(6,5,1000);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(6,6,1000);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(6,7,2000);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(6,9,2000);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(7,1,1000);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(7,2,1000);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(7,3,500);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(7,4,500);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(7,5,2000);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(7,6,1000);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(7,10,2000);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(7,8,4000);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(8,11,5000);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(8,12,5000);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(8,13,2000);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(8,14,1000);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(8,15,10000);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(8,16,3000);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(8,17,10000);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(8,18,3000);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(9,101,150);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(9,103,110);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(9,104,25);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(9,106,50);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(9,105,30);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(9,110,90);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(9,111,450);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(10,102,200);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(10,103,100);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(10,104,40);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(10,107,60);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(10,105,40);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(10,110,90);
INSERT INTO ORD.ORDER_ITEMS (ORDER_ID, ITEM_ID, QUANTITY) VALUES(10,112,400);


CREATE TABLE ORD.CUST_ORDER (
  ID INT NOT NULL, 
  CUSTOMER_ID INT, 
  DATE_OF_ORDER DATE,  
  PRIMARY KEY (ID)
  );
INSERT INTO ORD.CUST_ORDER (ID, CUSTOMER_ID, DATE_OF_ORDER) VALUES(1,3,'2022-09-01');
INSERT INTO ORD.CUST_ORDER (ID, CUSTOMER_ID, DATE_OF_ORDER) VALUES(2,10,'2022-09-02');
INSERT INTO ORD.CUST_ORDER (ID, CUSTOMER_ID, DATE_OF_ORDER) VALUES(3,5,'2022-09-02');
INSERT INTO ORD.CUST_ORDER (ID, CUSTOMER_ID, DATE_OF_ORDER) VALUES(4,2,'2022-09-08');
INSERT INTO ORD.CUST_ORDER (ID, CUSTOMER_ID, DATE_OF_ORDER) VALUES(5,7,'2022-09-08');
INSERT INTO ORD.CUST_ORDER (ID, CUSTOMER_ID, DATE_OF_ORDER) VALUES(6,5,'2022-09-15');
INSERT INTO ORD.CUST_ORDER (ID, CUSTOMER_ID, DATE_OF_ORDER) VALUES(7,6,'2022-10-04');
INSERT INTO ORD.CUST_ORDER (ID, CUSTOMER_ID, DATE_OF_ORDER) VALUES(8,1,'2022-10-05');
INSERT INTO ORD.CUST_ORDER (ID, CUSTOMER_ID, DATE_OF_ORDER) VALUES(9,4,'2022-10-06');
INSERT INTO ORD.CUST_ORDER (ID, CUSTOMER_ID, DATE_OF_ORDER) VALUES(10,9,'2022-10-19');


CREATE TABLE ORD.DISPATCH (
  ORDER_ID INT NOT NULL, 
  CUSTOMER_ID INT NOT NULL, 
  ADDRESS_ID INT NOT NULL, 
  DATE_OF_SHIPMENT DATE
  );
INSERT INTO ORD.DISPATCH (ORDER_ID, CUSTOMER_ID, ADDRESS_ID, DATE_OF_SHIPMENT) VALUES(1,3,3,'2022-09-05');
INSERT INTO ORD.DISPATCH (ORDER_ID, CUSTOMER_ID, ADDRESS_ID, DATE_OF_SHIPMENT) VALUES(2,10,10,'2022-09-05');
INSERT INTO ORD.DISPATCH (ORDER_ID, CUSTOMER_ID, ADDRESS_ID, DATE_OF_SHIPMENT) VALUES(3,5,5,'2022-09-05');
INSERT INTO ORD.DISPATCH (ORDER_ID, CUSTOMER_ID, ADDRESS_ID, DATE_OF_SHIPMENT) VALUES(4,2,2,'2022-09-12');
INSERT INTO ORD.DISPATCH (ORDER_ID, CUSTOMER_ID, ADDRESS_ID, DATE_OF_SHIPMENT) VALUES(5,7,7,'2022-09-12');
INSERT INTO ORD.DISPATCH (ORDER_ID, CUSTOMER_ID, ADDRESS_ID, DATE_OF_SHIPMENT) VALUES(6,5,5,'2022-09-19');
INSERT INTO ORD.DISPATCH (ORDER_ID, CUSTOMER_ID, ADDRESS_ID, DATE_OF_SHIPMENT) VALUES(7,6,6,'2022-10-06');
INSERT INTO ORD.DISPATCH (ORDER_ID, CUSTOMER_ID, ADDRESS_ID, DATE_OF_SHIPMENT) VALUES(8,1,1,'2022-10-07');
INSERT INTO ORD.DISPATCH (ORDER_ID, CUSTOMER_ID, ADDRESS_ID, DATE_OF_SHIPMENT) VALUES(9,4,4,'2022-10-10');