What notation methods are supported in Snowflake to access elements in a JSON object? Select TWO.
Correct Answer: C,E
The correct answers are C. Bracket notation and E. Dot notation .
Snowflake supports querying semi-structured data stored in columns such as VARIANT, OBJECT, and ARRAY. When working with JSON objects, users can access elements using either dot notation or bracket notation .
Why C is correct:
Bracket notation is used to access JSON object elements by enclosing the key name in brackets.
Example:
SELECT src[ ' customer ' ][ ' name ' ]
FROM json_table;
Bracket notation is especially useful when JSON keys contain special characters, spaces, or case-sensitive names.
Why E is correct:
Dot notation is used to access JSON object elements using a period between object levels.
Example:
SELECT src:customer.name
FROM json_table;
This notation is commonly used for simple JSON key paths.
Why the other options are incorrect:
A). CIDR notation is used for IP address ranges, not JSON element access.
B). Vertical bar notation is not a Snowflake method for accessing JSON object elements.
D). Slash notation is not a Snowflake method for accessing JSON object elements.
Official Snowflake documentation reference:
Snowflake documentation explains that semi-structured data elements in VARIANT columns can be accessed using dot notation and bracket notation.
Reference: Snowflake Documentation - Querying semi-structured data; Snowflake Documentation - Dot notation and bracket notation; SnowPro Core Study Guide - Working with Semi-Structured Data.