ソースコード
SELECT
    PREF.PF_CODE AS CODE,
    PREF.PF_NAME AS NAME,
    ROUND((
        CAST(SUM(DRINK.AMT) AS DOUBLE) / CAST(SUM(POP.AMT) AS DOUBLE))*100, 1) AS PERCENTAGE
FROM
    PREFECTURE PREF
INNER JOIN
        DRINK_HABITS POP
ON PREF.PF_CODE = POP.PF_CODE
INNER JOIN
        DRINK_HABITS DRINK
ON PREF.PF_CODE = DRINK.PF_CODE
WHERE
    POP.GENDER_CODE IN ('2','3')
AND
    POP.CATEGORY_CODE = '110'
AND
    DRINK.GENDER_CODE IN ('2','3')
AND
    DRINK.CATEGORY_CODE = '120'
GROUP BY
    PREF.PF_CODE,
    PREF.PF_NAME
ORDER BY
    ROUND((CAST(DRINK.AMT AS DOUBLE) / CAST(POP.AMT AS DOUBLE))*100, 2) desc,
    PREF.PF_CODE desc
;
提出情報
提出日時2022/09/22 13:31:51
コンテスト第2回 SQLコンテスト
問題飲酒率
受験者MMpine
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量80 MB
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
80 MB
データパターン2
WA
77 MB