ISA-007 — Customer Address Cleanup
🟢 Beginner
⏱ 15 Minutes
⭐ 10 Points
🔓 Free
💻 SQL | PySpark
🏢 Retail Analytics
Business Context
A retail company receives customer addresses from multiple source systems.
Because different applications collect address information differently, many records contain leading spaces, trailing spaces, and inconsistent capitalization.
These inconsistencies create duplicate customer profiles and reduce data quality in reporting systems.
The analytics team must standardize customer addresses before loading them into the customer master dataset.
Business Impact
Poorly formatted addresses can lead to:
- Duplicate customer records
- Incorrect customer matching
- Data quality issues
- Reporting inconsistencies
Standardized address values improve customer analytics and operational reporting.
Dataset
| customer_id | address |
|---|---|
| 101 | bangalore |
| 102 | MUMBAI |
| 103 | chennai |
| 104 | hyderabad |
| 105 | DELHI |
Task
Standardize customer addresses using the following rules:
- Remove leading spaces
- Remove trailing spaces
- Convert values to Proper Case
Return all customer records.
Expected Output
| customer_id | address |
|---|---|
| 101 | Bangalore |
| 102 | Mumbai |
| 103 | Chennai |
| 104 | Hyderabad |
| 105 | Delhi |
Constraints
- Addresses may contain leading spaces.
- Addresses may contain trailing spaces.
- Addresses may contain inconsistent capitalization.
- Return all customer records.
Supported Languages
✅ SQL
✅ PySpark
Hint
Clean whitespace first, then standardize capitalization.
Solution
🔒 Premium Solution
Premium members receive:
- SQL Solution
- PySpark Solution
- Step-by-Step Explanation
- Optimization Discussion