ソースコード
SELECT 
T1.AGE_NAME AS "年齢階層",  T3.CNT AS "5時間未満",
T4.CNT AS "5時間以上6時間未満", T5.CNT AS "6時間以上7時間未満",
T6.CNT AS "7時間以上8時間未満", T7.CNT AS "8時間以上9時間未満",
T8.CNT AS "9時間以上", T9.CNT AS "不詳"
FROM AGE_GRP AS T1 
JOIN SLEEP_TIME_DTL AS STD ON T1.AGE_CODE=STD.AGE_CODE
JOIN SLEEP_TIME AS T2 ON STD.TIME_CODE=T2.TIME_CODE
JOIN (SELECT AGE_CODE,SUM(TARGET_POP) AS CNT FROM SLEEP_TIME_DTL WHERE TIME_CODE=120 GROUP BY AGE_CODE) AS T3 ON T3.AGE_CODE=STD.AGE_CODE
JOIN (SELECT AGE_CODE,SUM(TARGET_POP) AS CNT FROM SLEEP_TIME_DTL WHERE TIME_CODE=130 GROUP BY AGE_CODE) AS T4 ON T4.AGE_CODE=STD.AGE_CODE
JOIN (SELECT AGE_CODE,SUM(TARGET_POP) AS CNT FROM SLEEP_TIME_DTL WHERE TIME_CODE=140 GROUP BY AGE_CODE) AS T5 ON T5.AGE_CODE=STD.AGE_CODE
JOIN (SELECT AGE_CODE,SUM(TARGET_POP) AS CNT FROM SLEEP_TIME_DTL WHERE TIME_CODE=150 GROUP BY AGE_CODE) AS T6 ON T6.AGE_CODE=STD.AGE_CODE
JOIN (SELECT AGE_CODE,SUM(TARGET_POP) AS CNT FROM SLEEP_TIME_DTL WHERE TIME_CODE=160 GROUP BY AGE_CODE) AS T7 ON T7.AGE_CODE=STD.AGE_CODE
JOIN (SELECT AGE_CODE,SUM(TARGET_POP) AS CNT FROM SLEEP_TIME_DTL WHERE TIME_CODE=170 GROUP BY AGE_CODE) AS T8 ON T8.AGE_CODE=STD.AGE_CODE
JOIN (SELECT AGE_CODE,SUM(TARGET_POP) AS CNT FROM SLEEP_TIME_DTL WHERE TIME_CODE=180 GROUP BY AGE_CODE) AS T9 ON T9.AGE_CODE=STD.AGE_CODE
GROUP BY "年齢階層"
ORDER BY T1.AGE_CODE ASC;
提出情報
提出日時2022/07/07 00:20:22
コンテスト練習用コンテスト
問題年齢別睡眠時間分析
受験者retch
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量81 MB
メッセージ
テストケース(通過数/総数)
2/2
状態
メモリ使用量
データパターン1
AC
79 MB
データパターン2
AC
81 MB