コンテストの制限時間が終了しました。
以降も提出を行うことができますが、順位集計には反映されません。
以降も提出を行うことができますが、順位集計には反映されません。
ソースコード
select 2020 as SV_YEAR,
PF_NAME as PREFECTURE,
case kind
when 1 then '小学校'
when 2 then '中学校'
when 3 then '高校'
when 4 then '短大'
when 5 then '大学'
when 6 then '大学院'
end as KIND,
sum(val) as AMT
from (with T1 as (select *, ELEMENTARY as val, 1 as kind
from ENROLLMENT_STATUS
where SURVEY_YEAR = 2020
and ELEMENTARY is not null),
T2 as (select *, MIDDLE as val, 2 as kind
from ENROLLMENT_STATUS
where SURVEY_YEAR = 2020
and MIDDLE is not null),
T3 as (select *, HIGH as val, 3 as kind
from ENROLLMENT_STATUS
where SURVEY_YEAR = 2020
and HIGH is not null),
T4 as (select *, JUNIOR_CLG as val, 4 as kind
from ENROLLMENT_STATUS
where SURVEY_YEAR = 2020
and JUNIOR_CLG is not null),
T5 as (select *, COLLEGE as val, 5 as kind
from ENROLLMENT_STATUS
where SURVEY_YEAR = 2020
and COLLEGE is not null),
T6 as (select *, GRADUATE as val, 6 as kind
from ENROLLMENT_STATUS
where SURVEY_YEAR = 2020
and GRADUATE is not null)
select *
from T1
union
select *
from T2
union
select *
from T3
union
select *
from T4
union
select *
from T5
union
select *
from T6) as t
inner join PREFECTURE on PREFECTURE.pf_code = t.pf_code
group by t.pf_code, t.kind
order by PREFECTURE.pf_code, t.kind
提出情報
提出日時 | 2023/02/20 08:18:51 |
コンテスト | 第2回 SQLコンテスト |
問題 | 就学状況の表示変換 |
受験者 | tamurakami |
状態 (詳細) | AC (Accepted: 正答) |
メモリ使用量 | 82 MB |
メッセージ
テストケース(通過数/総数)
2/2
状態
メモリ使用量
データパターン1
AC
82 MB
データパターン2
AC
79 MB