Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Summarize Budget Lines by Program

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

Your question is Summarize Budget Lines by Program. 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 PostgreSQL query against voa_budget_lines to show total 2024 budget amount by program_name. Exclude rows where program_name is NULL or an empty string, and sort by total amount descending, then program name ascending.

Schema

voa_budget_lines
ColumnTypeDescription
budget_line_idINTUnique budget line identifier
program_nameVARCHAR(100)Program tied to the budget line
fiscal_yearINTFiscal year of the budget entry
amountDECIMAL(12,2)Budgeted amount
fund_codeVARCHAR(20)Funding source code
Tablesvoa_budget_lines
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results