Write SQL to find the top N users by transaction amount for each month.
Use N = 2 for the sample evaluation. Include all transactions, associate each transaction with its user, and calculate totals by calendar month.
month, user_id, user_name, total_amount, and user_rank.user_id.user_rank ascending.| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique Brigit user identifier |
| user_name | VARCHAR(100) | Display name of the user |
| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Unique transaction identifier |
| user_id | INT | User who initiated the transaction |
| transaction_at | TIMESTAMP | Timestamp when the transaction occurred |
| amount | NUMERIC(12,2) | Transaction amount |