Exam SnowPro Core All QuestionsBrowse all questions from this exam
Question 220

The following JSON is stored in a VARIANT column called src of the CAR_SALES table:

A user needs to extract the dealership information from the JSON.

How can this be accomplished?

    Correct Answer: A

    To extract the value of a first-level element from a JSON object stored in a VARIANT column in Snowflake, use the colon notation. Therefore, the correct query to extract the dealership information from the JSON stored in the src column of the CAR_SALES table is: select src:dealership from car_sales;.

Discussion
SV1122Option: A

Insert a colon : between the VARIANT column name and any first-level element: <column>:<level1_element>. https://docs.snowflake.com/en/user-guide/querying-semistructured.html

Ram9198

Is it case sensitive?

fellpond

Column name is case-insensitive but element names are case-sensitive. For example, in the following list, the first two paths are equivalent, but the third is not: src:salesperson.name SRC:salesperson.name SRC:Salesperson.Name

halolOption: A

https://docs.snowflake.com/en/user-guide/querying-semistructured.html

Mallikharjuna452Option: A

select src:dealership from car_sales;

_yyuktaOption: A

A. select src:dealership from car_sales;

Marge23Option: A

correct

c0d3gOption: A

Use dot notation to traverse a path in a JSON object: <column>:<level1_element>.<level2_element>.<level3_element>. Optionally enclose element names in double quotes: <column>:"<level1_element>"."<level2_element>"."<level3_element>".