runtime
Warehouse and Reporting · milestone 01 / 06

milestone 1/6 Bronze: inspect raw data before cleaning

Inspect incoming records before making cleaning decisions.

Warehouse and Reporting · Profile raw CRM/sales records, build Silver and Gold tables in the disposable lab, explore the fact table, and publish repeatable reporting logic.

approach

Bronze preserves source records for traceability. Profile missing keys, duplicates, dates, and type mismatches before writing cleaning rules. Do not silently erase rows without documenting why. These source rows are fictional, inspired by common CRM/catalog/sales issues.

worked-example.sql
SELECT TRIM(raw_id) AS customer_id,COUNT(*) AS versions
FROM bronze_customers
WHERE raw_id IS NOT NULL
GROUP BY TRIM(raw_id)
HAVING COUNT(*)>1;

data for this milestone

bronze_customers4 columns · 7 rows
raw_idtextnametextcountrytextupdated_attext
C001 Alice USA2025-01-01
C001 Alice Nguyen US2025-01-05
C002BenGB2025-01-02
C003 Cara UK2025-01-03
C004DevIND2025-01-04

showing 5 of 7 rows

bronze_sales6 columns · 13 rows
row_idinteger · keycustomer_idtextproduct_idtextquantitytextsalestextorder_datetext
1C001P012242025-01-01
2 C002 P031802025-01-02
3C001P021452025-01-15
4C003P0422402025-02-01
5C004P0321602025-02-05

showing 5 of 13 rows

challenge 1

Return customer_id (trimmed raw_id) and versions for non-NULL duplicate customer keys in bronze_customers.

Keep only keys with more than one version.

what to return

Columns
customer_idversions in this order
Rows
any order
challenge-1.sql
 
3 steps left · check both queries and pass the concept checkOpen the reportNext milestone
Bronze: inspect raw data before cleaning — Warehouse and Reporting · Runtime