SELECT emp_id, name, salary, SUM(salary) OVER (PARTITION BY dept_id ORDER BY emp_id) AS running_total FROM employees;
Write your query and click "Run Query" (Ctrl + Enter) to see results and testcase validation.