Design a data model for a given business scenario, then write medium-to-hard SQL queries against it.
Asked in the Data modeling + SQL stage. Define a relational model for the supplied scenario, then demonstrate it with a query that summarizes completed transactional activity by customer and month.
Output
- One row per customer with completed activity in a month.
- Columns:
order_month, customer_name, completed_orders, total_value, and monthly_rank.
- Include only completed activity, rank customers within each month by
total_value descending, share ranks for ties, and sort by month ascending then rank ascending.