Exercise

Mapping parking restrictions

You are interested in building a mobile parking recommendation app for New York City. The goal is to use the parking_violation dataset to map parking restrictions to a driver's location. Parking restrictions are stored in the days_parking_in_effect column in a format that consists of a string of 7 characters. Each position in the string represents a day of the week (Monday-Sunday). A B indicates parking is restricted and a Y indicates parking is allowed. A colleague has organized the data from parking_violation by creating a table named parking_restrictions, which includes the street_address, violation_county, and days_parking_in_effect.

In this exercise, you will use REGEXP_SPLIT_TO_TABLE() and ROW_NUMBER() to associate each street address to its parking availability.

Instructions 1/2

undefined XP
    1
    2
  • Use REGEXP_SPLIT_TO_TABLE() with the empty-string ('') as a delimiter to split days_parking_in_effect into a single availability symbol (B or Y).
  • Include street_address and violation_county as columns so that each row contains these associated values.