Courseiva
Data Transformation →mediumMultiple Choice

DEA-C02 Data Transformation Practice Question

A data engineer is working with a table that stores customer orders in a VARIANT column named order_details. The order_details column contains an array of line items under the key 'items'. Each line item is an object with keys 'product_id', 'quantity', and 'price'. The engineer needs to produce a flattened result set where each row represents a single line item with its associated order ID. Which Snowflake function should be used to achieve this transformation?

⚠ Common exam trap

It's easy for candidates to confuse functions that manipulate arrays with those that explode them, such as using ARRAY_TO_STRING or OBJECT_KEYS instead of FLATTEN.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

LATERAL FLATTEN(input => order_details:items)

To transform an array of line items into individual rows, the LATERAL FLATTEN function is the correct choice. It takes a VARIANT array and outputs one row per element, allowing each line item to be processed separately. The other functions either aggregate, extract keys, or parse JSON but do not explode arrays into rows.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    OBJECT_KEYS(order_details:items)

    Why it's wrong here

    OBJECT_KEYS returns the keys of an object, not the elements of an array. Since items is an array of objects, OBJECT_KEYS would not work. It would return an error or NULL. This function is meant for extracting key names from a VARIANT object, not for exploding arrays into rows.

  • ✗

    PARSE_JSON(order_details:items)

    Why it's wrong here

    PARSE_JSON converts a string representation of JSON into a VARIANT. The items value is already a VARIANT array, not a string. Using PARSE_JSON on it would either fail or return the same VARIANT. It does not perform any flattening or row generation. Thus, it cannot produce the desired result set.

  • ✗

    ARRAY_TO_STRING(order_details:items, ',')

    Why it's wrong here

    ARRAY_TO_STRING concatenates array elements into a single string. This does not produce multiple rows; instead, it collapses the array into a scalar value. It would lose the individual line item structure and cannot be used to generate a flattened result set with one row per item. Therefore, it is not suitable for this requirement.

  • ✓

    LATERAL FLATTEN(input => order_details:items)

    Why this is correct

    LATERAL FLATTEN is designed to explode arrays into multiple rows. Using it with the input parameter pointing to the items array will produce one row per element in the array. This allows each line item to be represented as a separate row, and the parent order ID can be included via the correlation. This is the standard and most efficient way to flatten arrays in Snowflake.

About these practice questions

This DEA-C02 question is part of Courseiva's 229-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Snowflake exam blueprint

This DEA-C02 practice question is part of Courseiva's free Snowflake certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DEA-C02 exam.