Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Reconcile ERP and Ledger Month-End Totals

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

Your question is Reconcile ERP and Ledger Month-End Totals. Start with the requirements and the two 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.

Reconcile ERP and Ledger Totals

You are given ERP transaction data and a month-end ledger summary. Write a PostgreSQL query that compares the two sources by account and month-end date, then returns only the rows that do not reconcile. Your output should show the month-end date, account code, ERP total, ledger total, and a reconciliation flag that identifies matches, mismatches, and missing-source cases.

Tables

erp_transactions
ColumnTypeDescription
transaction_idPKINTPrimary key for each ERP transaction
account_codeVARCHAR(20)Financial account code
transaction_dateDATEPosting date in the ERP system
amountDECIMAL(12,2)Transaction amount, positive or negative
general_ledger_monthly
ColumnTypeDescription
account_codeVARCHAR(20)Financial account code
month_endDATEMonth-end date for the ledger summary
ledger_amountDECIMAL(12,2)Month-end ledger balance
Tableserp_transactionsgeneral_ledger_monthly
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results