COF-C02 · Question #385
A column named "Data" contains VARIANT data and stores values as follows: How will Snowflake extract the employee's name from the column data?
The correct answer is D. data:employee.name. In Snowflake, SQL column names are case-insensitive, so 'data', 'DATA', or 'Data' all refer to the same column. However, the JSON path used to traverse VARIANT data (after the colon) is case-sensitive and must exactly match the keys as stored in the JSON document. If the stored…
Question
A column named "Data" contains VARIANT data and stores values as follows:
How will Snowflake extract the employee's name from the column data?
Options
- AData:employee.name
- BDATA:employee.name
- Cdata:Employee.name
- Ddata:employee.name
How the community answered
(25 responses)- B4% (1)
- C8% (2)
- D88% (22)
Explanation
In Snowflake, SQL column names are case-insensitive, so 'data', 'DATA', or 'Data' all refer to the same column. However, the JSON path used to traverse VARIANT data (after the colon) is case-sensitive and must exactly match the keys as stored in the JSON document. If the stored key is 'employee' (lowercase), using 'Employee' (option C) or 'EMPLOYEE' (option B) would return NULL. Option D uses 'data:employee.name' - correct lowercase column reference and correctly cased JSON path - making it the right answer.
Topics
Community Discussion
No community discussion yet for this question.