nerdexam
Snowflake

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…

Data Transformations

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)
  • B
    4% (1)
  • C
    8% (2)
  • D
    88% (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

#VARIANT data type#Semi-structured data#JSON extraction#Dot notation

Community Discussion

No community discussion yet for this question.

Full COF-C02 Practice