what structure does magnesium have
Metallic bonding in magnesium. If you work through the same argument with magnesium, you end up with stronger bonds and so a higher melting point. Magnesium has the outer electronic structure 3s 2. Both of these electrons become delocalised, so the sea has twice the electron density as it does in sodium. The remaining ions also have twice the charge (if you are going to use this particular view of the metal bond) and so there will be more attraction between ions and sea.