Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Data Integrity Across Legacy Systems
00:00
5 left

Data Integrity Across Legacy Systems

HardSQL · PostgreSQL

Problem

How do you ensure data integrity when pulling from multiple disparate legacy systems?

Use the provided legacy source records, identifier mappings, and canonical AMD product data to produce an integrity audit. Flag every source record that is duplicated, unmapped, mapped to a missing canonical product, or inconsistent with its canonical attributes.

Output

  1. One row per source record, including valid records
  2. Columns: record_id, source_system, legacy_part_id, canonical_part_id, integrity_status, and issue_details
  3. Sort by source_system, legacy_part_id, and record_id ascending

Schema

legacy_part_records
ColumnTypeDescription
record_idPKINTUnique source record identifier
source_systemVARCHAR(50)Name of the legacy source system
legacy_part_idVARCHAR(50)Part identifier from the source system
part_nameVARCHAR(150)Part name extracted from the source
unit_priceDECIMAL(12,2)Unit price extracted from the source
extracted_atDATEDate the source record was extracted
part_id_map
ColumnTypeDescription
map_idPKINTUnique mapping identifier
source_systemVARCHAR(50)Legacy source system name
legacy_part_idVARCHAR(50)Source system part identifier
canonical_part_idVARCHAR(50)Mapped canonical product identifier
canonical_parts
ColumnTypeDescription
canonical_part_idPKVARCHAR(50)Canonical product identifier
part_numberVARCHAR(50)Canonical product number
canonical_nameVARCHAR(150)Approved canonical product name
standard_unit_priceDECIMAL(12,2)Approved standard unit price
activeBOOLEANWhether the canonical product is active
Tableslegacy_part_recordspart_id_mapcanonical_parts
Interviewer

Your question is Data Integrity Across Legacy Systems. 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
You need to log in / sign up to run or submit.Ln 1
Run your query to see results here.