flavor compounds are not particularly related to sugars perse.
However most sugar sources have some flavor compounds as well. if those compounds are plentiful enough, and not so volatile as to be completely blown off by an active fermentation then they will affect the flavor of th finished beer.
additionally, alcohol both has a flavor of it's own, and will enhance and transport flavor molecules from other sources. In this way the amount of fermentables will affect the character of the finished beverage.
mead is a good example, honey is more or less completely fermentable assuming you don't add too much for the yeast to handle. what's left behind are alcohol, flavor and aroma molecules that were heavy enough and stable enough to survive the heavy scrubbing from co2 during fermentation, and of course yeast byproducts. What you are left with is essentially the flavor of honey which is separate from the sweetness of honey. It often smells and tastes something like the flowers it was collected from.
with beer it's more complicated because there are a lot of processes going on before you ever touch the ingredients and each of these has an effect on the flavor molecules present in the grain, hops, sugar, etc. but the basic concept is the same, the fermentable sugars will be turned into alcohol and co2. the yeast will produce and excrete not only alcohol and co2 but also a variety of esters, phenols, and other substances that will have flavor and aroma. but the hops, the grain, and whatever adjuncts you might have added will have their own flavor substances that will either remain, be blown off by the fermentation, or be transformed by the yeast into something else.