Sales Person
You can write a MySQL query to find the names of all salespersons who did not have any orders related to the company with the name “RED”. Here’s the query:
|
|
Explanation:
- The subquery in the
WHERE
clause gets thesales_id
of all salespersons who have orders related to the company with the name “RED”. - The main query then selects the names of all salespersons from the
SalesPerson
table whosesales_id
is not found in the subquery’s result, i.e., the ones who did not have any orders related to “RED”.