Im between cherry

Leet Code | MySQL | 183. Customers Who Never Order 본문

데이터분석/practice_query

Leet Code | MySQL | 183. Customers Who Never Order

meal 2020. 8. 30. 15:39

183. Customers Who Never Order

https://leetcode.com/problems/customers-who-never-order/

 

Customers Who Never Order - 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

Suppose that a website contains two tables, the Customers table and the Orders table. Write a SQL query to find all customers who never order anything.

 

SELECT c.Name AS Customers
FROM Customers As c
    LEFT JOIN Orders As o ON c.id = o.Customerid
WHERE o.id IS NULL

 

Comments