Along with a phosphate ion and nucleobase, a sugar (more precisely, a monosaccharide) forms one of the three components of a nucleotide. In nucleic acids, only ribose and deoxyribose appear, but more generally, monosaccharides form a wide array of organic compounds, including sweet-tasting crystals like glucose and fructose.

Monosaccharides mostly have the chemical formula $\mathrm{C}_x(\mathrm{H}_2\mathrm{O})_y$, although deoxyribose does not obey this pattern.

Wikipedia Wikipedia