SnowPro Core (COF-C03) · Free practice question 10 of 15
LATERAL FLATTEN on VARIANT arrays
You have a column `event` of type VARIANT containing JSON, including an inner array `event:items`. You need to produce one row per element of that array. Which SQL construct achieves this?
- A.`SELECT event:items FROM events;`
- B.`SELECT f.value FROM events, LATERAL FLATTEN(input => event:items) f;`
- C.`SELECT JSON_EXTRACT(event, 'items[*]') FROM events;`
- D.`SELECT event::ARRAY[i] FROM events GROUP BY i;`
Show answer and explanation
Correct answer: B. `SELECT f.value FROM events, LATERAL FLATTEN(input => event:items) f;`
Why: `FLATTEN` is Snowflake's table function that turns array or object members into rows; it's typically used with a `LATERAL` join. Direct extraction (option A) returns the whole array as a value, not exploded rows. The other SQL forms shown do not exist in Snowflake.
More free SnowPro Core (COF-C03) questions
- Micro-partition immutability
- SECURITYADMIN for user and role management
- Multi-cluster warehouses for concurrency
- Snowflake edition for extended Time Travel
- Recovering a truncated table with Time Travel
- Types of internal stages
- File sizing for COPY INTO
- Query result cache
- Reader accounts for non-Snowflake consumers
- Streams and tasks for change data capture
- Clustering keys for partition pruning
- Network policies for IP allowlisting
- Zero-copy cloning for QA environments
- Snowpipe auto-ingest for low latency