TASK #160 · Medium · Delivery HeroTop-5 Customers in Last 30 Days
Your brief
Assume today is March 31, 2024. Treat "the last 30 days" as the
range from March 2, 2024 to March 31, 2024 inclusive.
Write a query that returns customer_name and order_count for the five customers with the most orders in that period. Sort the result by order_count descending. Test data excludes ties inside the top-5.
Write a query that returns customer_name and order_count for the five customers with the most orders in that period. Sort the result by order_count descending. Test data excludes ties inside the top-5.
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