Skip to content

Latest commit

 

History

History
39 lines (29 loc) · 866 Bytes

_607. Sales Person.md

File metadata and controls

39 lines (29 loc) · 866 Bytes

All prompts are owned by LeetCode. To view the prompt, click the title link above.

Back to top


First completed : May 22, 2024

Last updated : July 01, 2024


Related Topics : Database

Acceptance Rate : 65.77 %


Solutions

SQL

SELECT
    sp1.name
FROM 
    SalesPerson sp1
WHERE 
    sp1.name NOT IN (SELECT sp2.name 
                        FROM SalesPerson sp2 
                            LEFT JOIN Orders o ON sp2.sales_id = o.sales_id 
                            LEFT JOIN Company c ON o.com_id = c.com_id
                        WHERE
                            c.name = 'RED')