Question: I studied the solubility of compounds in water. I have found that [calcium carbonate](http://en.wikipedia.org/wiki/Calcium_carbonate) doesn't dissolve in water. The teacher stated that the ionic compounds dissolve in water except some carbonates. What would be a clear elaboration of this phenomenon?

Answer: 
As someone said here, this:

> 
> The teacher stated that the ionic compounds dissolve in water except
>  some carbonates.
> 
> 
> 

Is indeed an oversimplification. First of all, the distinction between an "ionic compound" to other compounds isn't too defined. What your teacher probably said, or didn't say but wanted to, is that some ionic compounds easily dissolve in water. Salt (halite - NaCl) is the best example.

Calcium carbonate, in nature, also commonly dissolves. It's just not as immediate as dissolution of the more soluble ionic compounds. You are probably familiar with this phenomenon:

![picture of a cave](https://i.stack.imgur.com/FMZlp.jpg)

This forms *because* calcium carbonate dissolves. The rock is limestone, which is usually composed of pure calcium carbonate. Acidic water greatly enhances the solubility of calcium carbonate, and it doesn't even need to be highly acidic. Rain or river water that come into contact with the atmosphere absorb the $\ce{CO2}$ as $$\ce{H2O + CO2 <=> H2CO3},$$ which then facilitates calcium carbonate dissolution with $$\ce{CaCO3 + H2CO3 <=> Ca^2+ + 2HCO3-}.$$
For an ionic substance to dissolve in water, there are two competing factors that determine the enthalpy of solution $\Delta{H}\_\mathrm{sol}$ which is the enthalpy (energy) change when a solute is dissolved in a solvent:

1. The lattice energy (LE), the energy of formation of the crystal between infinitely separated ions. As LE is proportional to the charges of its ions, for calcium carbonate, its LE would be roughly 4× the LE of sodium chloride. $$\ce{CaCO3 (s) -> Ca^2+ (g) + CO3^2- (g)}$$ This value is always positive, as energy is required to separate the ions.
2. The hydration energy of gaseous ions, which is the enthalpy change when gaseous ions dissolve in sufficient water to give an infinitely dilute solution. $$\ce{Ca^2+ (g) + CO3^2- (g) -> Ca^2+ (aq) + CO3^2- (aq)}$$ These values are always negative, as energy is released upon hydration of ions.

As the LE of calcium carbonate is so large, a great amount of free energy would be required to break the strongly attracted ions apart, and this energy has to come from the enthalpy of hydration. In the case of calcium carbonate, the enthalpy of hydration is not large enough to overcome the large lattice energy, hence it exists as a solid.

Do note that solubility of ionic compounds are not absolute. In fact, solubility in water is often given as a value in g/L of water. 

However, generally, we define solubility as:

1. Soluble substances can form a 0.1 M solution at 25 °C.
2. Insoluble substances cannot form a 0.1 M solution at 25 °C.