フリー問題

SnowPro Advanced: Data Analyst のフリー問題 14 / 20 問目

問題文

A weekly summary must show total sales for the current week and the same figure for the previous week, side by side on one row. Which construct produces that shape most directly?

選択肢

  1. Use a scalar subquery per row that sums the previous week, correlated on the week column.
  2. Aggregate by week, then use LAG over the ordered weeks to bring the previous week's total onto the same row.
  3. Use LAG on the detail rows before aggregating, so that each row carries the previous week's value and the weekly totals line up.
  4. Aggregate by week twice for the current week in the same query and join the two aggregates on a week offset of one.

解答・解説を確認するには

正解と解説の確認、回答の記録には無料登録が必要です。登録すると演習モードでフリー問題に回答し、正誤と解説をその場で確認できます。