Messy data for cleaning practice
1,000 × 12rows × columns in the 1,000-row file
Updated 3 November 2026. Fictional U.S. businesses and people, generated with a fixed seed.
textnumberdateyes/no
Largest file10,000rows; also 100 and 1,000
Columns12with a data dictionary below
Dates2019-01-10 – 2024-12-28range in the file
LicenceCC0synthetic, free for any use
What is in it
The customer table with problems added on purpose: repeated customer IDs, names in the wrong case, trailing spaces, blank emails, phone numbers in three formats, state names mixed with codes, dates in three formats, and $ signs or N/A in the spend column.
Practise first, then check: the data cleaning exercise counts every problem in this file. The clean version is the customer data set.
First rows
point at a column to light it up
| customer_idtext | first_nametext | last_nametext | emailtext | phonetext | citytext | statetext | signup_datedate | segmenttext | total_ordersnumber | total_spentnumber | notestext |
|---|---|---|---|---|---|---|---|---|---|---|---|
| CU10001 | Ryan | Jackson | RYAN.JACKSON0@EXAMPLE.COM | (212) 555-0190 | Omaha | NE | 2019-08-30 | Small Business | 7 | 1353 | |
| CU10002 | Michael | Chen | michael.chen@example.com | (617) 555-0184 | Hartford | CT | 05/21/2019 | Consumer | 2 | 174.9 | |
| CU10003 | David | Nelson | david.nelson@example.com | (206) 555-0147 | Chicago | IL | 2024-12-26 | Consumer | 3 | 245.05 | |
| CU10004 | sofia | Ramirez | sofia.ramirez@example.com | (617) 555-0195 | Nashville | TN | 2024-04-26 | consumer | 2 | 115.31 | |
| CU10005 | Laura | Torres | laura.torres@example.com | 305-555-0176 | Charlotte | NC | 12/26/2023 | Consumer | 3 | 259.43 | |
| CU10006 | Ryan | Davis | ryan.davis@example.com | (206) 555-0158 | Minneapolis | MN | 3 Jul 2021 | Consumer | $264.53 | duplicate? | |
| CU10007 | Rebecca | Sanchez | rebecca.sanchez@example.com | (305) 555-0179 | Atlanta | GA | 2024-04-03 | Consumer | 1 | 91.5 | duplicate? |
| CU10008 | Barbara | Ramirez | barbara.ramirez7@example.com | (512) 555-0113 | Austin | TX | 14 Apr 2024 | Enterprise | 22 | 14129.96 | |
| CU10009 | Michael | White | michael.white@example.com | (702) 555-0188 | Denver | CO | 2019-02-13 | Consumer | 7 | 651.35 | |
| CU10010 | Jennifer | Hill | jennifer.hill@example.com | 2125550167 | Los Angeles | CA | 2022-05-21 | Consumer | 3 | 144.81 | call back |
Data dictionary
| Column | Type | Meaning |
|---|---|---|
| customer_id | text | Customer number |
| first_name | text | Fictional first name |
| last_name | text | Fictional last name |
| text | Email (example.com, not real) | |
| phone | text | Fictional number in the 555-01xx range reserved for fiction |
| city | text | City |
| state | text | Two-letter state code |
| signup_date | date | Account created (2019-2024) |
| segment | text | Consumer, Small Business or Enterprise |
| total_orders | integer | Orders placed so far |
| total_spent | decimal | Lifetime spend (USD) |
| notes | text | Free text, often blank |
Practice questions
answers checked in SQL and in Python
How many customer_id values appear more than once?
40 duplicated IDs
Excel
=SUMPRODUCT(--(COUNTIF(A2:A1001,A2:A1001)>1))/2 (each duplicate pair counted once)SQL
SELECT COUNT(*) FROM (SELECT customer_id FROM messy_customers GROUP BY customer_id HAVING COUNT(*)>1)File: messy-customers-1000
How many rows have a blank email?
44 rows
Excel
=COUNTBLANK(D2:D1001)SQL
SELECT COUNT(*) FROM messy_customers WHERE email IS NULL OR email=''File: messy-customers-1000
How many signup dates are not in YYYY-MM-DD form?
225 rows
SQL
SELECT COUNT(*) FROM messy_customers WHERE signup_date NOT GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]'File: messy-customers-1000
How many total_spent values are not plain numbers?
160 rows ($-prefixed text or N/A)
SQL
SELECT COUNT(*) FROM messy_customers WHERE typeof(total_spent) NOT IN ('integer','real')File: messy-customers-1000