
PROMPT Creating s_ord table

DROP TABLE s_ord CASCADE CONSTRAINTS;

CREATE TABLE s_ord (
order_id       VARCHAR2(10),
product_id   VARCHAR2(10),
cost           NUMBER,
day            DATE);

INSERT INTO s_ord VALUES('ord001', 'prd001', 50000, TO_DATE('2002-03-02','yyyy-mm-dd')); 
INSERT INTO s_ord VALUES('ord002', 'prd003', 60000, TO_DATE('2002-03-05','yyyy-mm-dd')); 
INSERT INTO s_ord VALUES('ord003', 'prd012', 200000, TO_DATE('2002-03-05','yyyy-mm-dd')); 
INSERT INTO s_ord VALUES('ord004', 'prd003', 36000, TO_DATE('2002-03-05,'yyyy-mm-dd')); 
INSERT INTO s_ord VALUES('ord005', 'prd014', 400000, TO_DATE('2002-03-10','yyyy-mm-dd')); 
INSERT INTO s_ord VALUES('ord006', 'prd017', 45000, TO_DATE('2002-03-11','yyyy-mm-dd')); 
INSERT INTO s_ord VALUES('ord007', 'prd002', 60000, TO_DATE('2002-03-11','yyyy-mm-dd')); 
INSERT INTO s_ord VALUES('ord008', 'prd003', 36000, TO_DATE('2002-03-11','yyyy-mm-dd')); 
INSERT INTO s_ord VALUES('ord009', 'prd014', 80000, TO_DATE('2002-03-15','yyyy-mm-dd')); 
INSERT INTO s_ord VALUES('ord010', 'prd015', 200000, TO_DATE('2002-03-15','yyyy-mm-dd')); 
INSERT INTO s_ord VALUES('ord011', 'prd011', 60000, TO_DATE('2002-03-15','yyyy-mm-dd')); 
INSERT INTO s_ord VALUES('ord012', 'prd006', 50000, TO_DATE('2002-03-21','yyyy-mm-dd')); 


PROMPT Creating product table

DROP TABLE porduct CASCADE CONSTRAINTS;

CREATE TABLE product(
produt_id   VARCHAR2(10),
name        VARCHAR2(30),
class        VARCHAR2(20),
make        VARCHAR2(30),
unitcost    NUMBER);

INSERT INTO product VALUES('prd001', 'butter', 'food', 'A', 1000);
INSERT INTO product VALUES('prd002', 'butter', 'food', 'C', 1500);
INSERT INTO product VALUES('prd003', 'butter', 'food', 'D', 1800);
INSERT INTO product VALUES('prd004', 'cake', 'food', 'B', 1000);
INSERT INTO product VALUES('prd005', 'cake', 'food', 'S', 2000);
INSERT INTO product VALUES('prd006', 'bread', 'food', 'C', 500);
INSERT INTO product VALUES('prd011', 'shoes', 'clothing', 'G', 5000);
INSERT INTO product VALUES('prd012', 'dress', 'clothing', 'H', 10000);
INSERT INTO product VALUES('prd013', 'dress', 'clothing', 'P', 14000);
INSERT INTO product VALUES('prd014', 'jacket', 'clothing', 'H', 8000);
INSERT INTO product VALUES('prd015', 'jacket', 'clothing', 'L', 10000);
INSERT INTO product VALUES('prd016', 'jacket', 'clothing', 'P', 15000);
INSERT INTO product VALUES('prd017', 'hat', 'clothing', 'H', 1500);

COMMIT;


