Dataford
Interview QuestionsInterview GuidesExperiencesCoaching
New
Pricing
Get started
Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Browse
Browse All RolesEvery role hub, from analyst to MLBrowse All CompaniesCompany-specific interview loopsAll Interview GuidesThe full guide library
Top questions by role
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Top questions by skill
SQLPythonStatisticsMachine LearningA/B TestingSystem DesignGenerative AIProduct SenseMetricsBehavioral
Browse all questions →Try a mock interview
ExperiencesCoaching
New
Practice
Mock InterviewsTimed interview simulations with feedbackSuccess PathYour 6-week structured planModulesCurated lessons by topicWebinarsTalks from ex-Big Tech data leadsPlaygroundA free-form scratch editor
Learn
BlogInterview strategy and career adviceTech Job Market ReportHiring trends across data and AI rolesFor UniversitiesDataford for career centersAbout DatafordWho we are and how we build
Pricing
Get started
Validate Migration Reconciliation Metrics
00:00
5 left

Validate Migration Reconciliation Metrics

MediumSQL · PostgreSQL

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
Interviewer

Your question is Validate Migration Reconciliation Metrics. Start with the requirements and the three tables in the Question tab.

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.
CodePostgreSQL
Sign up free to run your codeLog inLn 1
Run your query to see results here.