[SQL문제풀기] 성분으로 구분한 아이스크림 총 주문량(GROUP BY)

241212
이나겸's avatar
Dec 12, 2024
[SQL문제풀기] 성분으로 구분한 아이스크림 총 주문량(GROUP BY)
Contents
Q.풀이

Q.

notion image
 
 

풀이

  • flavor 기준으로 first_half 테이블과 icecream_info 테이블 join
  • order by ~ asc : 오름차순 정렬
select i.ingredient_type, sum(f.total_order) as total_order from first_half as f join icecream_info as i on f.flavor = i.flavor group by i.ingredient_type order by f.total_order asc;
Share article

Nakyeom's Study