Given the schema, ask some SQL questions.
Write a PostgreSQL query that summarizes payments during Q1 2025 for active merchants. Include merchants with no successful payments during the period, and exclude failed, pending, and out-of-period payments.
merchant_id, merchant_name, successful_payment_count, and successful_volume.successful_volume descending, then merchant_id ascending.| Column | Type | Description |
|---|---|---|
| merchant_idPK | INT | Unique merchant identifier |
| merchant_name | VARCHAR(120) | Merchant display name |
| is_active | BOOLEAN | Whether the merchant is currently active |
| Column | Type | Description |
|---|---|---|
| payment_idPK | INT | Unique payment identifier |
| merchant_id | INT | Merchant associated with the payment |
| status | VARCHAR(20) | Payment processing status |
| amount | NUMERIC(12,2) | Payment amount in the stated currency |
| currency | VARCHAR(3) | Three-letter payment currency |
| occurred_at | TIMESTAMP | Payment creation timestamp |