SQL Practice Logo

SQLPractice Online

Scenario SQL Question

Running Total: ROWS vs RANGE Frame

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

Problem Statement

Within each department, ordered by salary (which has ties), compute two running totals: one with a ROWS frame and one with a RANGE frame, to expose how they differ on tied values. Return department_name, first_name, last_name, salary, rows_total, range_total — ordered by department_name, salary, employee_id.

Relevant Tables

employeesdepartments

SQL Concepts Used in This Scenario

Strengthen your understanding with these targeted learning topics: