Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Prepare Monthly Financial Statements

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

Your question is Prepare Monthly Financial Statements. 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

Prepare a March 2024 branch-level financial statement from URA-style ledger data. Your query should join branch, account, and transaction tables, separate revenue from expenses, compute net result, and add an interpretation label such as Surplus or Deficit.

Schema

Tables
  • ura_branches
  • account_master
  • gl_transactions

What This Tests

  • Joining 2-3 related finance tables
  • Using a CTE for readable statement preparation
  • Conditional aggregation with CASE WHEN
  • Filtering by accounting month with PostgreSQL date functions
  • Interpreting statement output from net result
Tablesura_branchesaccount_mastergl_transactions
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results