Your question is Top Users by Order Frequency. 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.
Delivery Hero India wants to identify its most frequent users on the food delivery platform. Write a PostgreSQL query to rank users by the number of completed orders placed during the previous calendar month, using 2025-03-15 as the reporting date.
delivered.| Column | Type | Description |
|---|---|---|
| user_idPK | INTEGER | Unique user identifier |
| user_name | VARCHAR(100) | User display name |
| Column | Type | Description |
|---|---|---|
| order_idPK | INTEGER | Unique order identifier |
| user_id | INTEGER | References users.user_id |
| order_timestamp | TIMESTAMP | Timestamp when the order was placed |
| status | VARCHAR(20) | Order fulfillment status |