Q&A for professional and enthusiast programmers
select count(p.Id) as [Total Questions], sum(case when p.AcceptedAnswerId > 0 then 1 else 0 end) as [Answered Questions], sum(case when p.AcceptedAnswerId > 0 then 0 else 1 end)*1000 / count(p.Id) / 10.0 as [Percentage Unanaswered] from Posts as p, PostTags as pt, Tags as t where p.PostTypeId = 1 and p.Id = pt.PostId and pt.TagId = t.id and t.TagName = '##TagName##'