select product_id, product_name, category_id, sales_amount, profit_rate from ( select p.product_id as product_id, product_name, category_id, sales_amount, row_number() over ( partition by category_id order by sales_amount desc ) as sales_rank, round((sales_amount - cost_amount) / sales_amount, 2) as...