How do you handle data cleaning and transformation when working with disparate sources like Workday or internal databases?
Write a SQL query that standardizes employee records from Workday and an internal HR database, then returns one reconciled row per employee. Treat blank strings as missing values, normalize department names to a single canonical value, and prefer the most recent non-null hire date when both sources disagree.
| Column | Type | Description |
|---|---|---|
| employee_idPK | INT | Workday employee identifier |
| full_name | VARCHAR(255) | Employee full name as stored in Workday |
| department | VARCHAR(255) | Department name in Workday |
| hire_date | DATE | Hire date in Workday |
| Column | Type | Description |
|---|---|---|
| employee_idPK | INT | Internal employee identifier |
| full_name | VARCHAR(255) | Employee full name as stored internally |
| department | VARCHAR(255) | Department name in the internal system |
| hire_date | DATE | Hire date in the internal system |