The data
| Source | Rows | What it adds |
|---|---|---|
| US Cars auction listings | 2,499 | Price, mileage, model year, title status, state |
| EPA fuel economy data | 41,804 | Fuel economy, vehicle class and fuel type for every make and model year, 1984–2020 |
fact_listings holds one clean listing. dim_location holds state and Census region. dim_make_year holds EPA specs rolled up to make and model year. dq_removed_rows logs every removed row and the reason.
Cleaning
| Step | Rows |
|---|---|
| Raw listings | 2,499 |
| Placeholder prices under $100, such as $0 and $25 opening bids | −64 |
| Non-passenger vehicles (Peterbilt, Harley-Davidson, Heartland RVs) | −10 |
| Canadian listings | −7 |
| Impossible mileage (0 miles or over 500,000) | −4 |
| Duplicate rows | −1 |
| Clean listings | 2,413 |
Two columns were left out of the analysis. condition is auction time left, such as “2 days left” (832 rows) and “21 hours left” (492 rows). model is unreliable: its most common values are “door” (651), “doors” (148) and “mpv” (87). The EPA join uses make and model year.
2,412 of 2,413 clean listings matched on make and year. The miss is a 1973 Chevrolet, older than the EPA file, which starts in 1984.
Findings
Title status is the biggest price gap
A salvage title cuts the median from $18,000 to $2,425, a drop of 86.5%. That is a wider gap than any mileage band or model year. Clean titles are 2,318 listings. Salvage titles are 95.
Price falls with mileage, steepest in the first 50,000 miles
On clean titles, the first extra 25,000 miles take about $8,200, or 33%, off the median. After 100,000 miles the price flattens. Across individual listings the correlation is r = −0.33.
| Mileage | Listings | Median price |
|---|---|---|
| Under 25K | 729 | $24,700 |
| 25K–50K | 948 | $16,500 |
| 50K–100K | 431 | $13,200 |
| 100K–150K | 168 | $7,800 |
| 150K+ | 42 | $7,160 |
Depreciation by age
On clean titles, the steep drops are year 2 (−27.6%) and years 6 and 7 (−27.3% and −34.4%). Age 0 is cheaper than age 1, and only 47 cars are 2020 models, so that bump is noise.
The Midwest premium is a mix of newer, lower-mileage cars
Midwest listings average $23,147, about $5,400 above the South. Those Midwest cars average 36,000 miles and 2.5 years old. Texas, the cheapest state in the file at $14,460, averages 68,000 miles and 3.8 years. The gap is which cars are listed where.
Nissan is young and cheap
Among brands with 30 or more clean listings, Nissan cars are the youngest and least driven, and still about $10,000 below Ford. A brand’s EPA lineup fuel economy has only a weak link to price (r = −0.15). Price tracks mileage (r = −0.33) and model year (r = +0.23) more closely.
- Ford, 50.0%
- Dodge, 17.5%
- Nissan, 12.9%
- Chevrolet, 11.3%
- All others, 8.3%
Limits
- Half the listings are Ford (50%), so brand and regional averages lean toward Ford.
- These are auction listings, not dealer retail prices. Many are insurance and fleet disposals.
- The model field is unreliable, so results stay at the brand level.
- The regional gaps are not adjusted for mileage, age or brand. A regression would be the next step.
What the SQL demonstrates
- Staging tables, cleaning rules in
transform.sql, and a star schema, with every removed row logged. - A median from
ROW_NUMBER()andCOUNT() OVER, because MySQL has noPERCENTILE_CONT. - Year-over-year change with
LAG(), rank within region withRANK(), and share of total withSUM() OVER (). - Pearson correlation from
AVGandSTDDEV_POP. - A join of two public datasets on normalized keys, including lowercase make and “land” to Land Rover.