TASK #161 · Medium · Delivery HeroAverage Delivery Time per City
Your brief
Delivery time of an order is the difference between
order_delivered and order_placed in minutes. The city
of an order is the city of the restaurant the order was placed at.
Write a query that returns city_name and avg_minutes — the average delivery time per city, rounded to two decimals. Sort the result by avg_minutes ascending.
Write a query that returns city_name and avg_minutes — the average delivery time per city, rounded to two decimals. Sort the result by avg_minutes ascending.
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