Sigmoid's transaction pipelines need a repeatable SQL audit before data is loaded into downstream analytics surfaces. Write a PostgreSQL query that returns every transaction with one or more data quality issues.
customer_id, merchant_id, amount, currency, or status, treating empty customer IDs as missing.(merchant_id, external_transaction_id).2025-01-31, and transaction rows whose merchant does not exist.transaction_id.| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Unique transaction row identifier |
| merchant_id | INT | Referenced merchant identifier |
| external_transaction_id | VARCHAR(30) | Source-system transaction key |
| customer_id | VARCHAR(30) | Customer identifier |
| amount | NUMERIC(12,2) | Transaction amount |
| currency | VARCHAR(3) | Currency code |
| transaction_date | DATE | Transaction date |
| status | VARCHAR(20) | Processing status |
| Column | Type | Description |
|---|---|---|
| merchant_idPK | INT | Merchant identifier |
| merchant_name | VARCHAR(100) | Merchant display name |