ソースコード
SELECT
	AGE AS AGE
	, CASE GENDER_CODE
		WHEN '20' THEN 'MALE' 
		WHEN '30' THEN 'FEMALE'
	  END AS GENDER
	, (SELECT AVG(AVERAGE_VALUE) FROM SCHOOL_HEALTH WHERE CATEGORY_CODE = '10') AS H_AVG
	, (SELECT (SELECT COUNT(AVERAGE_VALUE) FROM SCHOOL_HEALTH WHERE CATEGORY_CODE = '10' AND AVERAGE_VALUE >=  (SELECT AVG(AVERAGE_VALUE) FROM SCHOOL_HEALTH WHERE CATEGORY_CODE = '10')) / COUNT(AVERAGE_VALUE) * 100 FROM SCHOOL_HEALTH WHERE CATEGORY_CODE = '10') AS H_PER
	, (SELECT AVG(AVERAGE_VALUE) || '%' FROM SCHOOL_HEALTH WHERE CATEGORY_CODE = '20') AS W_AVG
	, (SELECT (SELECT COUNT(AVERAGE_VALUE) FROM SCHOOL_HEALTH WHERE CATEGORY_CODE = '20' AND AVERAGE_VALUE >=  (SELECT AVG(AVERAGE_VALUE) FROM SCHOOL_HEALTH WHERE CATEGORY_CODE = '20')) / COUNT(AVERAGE_VALUE) * 100 || '%' FROM SCHOOL_HEALTH WHERE CATEGORY_CODE = '20') AS W_PER
FROM
	SCHOOL_HEALTH
WHERE
	SURVEY_YEAR = 2019
ORDER BY
	AGE    DESC
	, GENDER_CODE DESC
;
	--絶対違う~~~時間ない~~~(>_<。)
提出情報
提出日時2023/08/21 11:26:56
コンテスト第8回 SQLコンテスト
問題身長と体重
受験者doraemon
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量101 MB
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
99 MB
データパターン2
WA
101 MB