ソースコード
with
man_total as (select * from DRINK_HABITS where CATEGORY_CODE = 110 and GENDER_CODE = 2),
woman_total as (select * from DRINK_HABITS where CATEGORY_CODE = 110 and GENDER_CODE = 3),
man_drink as (select * from DRINK_HABITS where CATEGORY_CODE = 120 and GENDER_CODE = 2),
woman_drink as (select * from DRINK_HABITS where CATEGORY_CODE = 120 and GENDER_CODE = 3)
select
PREFECTURE.PF_CODE as CODE,
PREFECTURE.PF_NAME as NAME,
round(cast(man_drink.AMT + woman_drink.AMT as REAL) / cast(man_total.AMT + woman_total.AMT as REAL),3) * 100 as PERCENTAGE
from
PREFECTURE
join man_total on man_total.PF_CODE = PREFECTURE.PF_CODE
join woman_total on woman_total.PF_CODE = PREFECTURE.PF_CODE
join man_drink on man_drink.PF_CODE = PREFECTURE.PF_CODE
join woman_drink on woman_drink.PF_CODE = PREFECTURE.PF_CODE
提出情報
提出日時2022/09/21 21:38:05
コンテスト第2回 SQLコンテスト
問題飲酒率
受験者nenecchi
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量100 MB
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
100 MB
データパターン2
WA
98 MB