ソースコード
SELECT
    T.USER_ID AS USER,
    POINT AS PT,
    ROUND(C.DEV, 2) AS DEV_VAL
FROM
    (
        SELECT *
        FROM
            TEST_RESULTS
        WHERE
            TEST_ID = '100'
    ) AS T
INNER JOIN
    (
    SELECT
        TEST_DATA.USER_ID,
        CASE 
            WHEN CAL_DATA.HENSA = 0
                THEN
                50.0
            ELSE
                ((TEST_DATA.POINT - CAL_DATA.AV) / CAL_DATA.HENSA * 10.0 + 50)
        END AS DEV
    FROM
        (
            SELECT *
            FROM
                TEST_RESULTS
            WHERE
                TEST_ID = '100'
        ) AS TEST_DATA,
        (
        SELECT
            SQRT(AVG(
                POW(TES.POINT - CAL.AV, 2)
            )) AS HENSA,
            CAL.AV
        FROM
            (
                SELECT *
                FROM
                    TEST_RESULTS
                WHERE
                    TEST_ID = '100'
            ) AS TES,
            (
                SELECT
                    AVG(TE.POINT) AS AV
                FROM
                (
                    SELECT *
                    FROM
                        TEST_RESULTS
                    WHERE
                        TEST_ID = '100'
                ) AS TE
            ) AS CAL
        ) AS CAL_DATA
    ) AS C
ON
    T.USER_ID = C.USER_ID

ORDER BY
    DEV_VAL DESC,
    T.USER_ID ASC
提出情報
提出日時2023/02/17 16:04:51
コンテスト第5回 SQLコンテスト
問題偏差値の算出
受験者nadia
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量95 MB
メッセージ
テストケース(通過数/総数)
1/4
状態
メモリ使用量
データパターン1
WA
84 MB
データパターン2
AC
88 MB
データパターン3
WA
95 MB
データパターン4
WA
84 MB