Complete the code to extract the 'name' field from the JSON column 'data'.
SELECT data:[1] AS name FROM usersThe JSON path data:name extracts the 'name' field from the JSON column.
Complete the code to filter rows where the JSON field 'status' equals 'active'.
SELECT * FROM users WHERE data:[1] = 'active'
The condition data:status = 'active' filters rows where the JSON field 'status' is 'active'.
Fix the error in the code to correctly extract the 'city' from the nested JSON field 'address'.
SELECT data:address[1]city AS city FROM usersIn dbt SQL, use : to access nested JSON fields, so data:address:city extracts the city.
Fill both blanks to create a dictionary of word lengths for words longer than 3 characters.
SELECT [1] AS word, LENGTH([2]) AS length FROM words WHERE LENGTH(word) > 3
The column word is selected as the word, and LENGTH(word) calculates its length.
Fill all three blanks to create a filtered dictionary of uppercase words and their lengths greater than 4.
SELECT [1] AS word_upper, LENGTH([2]) AS length FROM words WHERE LENGTH([3]) > 4
Use UPPER(word) to get uppercase words, and word for length and filtering.