How do you ensure accuracy when managing large, complex data sets in Excel?
Write a PostgreSQL query that audits imported records against reference records and returns every discrepancy, including records present in only one source. Treat two NULL values as matching.
record_key, imported and expected amounts, imported and expected statuses, and discrepancy_type.record_key ascending.| Column | Type | Description |
|---|---|---|
| import_idPK | INT | Unique identifier for the imported row |
| record_key | VARCHAR(20) | Business key identifying the record |
| imported_amount | DECIMAL(12,2) | Amount loaded from the imported data |
| imported_status | VARCHAR(20) | Status loaded from the imported data |
| Column | Type | Description |
|---|---|---|
| reference_idPK | INT | Unique identifier for the reference row |
| record_key | VARCHAR(20) | Business key identifying the record |
| expected_amount | DECIMAL(12,2) | Authoritative amount for comparison |
| expected_status | VARCHAR(20) | Authoritative status for comparison |