コンテストの制限時間が終了しました。
以降も提出を行うことができますが、順位集計には反映されません。
以降も提出を行うことができますが、順位集計には反映されません。
ソースコード
SELECT
SV_YEAR
,PREFECTURE
,KIND
,AMT
FROM
(SELECT
1 as "order_by",
a.PF_CODE,
a.SURVEY_YEAR as "SV_YEAR"
,PF_NAME as "PREFECTURE"
,"小学校" as "KIND"
,sum(ELEMENTARY) as "AMT"
FROM
ENROLLMENT_STATUS a,PREFECTURE b
WHERE
a.PF_CODE = b.PF_CODE
and a.SURVEY_YEAR = 2020
and ELEMENTARY is not null
union
SELECT
2 as "order_by",
c.PF_CODE,
c.SURVEY_YEAR as "SV_YEAR"
,PF_NAME as "PREFECTURE"
,"中学校" as "KIND"
,sum(MIDDLE) as "AMT"
FROM
ENROLLMENT_STATUS c,PREFECTURE d
WHERE
c.PF_CODE = d.PF_CODE
and c.SURVEY_YEAR = 2020
and MIDDLE is not null
union
SELECT
3 as "order_by",
c.PF_CODE,
c.SURVEY_YEAR as "SV_YEAR"
,PF_NAME as "PREFECTURE"
,"高校" as "KIND"
,sum(HIGH) as "AMT"
FROM
ENROLLMENT_STATUS c,PREFECTURE d
WHERE
c.PF_CODE = d.PF_CODE
and c.SURVEY_YEAR = 2020
and HIGH is not null
union
SELECT
4 as "order_by",
c.PF_CODE,
c.SURVEY_YEAR as "SV_YEAR"
,PF_NAME as "PREFECTURE"
,"短大" as "KIND"
,sum(JUNIOR_CLG) as "AMT"
FROM
ENROLLMENT_STATUS c,PREFECTURE d
WHERE
c.PF_CODE = d.PF_CODE
and c.SURVEY_YEAR = 2020
and JUNIOR_CLG is not null
union
SELECT
5 as "order_by",
c.PF_CODE,
c.SURVEY_YEAR as "SV_YEAR"
,PF_NAME as "PREFECTURE"
,"大学" as "KIND"
,sum(COLLEGE) as "AMT"
FROM
ENROLLMENT_STATUS c,PREFECTURE d
WHERE
c.PF_CODE = d.PF_CODE
and c.SURVEY_YEAR = 2020
and COLLEGE is not null
union
SELECT
6 as "order_by",
c.PF_CODE,
c.SURVEY_YEAR as "SV_YEAR"
,PF_NAME as "PREFECTURE"
,"大学院" as "KIND"
,sum(GRADUATE) as "AMT"
FROM
ENROLLMENT_STATUS c,PREFECTURE d
WHERE
c.PF_CODE = d.PF_CODE
and c.SURVEY_YEAR = 2020
and GRADUATE is not null
)
order by PF_CODE asc,order_by asc
提出情報
提出日時 | 2022/09/22 00:15:55 |
コンテスト | 第2回 SQLコンテスト |
問題 | 就学状況の表示変換 |
受験者 | O.I. |
状態 (詳細) | WA (Wrong Answer: 誤答) |
メモリ使用量 | 96 MB |
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
96 MB
データパターン2
WA
88 MB