ソースコード
WITH basedata AS (
	SELECT
		USER_ID
		,POINT
	FROM TEST_RESULTS
	WHERE TEST_ID = '100'
)
,heikinsamade AS (
	SELECT
		t1.USER_ID
		,t1.POINT
		,t2.avgpt
		,t1.POINT - t2.avgpt AS heikinsa
	FROM basedata AS t1
	CROSS JOIN
		(SELECT
			AVG(POINT) AS avgpt
		FROM basedata
		) AS t2
)
,bunsanavg AS (
	SELECT
		AVG(heikinsa * heikinsa) AS bunavg
	FROM heikinsamade
)
,hyoujunhensa AS (
	SELECT SQRT(bunavg) 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:29:15
コンテスト第5回 SQLコンテスト
問題偏差値の算出
受験者katsu
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量83 MB
メッセージ
テストケース(通過数/総数)
3/4
状態
メモリ使用量
データパターン1
AC
83 MB
データパターン2
WA
77 MB
データパターン3
AC
82 MB
データパターン4
AC
82 MB