フリー問題

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

問題文

An events table has a VARIANT column named payload. Each document holds a top-level order_id and an items array with one element per purchased line. The analyst needs one row per purchased line, with the order_id repeated on each row. Which construct produces that result?

選択肢

  1. A recursive common table expression over the payload column that walks the array by index and the position until it reaches the end.
  2. A GROUP BY on order_id combined with ARRAY_AGG, which redistributes the array elements and the payload keys for the order across separate rows.
  3. A lateral FLATTEN over the items array, which returns one row for each element and lets the query keep the order_id from the outer row.
  4. A path expression that selects the items array with the colon notation, or with an index, which returns one row for each element it contains and repeats the outer order_id.

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

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