TASK #163 · Hard · Delivery HeroLoyal Berlin Pizza Customers
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 for customers who satisfy all three conditions:
Write a query that returns customer_name for customers who satisfy all three conditions:
- are registered in the city Berlin (country Germany);
- placed strictly more than three orders in the last 30 days;
- their most recent order (by order_placed) contains at least one line item whose name includes the substring "Pizza".
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