SQL Practice Logo

SQLPractice Online

Scenario SQL Question

Advanced Window Functions - Moving Averages and Percentiles

Build mastery in Ctes Window with this scenario-based SQL challenge and live execution support.

Problem Statement

For each employee, calculate: (1) 3-month moving average of department hiring salaries, (2) percentile rank of their salary within department, (3) difference from department median salary, (4) cumulative percentage of department salary budget. Show comprehensive salary analytics.

Relevant Tables

employees