Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Monthly Budget vs Actuals by Department

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

Your question is Monthly Budget vs Actuals by Department. Start with the requirements and the three tables 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

Build a monthly budget-versus-actuals report for Q1 2024. Return one row per department per month with budget, actuals from posted transactions only, variance amount, variance percentage, and year-to-date actuals. Departments with a budget but no posted activity must still appear.

Schema

Tables
  • departments
  • monthly_budgets
  • gl_transactions
Tablesdepartmentsmonthly_budgetsgl_transactions
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results