간략 정리
테이블
Customers
| Id | Name |
| 1 | Joe |
| 2 | Henry |
| 3 | Sam |
| 4 | Max |
orders
| id | CustomerId |
| 1 | 3 |
| 2 | 1 |
INNER JOIN

1 | |
| Id | Name | orderid |
| 1 | Joe | 2 |
| 3 | Sam | 1 |
LEFT OUTER JOIN

1 | |
| Id | Name | orderid |
| 3 | Sam | 1 |
| 1 | Joe | 2 |
| 2 | Henry | null |
| 4 | Max | null |
RIGHT OUTER JOIN

1 | |
FULL OUTER JOIN

1 | |
해커랭크 문제풀이

Population Census
- 문제 바로가기
- Given the CITY and COUNTRY tables, query the sum of the populations of all cities where the CONTINENT is ‘Asia’.
풀이
1 | |
African Cities
- 문제 바로가기
- Given the CITY and COUNTRY tables, query the names of all cities where the CONTINENT is ‘Africa’.
풀이
1 | |
Average Population of Each Continent
- 문제 바로가기
- Given the CITY and COUNTRY tables, query the names of all the continents (COUNTRY.Continent) and their respective average city populations (CITY.Population) rounded down to the nearest integer.
1 | |
리트코드 문제풀이
183. Customers Who Never Order
- 문제 바로가기
- Write an SQL query to report all customers who never order anything.
- Return the result table in any order.
1 | |
풀이
1 | |
181. Employees Earning More Than Their Managers
- 문제 바로가기
- Write an SQL query to find the employees who earn more than their managers.
1 | |
풀이
1 | |
197. Rising Temperature
- 문제 바로가기
- Write an SQL query to find all dates’ Id with higher temperatures compared to its previous dates (yesterday).
1 | |
풀이
1 | |