ionic compounds are compounds with ionic bonds, given by the exchange of electrons between a cation (positive ion) and an anion (negative ion).
ionic compounds usually consist of a metallic element and a non-metallic element.
as such, cacl2, mgo, and na2o are ionic compounds. c6h12o6 and sio2 consists of non-metallic elements only, so they do not form ionic bonds.