Order Database
Order Database
Order Database
Queries:
2. Find the name and numbers of all salesmen who had more than one customer.
3. List all salesmen and indicate those who have and don’t have customers in their
cities (Use UNION operation.)
4. Create a view that finds the salesman who has the customer with the highest
order of a day.
5. 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;
SELECT * FROM CUSTOMER;
SELECT * FROM ORDERS;
UPDATE ORDERS
SET PURCHASE_AMT=9000
WHERE ORDER_NO=’&ORDER_NO’;
SELECT * FROM ORDERS;