create table salesman (salesman_id integer, name varchar2(20), target integer,
city varchar2(20), primary key (salesman_id));

create table client (client_id integer, name varchar2(20), city varchar2(20),
primary key (client_id));

create table product (product_id integer, description varchar2(20),
cost integer, primary key(product_id));

create table sales_order (order_id integer, order_date Date, client_id 
integer references client, salesman_id integer references salesman, primary key (order_id)); 

create table order_details(order_id integer references sales_order, product_id 
integer references product, quantity integer );





--Sample data:

--CLIENT

--CLIENT_ID 	NAME                 CITY
---------- -------------------- --------------------
INSERT INTO CLIENT VALUES (1,'leopard','IIT Powai');
INSERT INTO CLIENT VALUES (2 ,'Cub','IIT Powai');
INSERT INTO CLIENT VALUES (3 ,'Fish','Atlanta');
INSERT INTO CLIENT VALUES (4 ,'Snake','Staff Canteen');
INSERT INTO CLIENT VALUES (5 ,'Turtle','Powai Lake');
INSERT INTO CLIENT VALUES (6 ,'Dog','IIT Powai');
INSERT INTO CLIENT VALUES (7 ,'Cow','Library');

--*************************************************************************

--SALESMAN

--SALESMAN_ID 		NAME                     TARGET CITY
----------- -------------------- ---------- --------------------
INSERT INTO SALESMAN VALUES(1,'Bob',20,'IIT Powai');
INSERT INTO SALESMAN VALUES(2,'Tom',10,'IIT Powai');
INSERT INTO SALESMAN VALUES(3,'Sam',25,'Staff Canteen');
INSERT INTO SALESMAN VALUES(4,'Derrick',20,'Powai Lake');
INSERT INTO SALESMAN VALUES(5,'John Miller',15,'Atlanta');
INSERT INTO SALESMAN VALUES(6,'George',50,'Library');
INSERT INTO SALESMAN VALUES(7,'Stanley',20,'Powai Lake');

--*************************************************************************

--PRODUCT

--PRODUCT_ID 	DESCRIPTION                COST
---------- -------------------- ----------
INSERT INTO PRODUCT VALUES (3,'leopard',420);
INSERT INTO PRODUCT VALUES (1,'Fish',10);
INSERT INTO PRODUCT VALUES (2,'Coca Cola',200);
INSERT INTO PRODUCT VALUES (4,'Dog',50);
INSERT INTO PRODUCT VALUES (5,'Coffee',3);
INSERT INTO PRODUCT VALUES (6,'Chowmein',15);

--*************************************************************************

--SALES_ORDER

--ORDER_ID 	ORDER_DATE  CLIENT_ID SALESMAN_ID
----------- --------- ---------- -----------
INSERT INTO SALES_ORDER VALUES ( 3,'03-MAR-01',3,4);
INSERT INTO SALES_ORDER VALUES ( 4,'03-MAR-01',3,4);
INSERT INTO SALES_ORDER VALUES ( 5,'15-APR-01',4,3);
INSERT INTO SALES_ORDER VALUES ( 6,'05-JUN-01',5,6);
INSERT INTO SALES_ORDER VALUES ( 7,'09-JUL-01',6,7);
INSERT INTO SALES_ORDER VALUES ( 8,'10-FEB-01',4,4);
INSERT INTO SALES_ORDER VALUES ( 1,'01-JAN-01',1,1);
INSERT INTO SALES_ORDER VALUES ( 2,'02-FEB-01',2,3);
INSERT INTO SALES_ORDER VALUES ( 9,'25-MAR-01',3,5);
INSERT INTO SALES_ORDER VALUES (10,'26-JAN-01',2,2);
INSERT INTO SALES_ORDER VALUES (11,'01-AUG-01',2,7);
INSERT INTO SALES_ORDER VALUES (12,'05-AUG-01',1,1);
INSERT INTO SALES_ORDER VALUES (13,'02-AUG-01',2,6);

--*************************************************************************

--ORDER_DETAILS

--ORDER_ID 	PRODUCT_ID   QUANTITY
---------- ---------- ----------
INSERT INTO ORDER_DETAILS VALUES (2,2,10);
INSERT INTO ORDER_DETAILS VALUES (3,3,100);
INSERT INTO ORDER_DETAILS VALUES (3,4,2);
INSERT INTO ORDER_DETAILS VALUES (3,6,50);
INSERT INTO ORDER_DETAILS VALUES (4,3,1);
INSERT INTO ORDER_DETAILS VALUES (4,1,6);
INSERT INTO ORDER_DETAILS VALUES (4,2,9);
INSERT INTO ORDER_DETAILS VALUES (5,4,6);
INSERT INTO ORDER_DETAILS VALUES (6,2,4);
INSERT INTO ORDER_DETAILS VALUES (6,3,7);
INSERT INTO ORDER_DETAILS VALUES (6,5,4);
INSERT INTO ORDER_DETAILS VALUES (7,2,3);
INSERT INTO ORDER_DETAILS VALUES (7,4,44);
INSERT INTO ORDER_DETAILS VALUES (1,4,2);
INSERT INTO ORDER_DETAILS VALUES (8,1,100);
INSERT INTO ORDER_DETAILS VALUES (9,5,1);
INSERT INTO ORDER_DETAILS VALUES (10,6,10);
INSERT INTO ORDER_DETAILS VALUES (10,4,46);
INSERT INTO ORDER_DETAILS VALUES (11,6,55);
INSERT INTO ORDER_DETAILS VALUES (12,3,1);
INSERT INTO ORDER_DETAILS VALUES (13,1,2);
INSERT INTO ORDER_DETAILS VALUES (13,4,2);
--*******************************************************
