ソースコード
with pop_2020 as (
  select
    pf_code,
    total_amt
  from
    popu_transition
  where
    survey_year = 2020
),
pop_2015 as (
  select
    pf_code,
    total_amt
  from
    popu_transition
  where
    survey_year = 2015
)

select
  pop_2015.pf_code as "都道府県コード",
  prefecture.pf_name as "都道府県名",
  pop_2015.total_amt as "総人口2015年",
  pop_2020.total_amt as "総人口2020年",
  round(cast(pop_2020.total_amt as real) * 100 / cast(pop_2015.total_amt as real)) as "人口増加率"

from pop_2015

  inner join pop_2020
    on pop_2020.pf_code = pop_2015.pf_code

  inner join prefecture
    on prefecture.pf_code = pop_2015.pf_code

where
  pop_2015.total_amt <= pop_2020.total_amt

order by
  "人口増加率" desc,
  "都道府県コード" asc
提出情報
提出日時2022/07/04 00:08:54
コンテスト練習用コンテスト
問題人口増加率分析
受験者cyan_nyan
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量86 MB
メッセージ
テストケース(通過数/総数)
2/2
状態
メモリ使用量
データパターン1
AC
86 MB
データパターン2
AC
83 MB