Create a query that ranks employees by total sales volume in their department. Use CTE to calculate sales sums, JOIN to combine tables employees, sales, and products. Apply the window function RANK() with PARTITION BY department and ORDER BY total_sales DESC. Output employee name, department, total sales amount, and rank.
Sign in to solve
Start Solving