Snoopy 3. Find Customer Referee (584)
코딩테스트/리트코드 SQL

3. Find Customer Referee (584)

Sooyoon Jeong 2022. 12. 1.

👉 https://leetcode.com/problems/find-customer-referee/?envType=study-plan&id=sql-i

 

Find Customer Referee - LeetCode

Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.

leetcode.com


🤔 문제 분석

1) Write an SQL query to report the names of the customer that are not referred by the customer with id = 2.

 

💡 풀이

SELECT name
FROM Customer
WHERE referee_id <> 2 OR referee_id IS NULL

댓글