select product_name,total_sales,row_number() over(partition by category order by total_sales desc) as category_rank from (select products.category ,product_name,total_sales,category_rank1 from products join (select name as product_name,sum(quantity) as total_sales,row_number() over(partition by name...