How do you handle missing values and inconsistent datetime formats in a dataset?
Write a PostgreSQL query that standardizes supported event timestamp formats, identifies invalid or missing timestamps, and flags other missing values without removing source records.
event_id.event_id, normalized vehicle_id, source_name, normalized_event_at, datetime_status, mileage_km, and missing_value_status.| Column | Type | Description |
|---|---|---|
| event_idPK | INT | Unique event identifier |
| vehicle_id | VARCHAR(20) | Vehicle identifier from the source feed |
| source_id | INT | Source system identifier |
| raw_event_time | VARCHAR(40) | Event timestamp received as text |
| mileage_km | INT | Vehicle mileage in kilometers |
| Column | Type | Description |
|---|---|---|
| source_idPK | INT | Unique source system identifier |
| source_name | VARCHAR(50) | Source system name |