Recovering deleted data
While maintenance of the film permit data was taking place, a mishap occurred where the column storing the New York City borough was deleted. While the data was backed up the previous day, additional permit applications were processed between the time the backup was made and when the borough column was removed. In an attempt to recover the borough values while preserving the new data, you decide to use some data cleaning skills that you have learned to rectify the situation.
Fortunately, a table mapping zip codes and boroughs is available (nyc_zip_codes
). You will use the zip codes from the film_permit
table to re-populate the borough column values. This will be done utilizing five sub-queries to specify which of the five boroughs to use in the new borough
column.
This exercise is part of the course
Cleaning Data in PostgreSQL Databases
Hands-on interactive exercise
Turn theory into action with one of our interactive exercises
