347. 5월 식품들의 총매출 조회하기

김해준's avatar
Mar 06, 2026
347. 5월 식품들의 총매출 조회하기

언어 : MySQL

문제

notion image
notion image
notion image

풀이과정

FOOD_PRODUCT 테이블 데이터 확인
notion image
FOOD_ORDER 테이블 데이터 확인
notion image
2022-05 데이터만 조회
notion image
food_order테이블에 food_product 테이블 조인
notion image
product_id, product_name, price를 기준으로 그룹화
notion image
필요한 데이터를 select하고 총매출 기준 내림차순 정렬, 총매출이 동일할 경우 product_id기준 오름차순 정렬
notion image
notion image
Share article