They are usually formed within molten rock as it cools near or on the Earth's surface. The basic surroundings of the molten rock as it cools determines what kind of mineral formed. So if molten rock crystallizes near the top of the earth's surface it would end up being a different mineral than one that crystallized deep beneath the surface due to different pressures and temperatures. The carbonates are made up of carbon and oxygen and are the second most common mineral group found. An important ingredient in the carbonates is mineral calcite.
Calcite makes up two well known rocks limestone and marble.
Many carbonates have commercial uses and a great economic value. Earth has mineral resources yet unfound or mined at this time. Minerals that can be found by mining are called ORES and are extracted, not for the good of humankind but, for profit. If you have any questions regarding minerals or how to make your own web page feel free to drop me an e-mail and I will try my best to answer any question you have.