Exercise

Creating a TIMESTAMP with concatenation

In a previous exercise, the violation_time column in the parking_violation table was used to check that the recorded violation_time is within the violation location's restricted times. This presented a challenge in cases where restricted parking took place overnight because, for these records, the from_hours_in_effect time is later than the to_hours_in_effect time. This issue could be eliminated by including a date in addition to the time of a violation.

In this exercise, you will begin the process of simplifying the identification of overnight violations through the creation of the violation_datetime column populated with TIMESTAMP values. This will be accomplished by concatenating issue_date and violation_time and converting the resulting strings to TIMESTAMP values.

Instructions 1/2

undefined XP
    1
    2
  • Concatenate the issue_date column, a space character (' '), and the violation_time column to create a violation_datetime column in the query results.