134 Tables · 35 Relationships · The Architecture

The SSURGO
Data Model

Understanding the schema is the difference between struggling with SSURGO and mastering it. This is your permanent reference — join chain, key tables, live column lookup, and the most common mistakes.

The Foundation

The Core Join Chain

Every SSURGO query follows this spine. Four tables. Three joins. One pattern to rule them all.

Survey Area
legend
lkey — Primary Key
areasymbol — e.g. WI025
areaname — Dane County
saverest — Last updated
~3,500 rows
lkey
Map Unit
mapunit
mukey — Primary Key
lkey — FK → legend
musym — Map symbol
muname — Unit name
muacres — Acreage
~180K rows
mukey
Component
component
cokey — Primary Key
mukey — FK → mapunit
compname — Soil name
comppct_r — Coverage %
majcompflag — Major?
drainagecl — Drainage
~300K+ rows
cokey
Horizon
chorizon
chkey — Primary Key
cokey — FK → component
hzname — Ap, B, C…
hzdept_r — Top depth cm
om_r — Organic matter %
awc_r — Available water
~1M+ rows
The Canonical SSURGO Query — All Four Tables
Extended Relationships
mapunit → muaggatt

Pre-aggregated map unit attributes — 150+ soil properties already summarized. AWS, KSAT, flooding frequency, farmland class. Use when you don't need component-level detail.

component → cointerp

Soil interpretation ratings — NCCPI productivity, Fragile Soil Index, drainage suitability, building site ratings. Join on cokey, filter by mrulename and ruledepth=0.

component → corestrictions

Root-limiting layers: fragipan, lithic bedrock, paralithic bedrock, duripan. Use to find depth-to-restriction for root zone depth calculations.

chorizon → chtexturegrp

Texture class and modifier for each horizon. Join on chkey, filter rvindicator='Yes' for representative value. Returns sandy loam, silty clay loam, etc.

chorizon → chfrags

Rock fragment type, shape, hardness, and volume % for each horizon. Essential for SOC calculations (fragment correction) and construction suitability.

mapunit → muaoverlap → laoverlap

MLRA overlap — which Major Land Resource Areas a map unit falls in. Used for regional soil analysis and NCCPI normalization within MLRAs.

Live Reference

Find Any Column

Search any table name to see its columns, data types, and descriptions — fetched live from SDA MetadataColumn.

🔍
Quick:
Enter a table name and click Look Up to see its columns.
Avoid These

Four Common Mistakes

1. Forgetting majcompflag

Without AND c.majcompflag = 'Yes', you get every component including minor inclusions that cover only 5–10% of a map unit. Your results will have 3–10× more rows than expected and weighted averages will be skewed.

Fix: Always add AND c.majcompflag = 'Yes' when you want dominant soil data.

2. Wrong JOIN key for legend

A common mistake is joining legend to mapunit using ON l.areasymbol = mu.areasymbol — but mapunit has no areasymbol column. The correct join is always ON mu.lkey = l.lkey.

Fix: INNER JOIN mapunit mu ON mu.lkey = l.lkey

3. Temp tables in SDA REST

4. NULL AWC values in calculations

Horizon AWC (awc_r) can be NULL for organic surface layers, bedrock, and water features. A raw multiplication will return NULL for the entire horizon sum.

Fix: Use ISNULL(ch.awc_r, 0) in AWS calculations to treat NULL as zero thickness contribution.
Go Deeper

Full Interactive Schema Explorer

The Soil Intelligence companion site has a D3 force-directed ER diagram of all 134 SSURGO tables, sortable column browser with all 12 metadata fields, and a live domain value decoder.

🔗
Soil Intelligence
Interactive ER Diagram 134 tables · 78 relationships · D3 force layout · Domain decoder
🔍
Soil Intelligence
SQL Explorer — 272 Scripts CART · CEAP · ACPF · Hydrology · Carbon · QA — browse by category
⚗️
This Site
Query Lab Live SDA sandbox — run any query, see results instantly
Note: The companion ER diagram link points to the Soil Intelligence GitHub Pages site, maintained as a separate repository. If it doesn't resolve, check github.com/jneme910/NRCS-Soil-Data-Access.