코딩테스트/MySQL

[프로그래머스 Level 4] 저자 별 카테고리 별 매출액 집계하기 (MySQL)

최-코드 2025. 1. 31. 16:17

https://school.programmers.co.kr/learn/courses/30/lessons/144856

 

프로그래머스

SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프

programmers.co.kr

 

select author_id, author_name, category, sum(sales * price) as total_sales
from book natural join author natural join book_sales
where date_format(sales_date, '%Y-%m') like '2022-01'
group by author_id, category
order by author_id, category desc