Explain how you would approach a data cleaning process in Python.
For this PostgreSQL exercise, apply the same data-cleaning objectives with SQL. Return only the latest valid record for each transaction reference, standardize status values, reject missing or invalid fields, and retain only transactions linked to active customers.
transaction_ref, customer_name, amount, transaction_date, and normalized_status.transaction_ref ascending.| Column | Type | Description |
|---|---|---|
| raw_idPK | INT | Unique identifier for the raw record |
| transaction_ref | VARCHAR(30) | Raw transaction reference |
| customer_ref | VARCHAR(20) | Raw customer reference |
| amount_text | VARCHAR(30) | Transaction amount received as text |
| transaction_date_text | VARCHAR(20) | Transaction date received as text |
| status_text | VARCHAR(20) | Raw transaction status |
| ingested_at | TIMESTAMP | Timestamp when the raw record was ingested |
| Column | Type | Description |
|---|---|---|
| customer_refPK | VARCHAR(20) | Customer reference used for validation |
| customer_name | VARCHAR(100) | Customer display name |
| account_status | VARCHAR(20) | Current customer account status |