Курьер с наибольшими чаевыми в городе до июля 2025
Questions like this come up in interviews at Uber
Level: MiddleTopic: CTE100 XP
Instructions
Учитывайте доставки, завершённые (delivered_at) строго раньше 1 июля 2025. Для каждого города курьера (couriers.city) найдите курьера с наибольшей суммой чаевых tip за этот период (пустые чаевые в сумму не входят; если у курьера все чаевые пустые, его сумма равна 0) (при равенстве выведите всех лидеров). Выведите city, name курьера и tips — сумму его чаевых. Порядок строк не важен.
not translated yetHints
Each next one is more detailed and costs more
Query
Result
Click Run to see the query result, or Check to submit your solution.
Dataset schema
Exactly oneZero or oneZero or more
Table relationships
- N:1Many-to-one
deliveries.→restaurant_id restaurants.id - N:1Many-to-one
deliveries.→customer_id customers.id - N:1Many-to-one
deliveries.→courier_id couriers.id
Table data
PostgreSQL
Select a table in the diagram or list to view its rows.