Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Accumulated Salary Sum in SQL

MediumSQL · PostgreSQL00:00
Practice interviewer
In session
5 left
00:00

Your question is Accumulated Salary Sum in SQL. Start with the requirements and the one table on the right.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.

Problem

Write a SQL query to calculate the accumulated salary sum.

Asked in the Onsite Round 1 stage. SQL question starting simple and getting progressively harder.

Output

Return employee_id, employee_name, salary, and accumulated_salary_sum, ordered by salary ascending, then employee_id ascending.

Schema

employees
ColumnTypeDescription
employee_idPKINTEmployee identifier
employee_nameVARCHAR(100)Employee name
salaryINTMonthly salary
Tablesemployees
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results