Classify the following compounds as ionic or covalent:

a. MgCl₂

b. Na₂S

c. H₂O

d. H₂S