How do you ensure data quality and integrity when merging datasets from disparate financial institutions?
Using the supplied tables, write a query that produces a reconciliation report for canonical customers. Consider only active source records and retain the most recent record for each institution and source customer. Flag customers with missing records, duplicate source records, conflicting names, or null balances.
Output
- One row per canonical customer, including customers with no active source record.
- Return
customer_id, customer_name, source_count, institution_count, merged_balance, and quality_status.
- Include contributing institution names where available, and order by
customer_id.