Order Database
Order Database
Queries:
• Find the name and numbers of all salesmen who had more than one customer.
• List all salesmen and indicate those who have and don’t have customers in their
cities (Use UNION operation.)
• Demonstrate the DELETE operation by removing salesman with id 1000. All his orders
must also be deleted.
Use ON DELETE CASCADE at the end of foreign key definitions while creating child table
orders and then execute the following:
Use ON DELETE SET NULL at the end of foreign key definitions while creating child table
customers and then executes the following:
SELECT * FROM SALESMAN;
SELECT * FROM CUSTOMER;
SELECT * FROM ORDERS;
UPDATE ORDERS
SET PURCHASE_AMT=9000
WHERE ORDER_NO=’&ORDER_NO’;
SELECT * FROM ORDERS;