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.
This exercise is part of the course
Cleaning Data in PostgreSQL Databases
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
SELECT
-- Specify SELECT list columns
___,
___,
___(___, ___) AS daily_parking_restriction
FROM
parking_restriction;