Your question is Cast and Clean Data in SQL. Start with the requirements and the one table on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Microsoft Store analysts receive revenue data from multiple reporting systems, so the same value may contain currency symbols, commas, whitespace, or invalid text. Write a PostgreSQL query to prepare the revenue column for analysis.
raw_revenue by removing currency symbols, commas, and surrounding whitespace, then cast valid values to NUMERIC(12,2).NULL for missing or invalid revenue values, and order the results by sale_id.| Column | Type | Description |
|---|---|---|
| sale_idPK | INTEGER | Unique sale identifier |
| product_name | VARCHAR(100) | Microsoft Store product name |
| raw_revenue | VARCHAR(30) | Revenue received as unprocessed text |