Skip to main content

ISA-009 — Product Category Correction

🟢 Beginner

⏱ 20 Minutes

⭐ 15 Points

🔓 Free

💻 SQL | PySpark

🏢 Retail Analytics


Business Context

A retail company receives product data from multiple vendors.

Each vendor uses different naming conventions for product categories.

As a result, the same category appears in multiple formats.

Examples:

  • electronics
  • Electronics
  • ELECTRONICS

All represent the same business category.

The analytics team must standardize category names before loading them into reporting systems.


Business Impact

Inconsistent category values can cause:

  • Incorrect sales reporting
  • Duplicate category entries
  • Broken dashboard filters
  • Inaccurate inventory analytics

Standardized categories improve reporting accuracy and simplify downstream analytics.


Dataset

product_catalog
product_idproduct_namecategory
P101Laptopelectronics
P102MobileELECTRONICS
P103Shirtclothing
P104JeansCLOTHING
P105TelevisionElectronics

Task

Standardize all category values.

Use the following business standard:

  • Electronics
  • Clothing

Return all product records.


Expected Output

expected_output
product_idproduct_namecategory
P101LaptopElectronics
P102MobileElectronics
P103ShirtClothing
P104JeansClothing
P105TelevisionElectronics

Constraints

  • Category values may contain inconsistent capitalization.
  • All category values should follow Proper Case.
  • Return all product records.

Supported Languages

✅ SQL

✅ PySpark


Hint

Convert category values into a consistent capitalization format before returning the results.


Solution

🔒 Premium Solution

Premium members receive:

  • SQL Solution
  • PySpark Solution
  • Step-by-Step Explanation
  • Optimization Discussion

Notebook Workspace

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