Pure magnesium's formula would just be Mg because all elements except for 7 nonmetals are just left alone when they are by themselves in a formula. The 7 diatomic elements( means they have to have two of them without another element attached to it aka. a subscript two after it when it's by itself) are hydrogen, nitrogen, oxygen, fluorine, chlorine, bromine, and iodine. An easy way to remember the diatomic seven is that when looking at a periodic table if you trace over them from nitrogen over to fluorine and down to iodine all of those elements are diatomic + hydrogen.
And your unbalanced and balanced equations are correct.
(sorry I went on a tangent with the diatomic rules hopefully it will help you in the future though)
<span>Ionic compounds are chemical compounds in which ions are held together in a lattice structure by ionic bonds. They have a high melting and boiling point, and they have a high hardness and are very brittle. The cations and anions are stuck together in a sense. So in this case, sodium (Na) is attracted to Chlorine (Cl).</span>