EASY SQL SOLUTION | PLEASE UPVOTE
IntuitionJust combine the table company and orders and get the sales id of every person that is associated with the company RED now i want only those name whose
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
Just combine the table company and orders and get the sales id of every person that is associated with the company RED now i want only those name whose sales_id is not in that table that we make. 

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```mysql []
# Write your MySQL query statement below
WITH t AS (SELECT DISTINCT(s.sales_id),s.name
FROM SalesPerson s
WHERE s.sales_id NOT IN (SELECT o1.sales_id
                          FROM orders o1
                          JOIN Company c
                          ON o1.com_id=c.com_id
                          WHERE c.name='RED'))
SELECT name
FROM t
```
['MySQL']