Metallic magnesium is prepared by
Reduction of MgO by coke
Electrolysis of aqueous solution of Mg(NO3)2
Displacement of Mg by iron from MgSO4 solution
Electrolysis of molten MgCl2
MgCl2Electrolysis−−−−−−−→Mg+2+2Cl(Molten) Cation AnionAnode−2Cl−→2Cl+2e−,Cl+Cl→Cl2Cathode−Mg+2+2e−→Mg
The preparation of ethane by electrolysis of aqueous solution of potassium acetate is