Write a query using window functions to rank merchants based on their daily sales volume within each product category at Alibaba Group.
Use the provided merchant, category, and sales data. Calculate total units sold for each merchant, category, and date. Ties should receive the same rank.
Output
- One row per merchant, product category, and sales date with valid merchant and category references.
- Columns:
category_name, sales_date, merchant_name, daily_sales_volume, and merchant_rank.
- Order by
sales_date, category_name, merchant_rank, then merchant_name.