ソースコード
WITH HEIGHT_AVG AS(
    SELECT
        AGE,
        GENDER_CODE,
        AVG(AVERAGE_VALUE) AS 'HAVG'
    FROM
        SCHOOL_HEALTH
    WHERE
        SURVEY_YEAR=2019
        AND CATEGORY_CODE='10'
    GROUP BY
        AGE, GENDER_CODE
), WEIGHT_AVG AS(
    SELECT
        AGE,
        GENDER_CODE,
        AVG(AVERAGE_VALUE) AS 'WAVG'
    FROM
        SCHOOL_HEALTH
    WHERE
        SURVEY_YEAR=2019
        AND CATEGORY_CODE='20'
    GROUP BY
        AGE, GENDER_CODE
)
SELECT
    SH.AGE AS 'AGE',
    SH.GENDER_CODE AS 'GENDER',
    HAVG AS 'H_AVG'
FROM
    SCHOOL_HEALTH AS SH
    INNER JOIN HEIGHT_AVG AS HA ON SH.AGE=HA.AGE AND SH.GENDER_CODE=HA.GENDER_CODE
WHERE
    SURVEY_YEAR=2019
GROUP BY
    SH.AGE, GENDER
提出情報
提出日時2023/10/25 17:04:15
コンテスト第8回 SQLコンテスト
問題身長と体重
受験者honyara
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量80 MB
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
75 MB
データパターン2
WA
80 MB