SnowPro Core Certification — Question 1214
This statement is run:
SELECT { 'key' : { 'subkey': 'value' }} mycolumn;
What notations will retrieve the 'value' from the VARIANT column? (Choose two.)
Answer options
- A. mycolumn.key.subkey
- B. mycolumn.key:subkey
- C. mycolumn:key.subkey
- D. mycolumn['key'].subkey
- E. mycolumn:key:subkey
Correct answer: C, D
Explanation
The correct options, C and D, are valid ways to access elements from the VARIANT column in Snowflake. Option C uses the colon notation correctly while D uses the bracket notation to access the value. Options A, B, and E are incorrect due to syntax errors in how they attempt to access the data.