ソースコード
SELECT
    DH1.PF_CODE AS CODE,
    PF.PF_NAME AS NAME,
    ROUND(
        CAST(DH1.AMT AS REAL) / (CAST((DH2.AMT + DH3.AMT) AS REAL)) * 100,
        1
    ) AS PERCENTAGE
FROM
    DRINK_HABITS AS DH1
    INNER JOIN DRINK_HABITS AS DH2 ON DH1.PF_CODE = DH2.PF_CODE
    INNER JOIN DRINK_HABITS AS DH3 ON DH1.PF_CODE = DH3.PF_CODE
    INNER JOIN PREFECTURE AS PF ON DH1.PF_CODE = PF.PF_CODE
WHERE
    DH1.CATEGORY_CODE = '120'
    AND DH2.GENDER_CODE = '2'
    AND DH3.GENDER_CODE = '3'
GROUP BY
    DH1.PF_CODE,
    PF.PF_NAME
ORDER BY
    PERCENTAGE DESC,
    CODE DESC;
提出情報
提出日時2022/12/11 21:09:39
コンテスト第2回 SQLコンテスト
問題飲酒率
受験者mamitus
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量89 MB
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
89 MB
データパターン2
WA
81 MB