Mast head image

Minimum Depth to Bedrock by Map Unit

This script retrieves the minimum depth to bedrock in a map unit by area symbol.


Text highlighted in yellow in the example script can be changed for a particular area; e.g., 'NE109' can be substituted for 'MO123'. 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

sacatalog.areasymbol AS Area_symbol,

mapunit.mukey AS MUKEY,

mapunit.musym AS Map_unit_symbol,

mapunit.muname AS Map_unit_name,

(SELECT TOP 1 reskind

FROM mapunit AS m_sl

INNER JOIN component AS c_sl ON m_sl.mukey = c_sl.mukey AND majcompflag = 'Yes' AND m_sl.mukey=mapunit.mukey

INNER JOIN corestrictions ON corestrictions.cokey=c_sl.cokey AND reskind LIKE '%bedrock%'

GROUP BY m_sl.mukey, reskind, resdept_r ORDER BY resdept_r ) AS Bedrock_kind,

(SELECT TOP 1 MIN (resdept_r)

FROM mapunit AS m_sl

INNER JOIN component AS c_sl ON m_sl.mukey = c_sl.mukey AND majcompflag = 'Yes' AND m_sl.mukey=mapunit.mukey

INNER JOIN corestrictions ON corestrictions.cokey=c_sl.cokey AND reskind LIKE '%bedrock%'

GROUP BY m_sl.mukey, resdept_r) AS Bedrock_depth

FROM sacatalog

INNER JOIN legend ON legend.areasymbol = sacatalog.areasymbol AND sacatalog.areasymbol = 'MO123'

INNER JOIN mapunit ON mapunit.lkey = legend.lkey

Example Table Output

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

Area_symbol MUKEY Map_unit_symbol Map_unit_name Bedrock_kind Bedrock_depth
MO123 2501670 73148 Jonca silt loam, 3 to 8 percent slopes Lithic bedrock 157
MO123 2501349 73155 Caneyville-Bucklick complex, 8 to 15 percent slopes, rocky Lithic bedrock 0
MO123 2501699 73157 Captina silt loam, 3 to 8 percent slopes



Helping People Help the Land

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