Sorry, you are very incorrect on your understanding. Democracy means the right of people to vote and rule their country. That's it. No military involved. But historically, some countries like Iraq, Libya, to some extent even Turkey and then Pakistan are some examples where the military wants to have influence in everything. Doesn't mean they should constitutionally. But its primarily because the people haven't risen up for their right, like what you see in Turkey today.
This is a life changing event for Turkey. In the future, there will never be a coup as the military watching tv, knows how people will deal with them. I've seen footage of the same soldiers who came in on tanks supported by army gunships, leaving in underwears with their hands up in the air and with bruised up faces and bleeding heads, pleading for mercy from the people who wanted to kill them because of the treason they committed and disrupted an entire country's system over night. So wherever there is a military who thinks they are above the law, well, they should learn from the past 24 hours in Turkey. Tomorrow could be their turn....