ソースコード
WITH basedata AS (
	SELECT
		USER_ID
		,POINT
	FROM TEST_RESULTS
	WHERE TEST_ID = '100'
)
,heikinsamade AS (
	SELECT
		t1.USER_ID
		,t1.POINT
		,t2.avgpt
		,ROUND(t1.POINT - t2.avgpt,2) AS heikinsa
	FROM basedata AS t1
	CROSS JOIN
		(SELECT
			ROUND(AVG(POINT),2) AS avgpt
		FROM basedata
		) AS t2
)
,bunsanavg AS (
	SELECT
		ROUND(AVG(heikinsa * heikinsa),2) AS bunavg
	FROM heikinsamade
)
,hyoujunhensa AS (
	SELECT ROUND(SQRT(bunavg),2) AS hensa
	FROM bunsanavg
)
SELECT
	t1.USER_ID AS USER
	,t1.POINT AS PT
	,ROUND((t1.heikinsa * 10)/t2.hensa + 50,1) AS DEV_VAL
FROM heikinsamade AS t1
CROSS JOIN hyoujunhensa AS t2
ORDER BY DEV_VAL DESC
	,USER ASC
提出情報
提出日時2023/02/18 12:33:29
コンテスト第5回 SQLコンテスト
問題偏差値の算出
受験者katsu
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量85 MB
メッセージ
テストケース(通過数/総数)
3/4
状態
メモリ使用量
データパターン1
AC
83 MB
データパターン2
WA
85 MB
データパターン3
AC
76 MB
データパターン4
AC
79 MB