Sugar is a compound. A compound is a homogeneous state of matter, meaning that the elements of a compound are in proportion to each other. Compounds present as a unified group of elements. Other examples of compounds include water and salt.
The individual elements that make up a compound have individual properties. When combined in a compound, these individual properties are not retained. For example, sodium and chlorine are poisonous, but they can be combined to make table salt, which is not poisonous.
A mixture, in contrast to a compound, is a heterogeneous form of matter with variable proportions of atoms and molecules. Examples of mixtures include soil, ocean water and air.