Skip to Content
SQL로 시작하는 데이터 분석
book

SQL로 시작하는 데이터 분석

by 캐시 타니무라, 박상근
August 2022
Beginner to intermediate
436 pages
9h 43m
Korean
Hanbit Media, Inc.
Content preview from SQL로 시작하는 데이터 분석
125
3
시계열 분석
남성 의류업 대비 여성 의류업의 연간 매출 비율
연도
그림
3-8
남성 의류업 대비 여성 의류업의 연간 매출 비율
다음으로, 두 업종의 비율 차이를 계산합니다.
SELECT
sales_year
,(womens_sales / mens_sales - 1) * 100
as
womens_pct_of_mens
FROM
(
SELECT
date_part(‘year’,sales_month)
as
sales_year
,
sum
(
case
when
kind_of_business = ‘Women’’s clothing stores’
then
sales
end
)
as
womens_sales
,
sum
(
case
when
kind_of_business = ‘Men’’s clothing stores’
then
sales
end
)
as
mens_sales
FROM
retail_sales
WHERE
kind_of_business
in
(‘Men’’s clothing stores’
,’Women’’s clothing stores’)
and
sales_month <= ‘2019-12-01’
126
SQL로 시작하는 데이터 분석
GROUP
BY
1
) a
ORDER BY
1
;
sales_year womens_pct_of_mens
---------- ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

견고한 데이터 엔지니어링

견고한 데이터 엔지니어링

조 라이스, 맷 하우슬리
행동 데이터 분석

행동 데이터 분석

플로랑 뷔송
데이터 과학을 위한 통계(2판)

데이터 과학을 위한 통계(2판)

이준용, 피터 브루스, 앤드루 브루스, 피터 게데크

Publisher Resources

ISBN: 9791169210089