ソースコード
WITH total AS 
(
 SELECT
  a.PF_CODE AS CODE,
  b.PF_NAME AS NAME,
  a.AMT AS AMT
 FROM
  DRINK_HABITS AS a
 LEFT JOIN
  PREFECTURE AS b
 USING
  (PF_CODE)
 WHERE
  CATEGORY_CODE = '110'
),

total_drink AS 
(
 SELECT
  a.PF_CODE AS CODE,
  b.PF_NAME AS NAME,
  a.AMT AS AMT
 FROM
  DRINK_HABITS AS a
 LEFT JOIN
  PREFECTURE AS b
 USING
  (PF_CODE)
 WHERE
  CATEGORY_CODE = '120'
)

SELECT
 a.CODE,
 a.NAME,
 a.AMT AS total,
 b.AMT AS drink,
 b.AMT / a.AMT
FROM
 total AS a
LEFT JOIN
 total_drink AS b
USING
 (CODE)
提出情報
提出日時2024/02/03 22:24:40
コンテスト第2回 SQLコンテスト
問題飲酒率
受験者romi0416
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量84 MB
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
84 MB
データパターン2
WA
83 MB