Looking at choices, Mg has a positive charge in the compound so it is a metal and Cl2 is a non-metal (negative charge), so it is sonic since they contain a metal and non metal, where metal transfers electrons to non-metal thus having a positive charge, and non-metal has negative
Answer: MgCl2