Mining companies mine rock for the ore contained in the rock, or in a looser sense of mining (to include quarrying), for the rock itself as a building material (say for sand and gravel as building or road base). "Ore" refers to the component of the rock which can be used as a feed for industrial processing, and typically refers to elements (metals, calcium, phosphorus, whatever) rather than minerals although some minerals are valuable of themselves (the element is not the target, the crystalline form is the target). Diamonds would fit that latter definition.
There is a less common use of the word "Mining" to include extraction of non-solids (liquids and gases), but typically, Oil and Gas is seen as a separate industry or economic activity from Mining and Minerals. The extraction methods are quite different for the two, so the two resource extraction processes are normally discussed separately, as they are so distinct in nature. However, there are contexts where "mining" of resources can be used inclusively, and refer to both categories at once.