Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Ensuring Data Integrity Across Sources
00:00
5 left

Ensuring Data Integrity Across Sources

HardSQL · PostgreSQL

Problem

How do you handle data integrity issues when merging information from disparate sources like EDW and local Access databases?

Using the supplied EDW and Access tables, write a query that produces one reconciled row per asset code and identifies records requiring review.

Output

  1. Return asset_code, the EDW-preferred merged asset attributes, integrity_status, and the number of Access records received.
  2. Include matched, conflicting, EDW-only, and Access-only records.
  3. Order by asset_code ascending.

Schema

edw_assets
ColumnTypeDescription
edw_asset_idPKINTEDW asset record identifier
asset_codeVARCHAR(20)Business identifier used to match sources
asset_nameVARCHAR(100)Standardized asset name
lifecycle_statusVARCHAR(30)Current lifecycle status
site_codeVARCHAR(20)Facility or site identifier
last_verified_dateDATEDate the EDW record was last verified
access_asset_records
ColumnTypeDescription
access_record_idPKINTLocal Access record identifier
asset_codeVARCHAR(20)Business identifier supplied by the local database
asset_nameVARCHAR(100)Asset name from the local database
lifecycle_statusVARCHAR(30)Local lifecycle status
site_codeVARCHAR(20)Local facility or site identifier
imported_atTIMESTAMPTimestamp when the record was imported
Tablesedw_assetsaccess_asset_records
Interviewer

Your question is Ensuring Data Integrity Across Sources. Start with the requirements and the two 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.