How would you use GROUP BY and aggregate functions to find the top 5 performing merchant categories?
Assume performance is measured by the total value of successful payments. Use the merchant_categories and payments tables.
category_name, successful_payment_count, and total_successful_amount.| Column | Type | Description |
|---|---|---|
| category_idPK | INT | Unique merchant category identifier |
| category_name | VARCHAR(100) | Merchant category name |
| Column | Type | Description |
|---|---|---|
| payment_idPK | INT | Unique payment identifier |
| category_id | INT | Merchant category associated with the payment |
| amount | DECIMAL(12,2) | Payment amount |
| status | VARCHAR(20) | Payment processing status |