Skip to main content

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_addresses
customer_idaddress
101 bangalore
102MUMBAI
103 chennai
104hyderabad
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

expected_output
customer_idaddress
101Bangalore
102Mumbai
103Chennai
104Hyderabad
105Delhi

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

Notebook Workspace

Cell 1Dataset: customer_addresses
15:00
Loading...
Run Results
✓ Workspace Ready
Rows Returned: --
Execution Time: --
Engine: Coming Soon
Execution Engine Coming Soon