ソースコード
WITH tbl AS (
    SELECT USER_ID, POINT, TEST_ID
        , AVG(POINT) OVER (PARTITION BY TEST_ID) AS aver
        , POINT - AVG(POINT) OVER (PARTITION BY TEST_ID) AS diff
        -- , SQRT(
        --     AVG(POW(POINT - AVG(POINT) OVER (PARTITION BY TEST_ID), 2)) OVER (PARTITION BY TEST_ID)
        --     ) AS sigma
        
    FROM TEST_RESULTS
    WHERE TEST_ID = '100'
), tbl2 AS (
    SELECT USER_ID, POINT
        , aver, diff
        , SQRT(
            AVG(POW(diff, 2)) OVER (PARTITION BY TEST_ID)
            ) AS sigma
    FROM tbl
)

-- SELECT *
-- FROM tbl2

SELECT
    USER_ID AS USER
    , POINT AS PT
    , ROUND((diff * 10.0) / sigma + 50 , 1)
    
    AS DEV_VAL
    
FROM tbl2
ORDER BY 2 DESC, 1
提出情報
提出日時2023/02/20 00:43:04
コンテスト第5回 SQLコンテスト
問題偏差値の算出
受験者Udwei22
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量84 MB
メッセージ
テストケース(通過数/総数)
3/4
状態
メモリ使用量
データパターン1
AC
84 MB
データパターン2
WA
78 MB
データパターン3
AC
84 MB
データパターン4
AC
83 MB