Sequence of SQL calculation
2022. 5. 20. 07:50ㆍ데이터 분석가로 살기
1. Single Query

2. Multiple tables

3. Hence,
- when you need single values or list, it would be more efficient executing in a single table than using several ctes
- focus on Where and Select stages as following :
Example 1:
select customer_id, cost
from Customer
where customer_id in (select customer_id from Customer)
Example 2:
select purchase_amount >(select avg(purchase_amount) from Customer)
from Customer
where customer_id in
Source : https://medium.com/@Hong_Tang/my-secret-recipe-for-sql-query-f43492e5f4f0
'데이터 분석가로 살기' 카테고리의 다른 글
토스 페이먼츠 Data Engineer (Analytics/BI) (0) | 2022.07.22 |
---|---|
데이터 엔지니어 프로그래밍 스킬셋 (0) | 2022.05.26 |
딜리버리프로덕트실 배민커넥트 서비스 Data Scientist/ML Engineer (0) | 2022.05.05 |
롯데ecommerce AI/ML Data Scientist (0) | 2022.05.05 |
Data analyst 스킬셋 (0) | 2022.04.13 |