07 / 09Public data · SQL2024

US Household Income

A complete SQL cleaning and exploratory workflow for United States household-income and geographic data.

US Household Income project cover
32,533income rows profiled
32,526statistics rows profiled
2datasets joined
4+geographic levels explored

The question

Turn two inconsistent public datasets into a reliable foundation for comparing household income across states, cities, places, and area types.

The approach

I profiled both tables, removed duplicates, standardized state and area labels, filled missing places, checked land and water fields, joined the datasets, and built income comparisons at several geographic levels.

The outcome

The final queries support state rankings, land and water comparisons, mean-versus-median income analysis, and targeted city or area-type drilldowns.

Analysis questions

What the work needed to answer.

  1. 01

    Are identifiers, state names, places, and area labels consistent?

  2. 02

    Which states have the highest and lowest land and water totals?

  3. 03

    How do mean and median household income differ by state and area type?

  4. 04

    Which city-level patterns deserve a closer drilldown?

Method

From raw data to a useful answer.

01

Profile and rename

Checked row counts and schemas, then aligned the ID field for a reliable join.

02

Remove duplicates

Used ROW_NUMBER to identify repeated IDs and retain one valid record.

03

Standardize geography

Corrected Georgia and Alabama labels, filled missing places, and consolidated inconsistent borough naming.

04

Explore income

Joined geography with statistics and compared mean and median income by state, city, place, and area type.

Results

What the analysis revealed.

01

Small inconsistencies matter

Misspelled states, missing place names, and inconsistent area labels would have fragmented group-level results.

02

Window functions simplify deduplication

Partitioning by ID made repeated records explicit and safe to remove.

03

Mean and median tell different stories

Viewing both measures prevents a small number of high-income areas from defining the typical household.

04

The joined view supports drilldown

Once cleaned, the same model can move from national comparisons to states, area types, and individual cities.

Next projectWorld Life Expectancy