ソースコード
SELECT
    PREFECTURE.PF_CODE AS "都道府県コード"
    , PREFECTURE.PF_NAME AS "都道府県名"
    , TRANSITION.BEFORE_AMT AS "総人口2015年"
    , TRANSITION.AFTER_AMT AS "総人口2020年"
    , TRANSITION.RATE AS "人口増加率"
FROM
    PREFECTURE
    JOIN
        (
            SELECT
                BEFORE.PF_CODE
                , BEFORE.TOTAL_AMT AS BEFORE_AMT
                , AFTER.TOTAL_AMT AS AFTER_AMT
                , ROUND(AFTER.TOTAL_AMT * 100.0 / BEFORE.TOTAL_AMT) AS RATE
            FROM
                (
                    SELECT
                        PF_CODE, TOTAL_AMT
                    FROM
                        POPU_TRANSITION
                    WHERE
                        SURVEY_YEAR = 2015
                ) AS BEFORE
                    JOIN
                    (
                        SELECT
                            PF_CODE, TOTAL_AMT
                        FROM
                            POPU_TRANSITION
                        WHERE
                            SURVEY_YEAR = 2020
                    ) AS AFTER
                    USING (PF_CODE)
        ) AS TRANSITION
        USING (PF_CODE)
ORDER BY
    TRANSITION.RATE DESC
    , PREFECTURE.PF_CODE ASC
提出情報
提出日時2024/06/09 20:21:02
コンテスト練習用コンテスト
問題人口増加率分析
受験者emthrm
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量89 MB
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
89 MB
データパターン2
WA
87 MB