Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- 설명의무
- sigmoid
- leetcode
- Statistics
- 짝수
- 표준편차
- inner join
- 자연어처리
- Window Function
- sql
- NLP
- SQL코테
- SQL 날짜 데이터
- 카이제곱분포
- torch
- nlp논문
- MySQL
- LSTM
- 자연어 논문 리뷰
- CASE
- 논문리뷰
- update
- 코딩테스트
- 서브쿼리
- 그룹바이
- airflow
- 자연어 논문
- t분포
- GRU
- HackerRank
Archives
- Today
- Total
HAZEL
[SQL : Leetcode] LEFT JOIN 문 본문
1. 183. Customers Who Never Order
>> 문제
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.
Table: Customers.
+----+-------+
| Id | Name |
+----+-------+
| 1 | Joe |
| 2 | Henry |
| 3 | Sam |
| 4 | Max |
+----+-------+
Table: Orders.
+----+------------+
| Id | CustomerId |
+----+------------+
| 1 | 3 |
| 2 | 1 |
+----+------------+
Using the above tables as example, return the following:
+-----------+
| Customers |
+-----------+
| Henry |
| Max |
+-----------+
>> 문제 푼 코드
SELECT CUSTOMERS.NAME AS Customers
FROM CUSTOMERS
LEFT JOIN ORDERS ON CUSTOMERS.ID = ORDERS.CustomerId
WHERE ORDERS.CUSTOMERID IS NULL
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
'DATA ANALYSIS > SQL' 카테고리의 다른 글
[SQL : HackerRank] UNION (0) | 2021.02.14 |
---|---|
[SQL : HackerRank/Leetcode] SELF JOIN (0) | 2021.02.13 |
[SQL : HackerRank/Leetcode] INNER JOIN (0) | 2021.02.12 |
[SQL : GROUP BY/ where 서브쿼리 ] HackerRank: Top Earners (0) | 2021.02.12 |
[SQL : HackerRank/Leetcode] CASE 문 (0) | 2021.02.08 |