Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Reconcile Multi-Source Cost Variances

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

Your question is Reconcile Multi-Source Cost Variances. 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

Write a PostgreSQL query that reconciles March 2024 program costs between an ERP source and a plant reporting source. Return only programs where the two sources do not balance, along with both totals, the absolute variance, and a status showing whether the issue is a missing source or a mismatch.

Schema

ColumnTypeDescription
program_id
program_code
platform_name
ColumnTypeDescription
cost_id
program_id
posting_date
cost_type
amount
ColumnTypeDescription
plant_entry_id
program_code
report_month
amount
Tablesgdls_programserp_costsplant_costs
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results