What would you do to verify a dataset, and can you write out the queries for those checks?
Using the supplied trips and vehicles tables, write PostgreSQL checks that identify common data-quality issues.
check_name, issue_count, and status.check_name.| Column | Type | Description |
|---|---|---|
| vehicle_idPK | INT | Unique vehicle identifier |
| vehicle_name | VARCHAR(80) | Human-readable vehicle name |
| active_status | VARCHAR(20) | Current operational status |
| Column | Type | Description |
|---|---|---|
| trip_idPK | INT | Unique trip identifier |
| trip_reference | VARCHAR(40) | External trip reference expected to be unique when present |
| vehicle_id | INT | Referenced vehicle identifier |
| started_at | TIMESTAMP | Trip start timestamp |
| ended_at | TIMESTAMP | Trip end timestamp |
| distance_miles | DECIMAL(8,2) | Trip distance in miles |
| status | VARCHAR(20) | Trip lifecycle status |