Duplicate parking violations
There have been a number of complaints indicating that some New York residents have been receiving multiple parking tickets for a single violation. This is resulting in the affected residents having to incur additional legal fees for a single incident. There is justifiable anger about this situation. You have been tasked with identifying records that reflect this duplication of violations.
In this exercise, using ROW_NUMBER()
, you will find parking_violation
records that contain the same plate_id
, issue_date
, violation_time
, house_number
, and street_name
, indicating that multiple tickets were issued for the same violation.
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
summons_number,
-- Use ROW_NUMBER() to define duplicate window
___() ___(
___ ___
___,
___,
___,
___,
___
-- Modify ROW_NUMBER() value to define duplicate column
) ___ ___ AS ___,
plate_id,
issue_date,
violation_time,
house_number,
street_name
FROM
parking_violation;