ComenzarEmpieza gratis

Identifying invalid parking violations

The parking_violation table has three columns populated by related time values. The from_hours_in_effect column indicates the start time when parking restrictions are enforced at the location where the violation occurred. The to_hours_in_effect column indicates the ending time for enforcement of parking restrictions. The violation_time indicates the time at which the violation was recorded. In order to ensure the validity of parking tickets, an audit is being performed to identify tickets given outside of the restricted parking hours.

In this exercise, you will use the parking restriction time range defined by from_hours_in_effect and to_hours_in_effect to identify parking tickets with an invalid violation_time.

Este ejercicio forma parte del curso

Cleaning Data in PostgreSQL Databases

Ver curso

Ejercicio interactivo práctico

Prueba este ejercicio completando el código de muestra.

SELECT 
  -- Specify return columns
  ___, 
  ___, 
  ___, 
  ___
FROM 
  parking_violation 
WHERE 
  -- Condition on values outside of the restricted range
  violation_time ___ ___ from_hours_in_effect ___ to_hours_in_effect;
Editar y ejecutar código