Rock salt, commonly referred to as halite, is crystallization of saltm which has the chemcial formula NaCl. If you dissolve salt into water, which has the chemical formula H2O (subscript), you separate the sodium part of the salt formula from the chlorine part. If you then conduct an elecrolysis of the water/salt solution (conducting a low current from a battery through the solution), it looks something like this:
NaCl + H2O (subscript_ ---> Na+ plus Cl- plus H+ plus OH-
These ions will rearrange, produce NaOH, sodium hydroxide, and liberate two gases, chlorine gas, Cl2 (subscript), and hydrogen gas, H2 (subscript).
It should be noted that chlorine gas has poisonous capabilies. This electrolysis should be performed with small quantities and in a well-ventilated area. Hydrogen gas is also very explosive when combined with oxygen from the air, make sure there is no open flame present that could iniate such a reaction.