Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Validate Migration Reconciliation Metrics

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

Your question is Validate Migration Reconciliation Metrics. 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

You are validating a migration from a legacy transactional system into an Accenture-managed cloud warehouse. Write a PostgreSQL query that returns one row per source table with reconciliation metrics comparing legacy row counts and amount totals against the migrated warehouse data for the migration batch dated 2024-04-01.

Your result should include the source table name, legacy row count, warehouse row count, legacy amount total, warehouse amount total, count difference, amount difference, and a status flag that marks each table as PASS only when both row count and amount total match after treating NULL amounts as zero. Include legacy tables even if no warehouse rows were loaded for that table in the batch.

Schema

legacy_table_summary
ColumnTypeDescription
source_tableVARCHAR(50)Legacy source table name
extract_dateDATEDate the legacy summary was extracted
row_countINTRow count captured from the legacy source
total_amountNUMERIC(12,2)Total amount captured from the legacy source
warehouse_load_audit
ColumnTypeDescription
load_idPKINTWarehouse load identifier
source_tableVARCHAR(50)Source table loaded into the warehouse
batch_dateDATEWarehouse batch date
statusVARCHAR(20)Load execution status
warehouse_transactions
ColumnTypeDescription
txn_idPKINTMigrated transaction identifier
load_idINTLoad identifier tied to the audit table
source_tableVARCHAR(50)Source table for the migrated transaction
amountNUMERIC(12,2)Migrated transaction amount
Tableslegacy_table_summarywarehouse_load_auditwarehouse_transactions
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results