City, Grade, Salesman - Id) ORDERS (Ord - No, Purchase - Amt, Ord - Date, Customer - Id, Salesman - Id) Write SQL Queries To
City, Grade, Salesman - Id) ORDERS (Ord - No, Purchase - Amt, Ord - Date, Customer - Id, Salesman - Id) Write SQL Queries To
Solution:
Entity-Relationship Diagram
CREATE TABLE SALESMAN
(SALESMAN_ID NUMBER (4),
NAME VARCHAR2 (20),
CITY VARCHAR2 (20),
COMMISSION VARCHAR2 (20),
PRIMARY KEY (SALESMAN_ID));
DESC SALESMAN;
DESC CUSTOMER1;
DESC ORDERS;
Queries:
4. 4. Create a view that finds the salesman who has the customer with the highest order of a day.
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: