ExamGecko
Question list
Search
Search

Question 6 - COF-C02 discussion

Report
Export

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?

A.
select src:dealership from car_sales;
Answers
A.
select src:dealership from car_sales;
B.
select src.dealership from car_sales;
Answers
B.
select src.dealership from car_sales;
C.
select src:Dealership from car_sales;
Answers
C.
select src:Dealership from car_sales;
D.
select dealership from car_sales;
Answers
D.
select dealership from car_sales;
Suggested answer: B

Explanation:

In Snowflake, to extract a specific element from a JSON stored in a VARIANT column, the correct syntax is to use the dot notation. Therefore, the queryselect src.dealership from car_sales;will return the dealership information contained within each JSON object in thesrccolumn.

References: For a detailed explanation, please refer to the Snowflake documentation on querying semi-structured data.

asked 23/09/2024
Nabil MHB
44 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first