ソースコード
select 
    DISTINCT AG.AGE_NAME as 年齢階層,
    STD_120.C as "5時間未満",
    STD_130.C as "5時間以上6時間未満",
    STD_140.C as "6時間以上7時間未満",
    STD_150.C as "7時間以上8時間未満",
    STD_160.C as "8時間以上9時間未満",
    STD_170.C as "9時間以上",
    STD_180.C as 不詳
    
from SLEEP_TIME_DTL as STD
inner join AGE_GRP as AG
    on STD.AGE_CODE = AG.AGE_CODE
    
inner join SLEEP_TIME as TC
    on STD.TIME_CODE = TC.TIME_CODE
inner join (select SLEEP_TIME_DTL.AGE_CODE, count(SLEEP_TIME_DTL.AGE_CODE) as C from SLEEP_TIME_DTL where SLEEP_TIME_DTL.TIME_CODE = 120 group by SLEEP_TIME_DTL.AGE_CODE) as STD_120
    on STD.AGE_CODE = STD_120.AGE_CODE
    
inner join (select SLEEP_TIME_DTL.AGE_CODE, count(SLEEP_TIME_DTL.AGE_CODE) as C from SLEEP_TIME_DTL where SLEEP_TIME_DTL.TIME_CODE = 130 group by SLEEP_TIME_DTL.AGE_CODE) as STD_130
    on STD.AGE_CODE = STD_130.AGE_CODE
    
inner join (select SLEEP_TIME_DTL.AGE_CODE, count(SLEEP_TIME_DTL.AGE_CODE) as C from SLEEP_TIME_DTL where SLEEP_TIME_DTL.TIME_CODE = 140 group by SLEEP_TIME_DTL.AGE_CODE) as STD_140
    on STD.AGE_CODE = STD_140.AGE_CODE 
    
inner join (select SLEEP_TIME_DTL.AGE_CODE, count(SLEEP_TIME_DTL.AGE_CODE) as C from SLEEP_TIME_DTL where SLEEP_TIME_DTL.TIME_CODE = 150 group by SLEEP_TIME_DTL.AGE_CODE) as STD_150
    on STD.AGE_CODE = STD_150.AGE_CODE 
    
inner join (select SLEEP_TIME_DTL.AGE_CODE, count(SLEEP_TIME_DTL.AGE_CODE) as C from SLEEP_TIME_DTL where SLEEP_TIME_DTL.TIME_CODE = 160 group by SLEEP_TIME_DTL.AGE_CODE) as STD_160
    on STD.AGE_CODE = STD_160.AGE_CODE 
    
inner join (select SLEEP_TIME_DTL.AGE_CODE, count(SLEEP_TIME_DTL.AGE_CODE) as C from SLEEP_TIME_DTL where SLEEP_TIME_DTL.TIME_CODE = 170 group by SLEEP_TIME_DTL.AGE_CODE) as STD_170
    on STD.AGE_CODE = STD_170.AGE_CODE 
    
inner join (select SLEEP_TIME_DTL.AGE_CODE, count(SLEEP_TIME_DTL.AGE_CODE) as C from SLEEP_TIME_DTL where SLEEP_TIME_DTL.TIME_CODE = 180 group by SLEEP_TIME_DTL.AGE_CODE) as STD_180
    on STD.AGE_CODE = STD_180.AGE_CODE
    
order by AG.AGE_CODE asc;
提出情報
提出日時2022/07/06 17:47:15
コンテスト練習用コンテスト
問題年齢別睡眠時間分析
受験者ututut
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量85 MB
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
85 MB
データパターン2
WA
85 MB