ソースコード
with 
avg as(
    select avg(point) as avg_pt from TEST_RESULTS where TEST_ID = '100'
),
devi2 as (
    select 
        USER_ID as USER,
        POINT as PT,
        pow(point - (select avg_pt from avg), 2) as devi2
    from TEST_RESULTS
    where TEST_ID = '100'
),
var_std as (
    select 
        avg(devi2) as var,
        SQRT(avg(devi2)) as std
    from devi2
)
select
    USER,
    PT,
    case when (select std from var_std) = 50 then 0
        else round(10 * (pt - (select avg_pt from avg)) / (select std from var_std) + 50 , 1)
    end as DEV_VAL
from devi2
order by DEV_VAL desc
;
提出情報
提出日時2023/10/30 14:28:30
コンテスト第5回 SQLコンテスト
問題偏差値の算出
受験者fgdthfjgh
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量76 MB
メッセージ
テストケース(通過数/総数)
2/4
状態
メモリ使用量
データパターン1
AC
75 MB
データパターン2
WA
76 MB
データパターン3
AC
75 MB
データパターン4
WA
76 MB