
Answer-first summary for fast verification
Answer: select src:dealership from car_sales;
The correct answer is A because it uses the proper Snowflake syntax for accessing first-level elements in a VARIANT column containing JSON data. The colon (:) notation is used to traverse JSON paths, where 'src' is the column name and 'dealership' is the first-level element. Option B uses dot notation which is incorrect for first-level access. Option C incorrectly capitalizes 'Dealership' - while column names are case-insensitive in Snowflake, JSON element names are case-sensitive and must match exactly. Option D omits the column reference entirely, which would fail since 'dealership' is not a direct column in the table but rather an element within the JSON structure. The community discussion confirms this with 100% consensus on answer A and references to official Snowflake documentation.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
The following JSON is stored in a VARIANT column called src in the CAR_SALES table:
{
"dealership": "Friendly Automotive",
"location": {
"city": "Toronto",
"country": "Canada"
},
"sales": [
{"make": "Honda", "model": "Civic", "year": 2022},
{"make": "Toyota", "model": "Camry", "year": 2021}
]
}
{
"dealership": "Friendly Automotive",
"location": {
"city": "Toronto",
"country": "Canada"
},
"sales": [
{"make": "Honda", "model": "Civic", "year": 2022},
{"make": "Toyota", "model": "Camry", "year": 2021}
]
}
A user needs to extract the dealership information from the JSON.
How can this be accomplished?

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