TASK #162 · Hard · Delivery HeroMonthly Avg Delivery Time (window functions)
Your brief
Write a query that for every month returns mth (month number)
and avg_minutes — the average delivery time of orders that
month, rounded to two decimals.
Use window functions (
Use window functions (
AVG(...) OVER (PARTITION BY ...)) instead of
GROUP BY, removing duplicates with DISTINCT.
Sort the result by mth.
Ctrl / ⌘ + ↵
Result
Write a query and run it to see the results.
Schema
citiescity_id, city_name, countrycustomerscustomer_id, name, city_idrestaurantsrestaurant_id, name, city_idordersorder_id, customer_id, restaurant_id, order_placed, order_deliveredorder_itemsitem_id, order_id, product_name