Mast head image

Depth to Wet Layer by Dominant Component

This script retrieves the minimum depth to the wet layer for the dominant component of the data map unit


Text highlighted in yellow in the example script can be changed for a particular area, e.g. 'MO123' can be substituted for 'WI107'; also you can use wildcards to get the entire State e.g. 'MO%' will extract the state of Missouri. More examples can be found on the Tips page

Tips Page

Copy the example script below and paste it into the query page on the Soil Data Access site.

Soil Data Access Query Page

Example Script

SELECT

sc.areasymbol AS AREA_SYMBOL,

m.mukey AS MUKEY,

m.musym AS Map_unit_SYM,

m.muname AS Mapunit_name,

compname AS Component_name,comppct_r as Component_percent,

(SELECT TOP 1 MIN (soimoistdept_r)

FROM component AS c_sl

INNER JOIN comonth ON comonth.cokey=c_sl.cokey AND c_sl.cokey=c.cokey

INNER JOIN cosoilmoist ON cosoilmoist.comonthkey=comonth.comonthkey

AND soimoiststat = 'Wet'

GROUP BY c_sl.cokey, soimoistdept_r) AS Water_table_depth_wet

FROM sacatalog AS sc

INNER JOIN legend AS l ON l.areasymbol = sc.areasymbol AND sc.areasymbol LIKE 'WI007'

INNER JOIN mapunit AS m ON m.lkey = l.lkey

INNER JOIN component AS c ON c.mukey = m.mukey AND c.cokey =

(SELECT TOP 1 c1.cokey

FROM component AS c1

INNER JOIN mapunit AS mu1 ON c1.mukey=mu1.mukey AND c1.mukey=m.mukey

ORDER BY c1.comppct_r DESC, c1.cokey)

Example Table Output

Description of tables and columns can be found on this link: Table and Column Descriptions

Area_symbol MUKEY Map_Unit_sym Map_unit_name Component_name Component_percent Water_table_depth_wet
WI007 433739 6A Moquah fine sandy loam, 0 to 3 percent slopes, frequently flooded Moquah 85 76
WI007 1147400 3A Totagatic-Bowstring-Ausable complex, 0 to 2 percent slopes, frequently flooded Totagatic 40 0
WI007 433344 192A Worcester sandy loam, 0 to 4 percent slopes Worcester 85 30



Helping People Help the Land

USDA is an equal opportunity provider, employer, and lender.