NAICS 21

NAICS 21 is the category within the North American Industry Classification System which is composed of establishments that extract naturally occurring mineral solids(i.e. as metals, coal and other industrial minerals), liquid minerals (i.e. crude petroleum) and gases (i.e. natural gas).
Definition of mining.
NAICS 21 uses the term "mining" to include quarrying, well operations, beneficiating and other mineral preparation customarily performed at the mine sites, or as a part of mining activity and distinguishes two basic activities: 
Mine operation.
Mine operation includes companies that operate mines, quarries, or oil and gas wells for themselves, and companies which operate them on a contract or fee basis.
Mining support activities.
Mining support activities include companies that perform exploration (except geophysical surveying) and other mining services, on a contract or fee basis, with the exception of mine site preparation and construction of oil/gas pipelines.
Further breakdown.
Companies are grouped and classified according to the natural resource which is or will be mined. Industries include establishments that develop the mine site, extract the natural resources, and/or those that process the mineral mined.
Smelting and refining.
Smelting and refining take place in both the "mineral processing" (NAICS 21) stages and the manufacturing stages (NACIS 31-31).