All tasks

ADA: Ranking Employees by Sales in Department

Expert

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.

Category
Window Functions
Estimated time
~30 min
Databases
PostgreSQLGreenplumMS SQL Server
Tags
rankingctejoinwindow-functionsada-challengeai-generatedada-challengeexpert

Sign in to solve

Start Solving