The chemical formula of quartz is SiO2. Silicium is a metal, its oxide is a semiconductor which is used for all kinds of electronic units, LEDs and so forth.
Quartz is the most common mineral in the continental crust of Earth, its average content ranges from 58% to 63% (weight percent). It is rather hard, harder than steel or regular glass, seven on the Mohs scale. It is generally transparent and resistant against most chemicals, especially acids, so it is very useful to store dangerous chemicals in quartz containers. And in nature it is found in virtually thousands of different forms, colours and structures. Some varieties shows rare optical effects, triboluminescence, and piezoelectricity. On the other hand it is so common, it almost exclusively forms the sand dunes of deserts.
Quartz is generally a part of many rocks. A rock composed of different chemical substances tends to decompose when it is weathered. The least resistant component is gone first, destabilizing the whole structure. Quartz is generally the most resistant component, so it will remain when all other components are dissolved by the water and eroded (transported away). But while it is resistant against chemical weathering, it is also brittle and the mechanical types of weathering shatter it until it is sand. So most sand is actually composed of quartz grains, which is subsequently sedimented again. Glued together by quartz it forms a quartz sandstone called quartzite, which is probably the most durable of all rocks.
However, there is still a common way of dissolving quartz, but this tends to happen underground, not on the surface. Thermal groundwater with a certain Eh-pH chemistry is able to dissolve quartz and transport it in solution. Often the Eh-pH values changes and the quartz is deposited somewhere else. As thermal waters often form convection cells, the water slowly but continually flows collecting certain minerals on its way and transporting them to a certain point of its course. Typically the place of deposition is some kind of subterranean space. Common are gas bubble in basalt, which form rounded holes of various shapes. Other spaces are all kinds of clefts, often they are filled with material the same speed they are opened by tectonic forces.
This site is about mines and caves, not about minerals. There are no special quartz mines, although is is used in huge amounts for the production of electronic parts. The quartz for this use is simply collected by quarrying quartz sand. But there are a few really interesting exceptions.
There are gemstone mines in which semi-precious quartz minerals are mined, such mines exist in Finland, Germany, U.S.A., and Brasil. Then there are quarries which are open for mineral hunting. The quartz needed for the production of glass was often mined in hardrock mines. During Prehistoric times there were flintstone mines for the production of raw material for stone tools. Really rare are natural caves or geodes with quartz crystals inside, which are accessible in situ.