JSONified
Semi-structured data can be challenging to query, so let's practice interacting with Yelpto's data once again.
Here, you will filter the contents of a VARIANT
column.
This exercise is part of the course
Introduction to Snowflake SQL
Exercise instructions
- Filter where the
DogsAllowed
key in theattributes
column is'True'
(note this is astring
, notboolean
). - Filter where the
BusinessAcceptsCreditCards
key in theattributes
column is'True'
(note this is astring
, notboolean
).
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
SELECT business_id, name
FROM yelp_business_data
WHERE categories ILIKE '%Restaurant%'
-- Filter where DogsAllowed is '%True%'
AND ___ ___ '%True%'
-- Filter where BusinessAcceptsCreditCards is '%True%'
AND ___
AND city ILIKE '%Philadelphia%'
AND stars = 5