1. 学习
  2. /
  3. 课程
  4. /
  5. Cleaning Data in PostgreSQL Databases

Connected

练习

Cleaning invalid dates

The date_first_observed column in the parking_violation dataset represents the date when the parking violation was first observed by the individual recording the violation. Unfortunately, not all date_first_observed values were recorded properly. Some records contain a '0' value for this column. A '0' value cannot be interpreted as a DATE automatically as its meaning in this context is ambiguous. The column values require cleaning to enable conversion to a proper DATE column.

In this exercise, you will convert the date_first_observed value of records with a '0' date_first_observed value into NULL values using the NULLIF() function, so that the field can be represented as a proper date.

说明 1 / 共 2 个

undefined XP
    1
    2
  • Replace '0' values in the date_first_observed using the NULLIF() function.