ISA-003 Null Value Handling
🟢 Beginner
⏱ 15 Minutes
⭐ 10 Points
🔓 Free
💻 SQL | PySpark
🏢 Retail Analytics
Business Context
A retail company receives customer records from multiple source systems.
Some customer records arrive without email addresses.
Marketing campaigns require a valid email value for every customer record.
The analytics team has decided that whenever an email is missing, it should be replaced with:
unknown@example.com
before loading the data into reporting systems.
Dataset
customer_contacts
| customer_id | customer_name | |
|---|---|---|
| 101 | John | john@example.com |
| 102 | Alice | |
| 103 | Bob | bob@example.com |
| 104 | Sarah | |
| 105 | David | david@example.com |
Task
Replace all NULL email values with:
Return all customer records.
Expected Output
expected_output
| customer_id | customer_name | |
|---|---|---|
| 101 | John | john@example.com |
| 102 | Alice | unknown@example.com |
| 103 | Bob | bob@example.com |
| 104 | Sarah | unknown@example.com |
| 105 | David | david@example.com |
Constraints
- Email values may contain NULL.
- Replace only NULL email values.
- Existing email addresses must remain unchanged.
- Return all customer records.
Supported Languages
✅ SQL
✅ PySpark
Hint
Replace missing email values using a function that provides a default value when NULL is encountered.
Solution
🔒 Premium Solution
Premium members receive:
- SQL Solution
- PySpark Solution
- Step-by-Step Explanation
- Optimization Discussion
Notebook Workspace
Cell 1Dataset: customer_contacts
⏱ 15:00
Loading...
Run Results
✓ Workspace Ready
Rows Returned: --
Execution Time: --
Engine: Coming Soon
Execution Engine Coming Soon