
Answer-first summary for fast verification
Answer: SELECT SRC:customer."phone number" FROM car_sales;, SELECT src:customer."phone number" FROM car_sales;
The correct queries must properly access the JSON structure in the VARIANT column. The JSON path is src:customer."phone number" where 'customer' is the first-level key and 'phone number' is a nested key containing a space. In Snowflake JSON path notation: 1) Field names with spaces must be wrapped in double quotes, 2) JSON field names are case-sensitive, so 'customer' must match the exact case in the JSON data. Option B (SELECT SRC:customer."phone number" FROM car_sales;) and Option C (SELECT src:customer."phone number" FROM car_sales;) both correctly handle the case sensitivity and quote the field with spaces. Option A uses incorrect single quotes, Option D misses quotes around 'phone number', and Option E uses uppercase 'CUSTOMER' which doesn't match the JSON's lowercase 'customer'.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
A table named car_sales contains a single VARIANT column named src.
The output of the query SELECT * FROM car_sales; is:
{
"customer": {
"address": {
"city": "Springfield",
"phone number": "123-456-7890",
"street": "123 Main St"
},
"name": "John Doe"
},
"sale_id": 1001
}
{
"customer": {
"address": {
"city": "Springfield",
"phone number": "123-456-7890",
"street": "123 Main St"
},
"name": "John Doe"
},
"sale_id": 1001
}
Which queries will return the element "phone number" from the data? (Choose two.)

A
SELECT src:customer.’phone number’ FROM car_sales;
B
SELECT SRC:customer."phone number" FROM car_sales;
C
SELECT src:customer."phone number" FROM car_sales;
D
SELECT SRC:customer.phone number FROM car_sales;
E
SELECT SRC:CUSTOMER."phone number" FROM car_sales;