Exam SnowPro Advanced Data Engineer All QuestionsBrowse all questions from this exam
Question 28

A Data Engineer has created table t1 with one column c1 with datatype VARIANT: create or replace table t1 (c1 variant);

The Engineer has loaded the following JSON data set, which has information about 4 laptop models, into the table.

The Engineer now wants to query that data set so that results are shown as normal structured data. The result should be 4 rows and 4 columns, without the double quotes surrounding the data elements in the JSON data.

The result should be similar to the use case where the data was selected from a normal relational table t2, where t2 has string data type columns model_id, model, manufacturer, and model_name, and is queried with the SQL clause select * from t2;

Which select command will produce the correct results?

    Correct Answer: B

    To query the JSON data stored in the VARIANT column in a way that the result is displayed as a structured table with columns model_id, model, manufacturer, and model_name, the SQL query must extract these fields from the JSON structure. Option B correctly uses the FLATTEN function to transform the nested JSON data into a set of rows and selects the individual fields using the appropriate path syntax. This ensures that the result is displayed without the double quotes, matching the structure of a normal relational table query.

Discussion
dr_klaufOption: B

Definitely B. D gives a similar result but with double quotes.

stopthisnowOption: B

Possibly B