CREATE TABLE SUPPLIERS(	sid	INTEGER,
			sname	VARCHAR(80),
			address	VARCHAR(100),
			PRIMARY KEY (sid));

CREATE TABLE PARTS(	pid	INTEGER,
			pname	VARCHAR(80),
			color	VARCHAR(15),
			PRIMARY KEY (pid));

CREATE TABLE CATALOG(	sid	INTEGER,
			pid	INTEGER,
			cost	FLOAT,
			PRIMARY KEY (sid, pid),
			FOREIGN KEY (sid) REFERENCES SUPPLIERS,
			FOREIGN KEY (pid) REFERENCES PARTS);

INSERT INTO SUPPLIERS(sid, sname, address)
VALUES (15, 'ACME Widget Company', 'Newark, NJ 01234');

INSERT INTO SUPPLIERS(sid, sname, address)
VALUES (16, 'Road Runner', 'Santa Fe, NM 12342');

INSERT INTO SUPPLIERS(sid, sname, address)
VALUES (19, 'Ashley Chair Suppliers', 'Philadelphia, PA 19102');

INSERT INTO SUPPLIERS(sid, sname, address)
VALUES (20, 'ValuFurniture', 'Charlotte, NC 23786');

INSERT INTO SUPPLIERS(sid, sname, address)
VALUES (21, 'Furniture Mart', 'Miami, FL 33102');

INSERT INTO SUPPLIERS(sid, sname, address)
VALUES (22, 'KMart', 'Philadelphia, PA 19107');

INSERT INTO PARTS(pid, pname, color)
VALUES (82, 'Key Chain Remote', 'Green');

INSERT INTO PARTS(pid, pname, color)
VALUES (83, 'Burglary Alert Door Lock', 'Brown');

INSERT INTO PARTS(pid, pname, color)
VALUES (100, 'Leather Managers Chair', 'Black');

INSERT INTO PARTS(pid, pname, color)
VALUES (101, 'Fabric Managers Chair', 'Grey');

INSERT INTO PARTS(pid, pname, color)
VALUES (102, 'Deluxe Chair', 'Red');

INSERT INTO PARTS(pid, pname, color)
VALUES (103, 'Task Chair', 'Red');

INSERT INTO PARTS(pid, pname, color)
VALUES (104, 'Folding Chair', 'Red');

INSERT INTO PARTS(pid, pname, color)
VALUES (105, 'Massage Chair', 'Blue');

INSERT INTO PARTS(pid, pname, color)
VALUES (800, 'Mountain Bike', 'Blue');

INSERT INTO PARTS(pid, pname, color)
VALUES (900, '6 Megapixels Digital Camera', 'Grey');

INSERT INTO PARTS(pid, pname, color)
VALUES (1000, 'Table Cloth', 'Green');

INSERT INTO CATALOG(sid, pid, cost)
VALUES (15, 82, 9.99);

INSERT INTO CATALOG(sid, pid, cost)
VALUES (15, 83, 29.99);

INSERT INTO CATALOG(sid, pid, cost)
VALUES (16, 82, 9.99);

INSERT INTO CATALOG(sid, pid, cost)
VALUES (19, 100, 65.95);

INSERT INTO CATALOG(sid, pid, cost)
VALUES (19, 101, 45.95);

INSERT INTO CATALOG(sid, pid, cost)
VALUES (19, 102, 105.95);

INSERT INTO CATALOG(sid, pid, cost)
VALUES (19, 103, 25.95);

INSERT INTO CATALOG(sid, pid, cost)
VALUES (19, 104, 35.95);

INSERT INTO CATALOG(sid, pid, cost)
VALUES (20, 102, 75.95);

INSERT INTO CATALOG(sid, pid, cost)
VALUES (21, 102, 99.95);

INSERT INTO CATALOG(sid, pid, cost)
VALUES (21, 103, 29.95);

INSERT INTO CATALOG(sid, pid, cost)
VALUES (21, 104, 31.95);

INSERT INTO CATALOG(sid, pid, cost)
VALUES (22, 82, 9.99);

INSERT INTO CATALOG(sid, pid, cost)
VALUES (22, 104, 28.95);

INSERT INTO CATALOG(sid, pid, cost)
VALUES (22, 800, 199.95);

INSERT INTO CATALOG(sid, pid, cost)
VALUES (22, 900, 1099.95);

INSERT INTO CATALOG(sid, pid, cost)
VALUES (22, 1000, 4.95);


CREATE TABLE EMPY(	eid	INTEGER,
			ename	VARCHAR(50),
			age	INTEGER,
			salary	FLOAT,
			PRIMARY KEY (eid));

CREATE TABLE DEPT(	did	INTEGER,
                       	budget	FLOAT,
			managerid	INTEGER,
			PRIMARY KEY (did),
			FOREIGN KEY (managerid) REFERENCES EMPY);

CREATE TABLE WORKS(	eid	INTEGER,
			did	INTEGER,
			pct_time	INTEGER,
			PRIMARY KEY (eid, did),
			FOREIGN KEY (eid) REFERENCES EMPY,
			FOREIGN KEY (did) REFERENCES DEPT);

INSERT INTO EMPY(eid, ename, age, salary)
VALUES (1, 'George', 45, 200000);

INSERT INTO EMPY(eid, ename, age, salary)
VALUES (2, 'Jack', 33, 100000);

INSERT INTO EMPY(eid, ename, age, salary)
VALUES (3, 'Mary', 29, 100000);

INSERT INTO EMPY(eid, ename, age, salary)
VALUES (11, 'Worker1', 45, 20000);

INSERT INTO EMPY(eid, ename, age, salary)
VALUES (12, 'Worker2', 50, 38000);

INSERT INTO EMPY(eid, ename, age, salary)
VALUES (13, 'Worker3', 42, 50000);

INSERT INTO EMPY(eid, ename, age, salary)
VALUES (14, 'Worker4', 40, 24000);

INSERT INTO EMPY(eid, ename, age, salary)
VALUES (15, 'Worker5', 36, 38000);

INSERT INTO EMPY(eid, ename, age, salary)
VALUES (16, 'Worker6', 37, 44000);

INSERT INTO EMPY(eid, ename, age, salary)
VALUES (17, 'Worker7', 23, 20000);

INSERT INTO EMPY(eid, ename, age, salary)
VALUES (18, 'Worker8', 29, 42000);

INSERT INTO EMPY(eid, ename, age, salary)
VALUES (19, 'Worker9', 49, 34000);

INSERT INTO EMPY(eid, ename, age, salary)
VALUES (20, 'Worker10', 39, 38000);

INSERT INTO EMPY(eid, ename, age, salary)
VALUES (21, 'Worker11', 58, 34000);

INSERT INTO EMPY(eid, ename, age, salary)
VALUES (22, 'Worker12', 27, 24000);

INSERT INTO EMPY(eid, ename, age, salary)
VALUES (23, 'Worker13', 26, 21000);

INSERT INTO EMPY(eid, ename, age, salary)
VALUES (24, 'Worker14', 51, 29000);

INSERT INTO EMPY(eid, ename, age, salary)
VALUES (25, 'Worker15', 55, 26000);

INSERT INTO EMPY(eid, ename, age, salary)
VALUES (26, 'Worker16', 43, 34000);

INSERT INTO EMPY(eid, ename, age, salary)
VALUES (27, 'Worker17', 49, 35000);

INSERT INTO EMPY(eid, ename, age, salary)
VALUES (28, 'Worker18', 28, 46000);

INSERT INTO EMPY(eid, ename, age, salary)
VALUES (29, 'Worker19', 29, 29000);

INSERT INTO EMPY(eid, ename, age, salary)
VALUES (30, 'Worker20', 29, 36000);

INSERT INTO EMPY(eid, ename, age, salary)
VALUES (31, 'Worker21', 39, 38000);

INSERT INTO EMPY(eid, ename, age, salary)
VALUES (32, 'Worker22', 32, 40000);

INSERT INTO EMPY(eid, ename, age, salary)
VALUES (33, 'Worker23', 32, 28000);

INSERT INTO EMPY(eid, ename, age, salary)
VALUES (34, 'Worker24', 33, 25000);

INSERT INTO EMPY(eid, ename, age, salary)
VALUES (35, 'Worker25', 32, 20000);

INSERT INTO EMPY(eid, ename, age, salary)
VALUES (36, 'Worker26', 29, 30000);

INSERT INTO EMPY(eid, ename, age, salary)
VALUES (37, 'Worker27', 51, 39000);

INSERT INTO EMPY(eid, ename, age, salary)
VALUES (38, 'Worker28', 54, 32000);

INSERT INTO EMPY(eid, ename, age, salary)
VALUES (39, 'Worker29', 45, 35000);

INSERT INTO EMPY(eid, ename, age, salary)
VALUES (40, 'Worker30', 44, 20000);

INSERT INTO EMPY(eid, ename, age, salary)
VALUES (41, 'Worker31', 34, 30000);

INSERT INTO DEPT(did, budget, managerid)
VALUES (1, 1500000, 2);

INSERT INTO DEPT(did, budget, managerid)
VALUES (2, 3000000, 1);

INSERT INTO DEPT(did, budget, managerid)
VALUES (3, 600000, 3);

INSERT INTO DEPT(did, budget, managerid)
VALUES (4, 6000000, 1);

INSERT INTO DEPT(did, budget, managerid)
VALUES (5, 5000000, 1);


INSERT INTO WORKS(eid, did, pct_time)
VALUES (2, 2, 100);

INSERT INTO WORKS(eid, did, pct_time)
VALUES (1, 4, 45);

INSERT INTO WORKS(eid, did, pct_time)
VALUES (1, 5, 55);

INSERT INTO WORKS(eid, did, pct_time)
VALUES (3, 1, 70);

INSERT INTO WORKS(eid, did, pct_time)
VALUES (3, 3, 30);

INSERT INTO WORKS(eid, did, pct_time)
VALUES (11, 4, 50);

INSERT INTO WORKS(eid, did, pct_time)
VALUES (11, 2, 50);

INSERT INTO WORKS(eid, did, pct_time)
VALUES (12, 4, 100);

INSERT INTO WORKS(eid, did, pct_time)
VALUES (13, 4, 100);

INSERT INTO WORKS(eid, did, pct_time)
VALUES (14, 4, 100);

INSERT INTO WORKS(eid, did, pct_time)
VALUES (15, 4, 100);

INSERT INTO WORKS(eid, did, pct_time)
VALUES (16, 4, 50);

INSERT INTO WORKS(eid, did, pct_time)
VALUES (16, 3, 50);

INSERT INTO WORKS(eid, did, pct_time)
VALUES (17, 4, 100);

INSERT INTO WORKS(eid, did, pct_time)
VALUES (18, 4, 100);

INSERT INTO WORKS(eid, did, pct_time)
VALUES (19, 4, 100);

INSERT INTO WORKS(eid, did, pct_time)
VALUES (20, 4, 10);

INSERT INTO WORKS(eid, did, pct_time)
VALUES (20, 1, 40);

INSERT INTO WORKS(eid, did, pct_time)
VALUES (20, 2, 50);

INSERT INTO WORKS(eid, did, pct_time)
VALUES (21, 4, 90);

INSERT INTO WORKS(eid, did, pct_time)
VALUES (21, 2, 10);

INSERT INTO WORKS(eid, did, pct_time)
VALUES (22, 4, 100);

INSERT INTO WORKS(eid, did, pct_time)
VALUES (23, 4, 100);

INSERT INTO WORKS(eid, did, pct_time)
VALUES (24, 4, 70);

INSERT INTO WORKS(eid, did, pct_time)
VALUES (24, 5, 30);

INSERT INTO WORKS(eid, did, pct_time)
VALUES (25, 4, 100);

INSERT INTO WORKS(eid, did, pct_time)
VALUES (26, 4, 100);

INSERT INTO WORKS(eid, did, pct_time)
VALUES (27, 4, 80);

INSERT INTO WORKS(eid, did, pct_time)
VALUES (27, 5, 20);

INSERT INTO WORKS(eid, did, pct_time)
VALUES (28, 4, 50);

INSERT INTO WORKS(eid, did, pct_time)
VALUES (28, 5, 50);

INSERT INTO WORKS(eid, did, pct_time)
VALUES (29, 4, 100);

INSERT INTO WORKS(eid, did, pct_time)
VALUES (30, 4, 100);

INSERT INTO WORKS(eid, did, pct_time)
VALUES (31, 4, 100);

INSERT INTO WORKS(eid, did, pct_time)
VALUES (32, 4, 100);

INSERT INTO WORKS(eid, did, pct_time)
VALUES (33, 4, 100);

INSERT INTO WORKS(eid, did, pct_time)
VALUES (34, 4, 70);

INSERT INTO WORKS(eid, did, pct_time)
VALUES (34, 5, 30);

INSERT INTO WORKS(eid, did, pct_time)
VALUES (35, 4, 100);

INSERT INTO WORKS(eid, did, pct_time)
VALUES (36, 4, 30);

INSERT INTO WORKS(eid, did, pct_time)
VALUES (36, 5, 70);
