I have following four tables in my database :
EMPLOYEE
PK: employeeID;
FK: empBranch references BRANCH;
FK: empSupervisor references EMPLOYEE
BRANCH
PK: branchNumber
FK: branchManager references EMPLOYEE
CUSTOMER
PK: customerID
ORDERS
PK: orderNumber
FK: customerID references CUSTOMER;
FK: salesPerson references EMPLOYEE
Now I need to list out these two things :
-
The Employee_ID and name of salespersons who have sold only to customers located in the same city as the city in which the salesperson’s branch is located.
-
The Employee_ID and name of salespersons who have sold to every customer located in the same city as the city in which the salesperson’s branch is located.
Please help me to answer both queries