You're managing an e-commerce platform and need to identify your most valuable customers - those who consistently spend big every month! ๐ฐ
Given three tables:
- Customers: Contains customer information (ID, name, country)
- Product: Contains product details (ID, description, price)
- Orders: Contains order transactions (order ID, customer ID, product ID, date, quantity)
Your task is to find customers who spent at least $100 in BOTH June AND July 2020. These are your premium customers who deserve special attention!
Think of it like finding customers who hit a spending milestone in consecutive months - they're likely to be your most loyal buyers.
Return the customer_id and customer_name of these high-value customers in any order.
Input & Output
Visualization
Time & Space Complexity
Single pass through Orders table with efficient grouping
Space for grouping results where k is number of unique customers
Constraints
- 1 โค customers.length โค 100
- 1 โค product.length โค 100
- 1 โค orders.length โค 1000
- Product prices are between $1 and $1000
- Order quantities are between 1 and 100
- All dates are in format 'YYYY-MM-DD'