COF-C02 · Question #395
COF-C02 Question #395: Real Exam Question with Answer & Explanation
The correct answer is C: select data:BIKE.BIKEID. In Snowflake, when accessing elements within a JSON object stored in a variant column, the correct syntax involves using a colon (:) to navigate the JSON structure. The BIKEID attribute, which is a child of the BIKE root node in the JSON object, is accessed using data:BIKE.BIKEID
Question
A JSON object is loaded into a column named data using a Snowflake variant datatype. The root node of the object is BIKE. The child attribute for this root node is BIKEID. Which statement will allow the user to access BIKEID?
Options
- Aselect data:BIKEID
- Bselect data.BIKE.BIKEID
- Cselect data:BIKE.BIKEID
- Dselect data:BIKE:BIKEID
Explanation
In Snowflake, when accessing elements within a JSON object stored in a variant column, the correct syntax involves using a colon (:) to navigate the JSON structure. The BIKEID attribute, which is a child of the BIKE root node in the JSON object, is accessed using data:BIKE.BIKEID. This syntax correctly references the path through the JSON object, utilizing the colon for JSON field access and dot notation to traverse the hierarchy within the variant structure.
Topics
Community Discussion
No community discussion yet for this question.