Aan de slagGa gratis aan de slag

Querying JSON data

Yelpto, a leading platform for discovering local businesses, seeks your expertise as a consulting Data Engineer.

They aim to explore the restaurant industry, focusing on popular 5-star-rated restaurants that are open on weekends in Philadelphia.

You'll work with the yelp_business_data table, particularly the name, categories, attributes, and hours columns.

You can explore the yelp_business_data table in the SQL console.

SQL console

Note that the attributes and hours columns are VARIANT types.

Deze oefening maakt deel uit van de cursus

Introduction to Snowflake SQL

Cursus bekijken

Oefeninstructies

  • Retrieve Saturday hours from the hours VARIANT column.
  • Retrieve Sunday hours from the hours VARIANT column.
  • Filter where categories include 'Restaurant'.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

SELECT name,
    review_count,
    -- Retrieve the Saturday hours
    hours:___,
    -- Retrieve the Sunday hours
    ___
FROM yelp_business_data
-- Filter for Restaurants
WHERE categories ___ '%___%'
    AND (hours:Saturday IS NOT NULL AND hours:Sunday IS NOT NULL)
    AND city = 'Philadelphia'
    AND stars = 5
ORDER BY review_count DESC
Code bewerken en uitvoeren