Your question is Top Merchants by Transaction Volume. Start with the requirements and the two tables on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
PayU needs a monthly view of its highest-volume merchants on the PayU payment platform. Write a PostgreSQL query that identifies the top three merchants by the number of successful transactions during January 2025.
status = 'SUCCESS' during January 2025, using an inclusive start date and exclusive end date.merchant_id.| Column | Type | Description |
|---|---|---|
| merchant_idPK | INT | Unique merchant identifier |
| merchant_name | VARCHAR(100) | Merchant display name |
| business_category | VARCHAR(50) | Merchant business category |
| Column | Type | Description |
|---|---|---|
| transaction_idPK | BIGINT | Unique transaction identifier |
| merchant_id | INT | Merchant associated with the transaction |
| transaction_timestamp | TIMESTAMP | Timestamp when the transaction was created |
| status | VARCHAR(20) | Transaction processing status |
| payment_method | VARCHAR(30) | Payment method used |