NAME: Sai Kumar.p REG - NO:18BCA0079: Assessment 5 Ita1005 - Database Management Systems Lab
NAME: Sai Kumar.p REG - NO:18BCA0079: Assessment 5 Ita1005 - Database Management Systems Lab
NAME: Sai Kumar.p REG - NO:18BCA0079: Assessment 5 Ita1005 - Database Management Systems Lab
Table created.
2. TABLE CREATION PRODUCT_MASTER
Table created.
Table created.
5. ALTER COMMANDS FOR CONSTRAINS:
Table altered.
SQL>
ALTER TABLE SALE_ORDER ADD FOREIGN KEY (ORDERNO) REFERENCES
ORDERNO(ORDERNO);
Table altered.
Table altered.
1. Find out the product which has been sold to ‘ivan Sayross’.
2. Find out the product and their quantities that will have to be delivered.
no rows selected
3. Find out the product_no and description of moving products.
SQL> select product_no from sales_order_details where product_rate =
(select max (product_rate) from sales_order_details );
PRODUCT_NO
--------------------
P07965
5. List the product no. , order_no of customers having qty_ordered less then 5 from
sales_order_details table for the product ‘1.44 floppies’.
Ivan CD Drive 2
Ivan 540 HDD 2
Vandana Floppies 10
7. Find the product and quantities for the orders placed by client_no ‘C00001’
and ‘C00002’.
DESCRIPTION QTY_ORDERED
------------------ --------------------
Floppies 4
Floppies 10
CD Drive 2
540 HDD 2
8. Find the order no.client and salesman no. where a client has been received by
more than one sales man
SUB QUERY
PRODUCT_NO DESCRIPTION
-------------------- --------------------
P00101 1.44 Floppies
2. Find the customer name, address1,address2.city and pincode for the client
who has placed order no. ‘O19001’.
SQL> select name,address1,address2,city,pincode from client_master,sales_order
' on sales_order.client_no = client_master.client_no where exist (select order_no
from sales_order where order_no = O19001');
3. Find the client name that has placed orders before the month of May’96.
NAME ORDER_DAT
---------------- ----------------
Vandana 12-JAN-08
Pradama Jaguste 20-MAY-08
Basu Navindgi 25-JAN-08
Ivan 18-FEB-08
Ivan 03-APR-08
4. Find out if the product ‘1.44 Drive’ has been ordered by any client and
print the client_no, name to whom it was sold.
5. Find names of the clients who have placed orders worth Rs. 10000 or more.
NAME PRODUCT_NO
---------------- --------------------
Rahul desai P02253
7. select the names of person who are in Mr .Pradeep’s department and who
have also worked on an inventory control system.
located at “Bombay”.