🤔 문제 분석
1) Write an SQL query to report the names of all the salespersons who did not have any orders related to the company with the name "RED".
2) Return the result table in any order.
💡 풀이
SELECT name
FROM salesperson
WHERE sales_id not in (SELECT sales_id
FROM orders
WHERE com_id = (SELECT com_id
FROM company
WHERE name = "Red"))
'코딩테스트 > 리트코드 SQL' 카테고리의 다른 글
[리트코드/SQL] 21. Daily Leads and Partners (1693) (0) | 2022.12.18 |
---|---|
[리트코드/SQL] 20. User Activity for the Past 30 Days I (1141) (0) | 2022.12.18 |
[리트코드/SQL] 18. Rising Temperature (197) (0) | 2022.12.18 |
[리트코드/SQL] 17. Article Views I (1148) (0) | 2022.12.18 |
[리트코드/SQL] 16. Customer Who Visited but Did Not Make Any Transactions (1581) (0) | 2022.12.18 |
댓글