Given a raw dataset of financial transactions, write a SQL query to aggregate monthly transaction volumes and identify high-value contractor accounts.
Use settled transactions for the volume calculations. For this exercise, define high-value contractor accounts as accounts in the top quartile by total settled transaction volume across the full dataset.
month, monthly_transaction_count, monthly_transaction_volume, account_id, account_name, account_total_volume.month ascending, then account_total_volume descending, then account_id ascending.| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Unique transaction identifier |
| account_id | INT | Account associated with the transaction |
| transaction_date | DATE | Date the transaction occurred |
| amount | NUMERIC(12,2) | Transaction amount |
| status | VARCHAR(20) | Transaction processing status |
| Column | Type | Description |
|---|---|---|
| account_idPK | INT | Unique account identifier |
| account_name | VARCHAR(100) | Display name for the account |
| account_type | VARCHAR(20) | Account classification, such as contractor or client |