How do you validate data consistency across multiple databases in an automated test?
Assume synchronized extracts from two databases are available in qa_source_orders and qa_target_orders. Write a SQL query that identifies records missing from either extract or containing different field values.
order_id, source and target values, and consistency_statusorder_id ascending| Column | Type | Description |
|---|---|---|
| order_idPK | INT | Order identifier from the source database |
| customer_email | VARCHAR(255) | Customer email recorded in the source database |
| total_amount | DECIMAL(10,2) | Order total recorded in the source database |
| order_status | VARCHAR(30) | Order status recorded in the source database |
| Column | Type | Description |
|---|---|---|
| order_idPK | INT | Order identifier from the target database |
| customer_email | VARCHAR(255) | Customer email recorded in the target database |
| total_amount | DECIMAL(10,2) | Order total recorded in the target database |
| order_status | VARCHAR(30) | Order status recorded in the target database |