Write a SQL query to analyze weekly boutique sales by store, category, and associate, including month-over-month growth and a ranking of top-performing stores.
Use the provided boutique sales and reference tables. Include only sales with valid store, category, and associate references.
Output
- One row per store, calendar week, category, and associate.
- Columns:
store_name, week_start, category_name, associate_name, weekly_sales, store_month_sales, prior_month_sales, mom_growth_pct, and store_rank.
- Include all weeks with valid sales, sort by month, store rank, week, category, and associate, and rank stores within each month by total sales descending. Tied stores share a rank.