Complete the code to select the 'name' field from a JSON column named 'data'.
SELECT data:[1] FROM users;The JSON path data:name extracts the 'name' field from the JSON column.
Complete the code to parse a VARIANT column 'raw_data' as JSON and extract the 'id' field.
SELECT raw_data:[1]::STRING FROM events;The JSON path raw_data:id extracts the 'id' field from the VARIANT column.
Fix the error in the code to extract the 'email' field from JSON column 'profile'.
SELECT profile[1]email FROM users;Snowflake uses colon : to access JSON fields, so profile:email is correct.
Fill both blanks to filter rows where the JSON field 'status' equals 'active'.
SELECT * FROM users WHERE profile[1] = '[2]';
Use :status to access the JSON field and compare it to the string 'active'.
Fill all three blanks to extract 'user_id', 'event_type', and filter events where 'success' is true.
SELECT event[1]user_id, event[2]event_type FROM logs WHERE event[3]success = true;
Use colon : to access JSON fields. The fields are 'user_id', 'event_type', and 'success'.