Hammerers, in the game's own language, "Exist to despense dwarven justice." That is, they have no other function but to kill your own dwarves.
I built an "execution chamber" for my hammerer off of the jail cell for her to enjoy immediately. Full of spike traps, with windows for nobles to watch some good ol' dwarven justice. Unfortunately, the lever the Hammerer pulled, to see the spikes in action, only locked her in! Clearly, some miscommunication about which lever does what... Unfortunately, she couldn't tell the operator of the switch on the other side of the hall, who, due to this same miscommunication, and wound up spiking the hammerer in her right arm! With a red wound, she has since spent her entire stay in my fortress recouperating, completely unable to execute any dwarves who can't produce windows or bucklers because my magma forges were still filling up with lava, and so the job was left to my pathetically weak sheriff, whose beating dealt practically no damage to my dwarf who had been drafted into military service, and was wearing full plate mail at the time.
-------------
Basically, you can choose who your mayor will be. If she's very nice, friendly, takes pity, doesn't care much about rules, etc. she probably won't do much to your dwarves, especially if she likes, say, cabinets and cats. Some noble dwarves demand crystal glass or other extremely difficult-to-find objects, as determined by their preferences. They then demand that you make some of that type of object for you, and they don't care if you can't make it or not. Conversely, they may like something like, say, rope reed cloth, and if you don't buy EVERY SINGLE ROPE REED CLOTH from the merchants, they will start beating, jailing, or executing your dwarves for this "crime". Better still, they can effectively declare it "retroactively" by making it a crime to export random things after the merchants are already leaving.
In short, sometimes, nobles make impossible to fulfill demands. The only way to get a noble that has possible to fill demands is to "dispose" of the ones with impossible demands. If you get a noble who really likes windows, microcline, and silver on a map when you have a large glass factory going, and can import or mine plenty of silver reliably, then they get to live a long, healthy life. If that's what you already have, then congrats... but you should still probably show the baron's consort your new base diving attraction with his almost functioning backpack filled with what really should be a parachute... I mean, really, what purpose does that dwarf have? It's one less mandate to worry about.