ソースコード
with avg_tbl as (
    select avg(POINT) avg_point
    from TEST_RESULTS
    where TEST_ID = '100'
)
,sa_tbl as (
    select *
        ,POINT - (select avg_point from avg_tbl) as sa
        ,(POINT - (select avg_point from avg_tbl))*(POINT - (select avg_point from avg_tbl)) as sa_2
    from TEST_RESULTS
)
,hensa_tbl as (
    select avg(sa_2) as bunsan
        ,sqrt(avg(sa_2)) as hensa
    from sa_tbl
)
select
    USER_ID as USER
    ,POINT as PT
    ,case when (select hensa from hensa_tbl) = 0 then 50
    else round((POINT - (select avg_point from avg_tbl)) * 10
    / (select hensa from hensa_tbl) +50,1) 
    end as DEV_VAL
from TEST_RESULTS
where TEST_ID = '100'
order by 
    DEV_VAL desc
    ,USER_ID
提出情報
提出日時2023/02/19 09:07:28
コンテスト第5回 SQLコンテスト
問題偏差値の算出
受験者sato
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量79 MB
メッセージ
テストケース(通過数/総数)
1/4
状態
メモリ使用量
データパターン1
WA
78 MB
データパターン2
AC
78 MB
データパターン3
WA
79 MB
データパターン4
WA
79 MB