ソースコード
SELECT 
 PREF.PF_CODE AS `都道府県コード`
 ,PREF.PF_NAME AS `都道府県名`
 ,AMT_2015.TOTAL AS `総人口2015年`
 ,AMT_2020.TOTAL AS `総人口2020年`
 ,ROUND(CAST(AMT_2020.TOTAL AS REAL) / CAST(AMT_2015.TOTAL AS REAL) * 100) AS `人口増加率`
FROM POPU_TRANSITION POP
INNER JOIN PREFECTURE PREF
        ON POP.PF_CODE = PREF.PF_CODE
INNER JOIN 
    (SELECT PF_CODE,SURVEY_YEAR,SUM(TOTAL_AMT)AS TOTAL
     FROM POPU_TRANSITION
     WHERE SURVEY_YEAR = 2015
     GROUP BY PF_CODE,SURVEY_YEAR) AS AMT_2015
        ON POP.PF_CODE = AMT_2015.PF_CODE
INNER JOIN 
    (SELECT PF_CODE,SURVEY_YEAR,SUM(TOTAL_AMT)AS TOTAL
     FROM POPU_TRANSITION
     WHERE SURVEY_YEAR = 2020
     GROUP BY PF_CODE,SURVEY_YEAR) AS AMT_2020
        ON POP.PF_CODE = AMT_2020.PF_CODE
WHERE POP.SURVEY_YEAR IN (2015,2020)
GROUP BY
    PREF.PF_CODE
    ,PREF.PF_NAME
ORDER BY 
    `人口増加率` DESC
    ,`都道府県コード` ASC
提出情報
提出日時2024/04/05 14:02:05
コンテスト練習用コンテスト
問題人口増加率分析
受験者th
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量86 MB
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
86 MB
データパターン2
WA
84 MB