Dear student,
Ordinary common salt contains some impurities of Magnesium chloride which is a deliquescent substance (tending to absorb moisture). This makes the common salt unstable in the rainy season and the formula of magnesium chloride is MgCl2.
Regards