instruction: Question Accepted Answer Percentage by Tag.
response: SELECT t.TagName, COUNT(DISTINCT questions.Id) AS "numquestions", COUNT(*) AS "numanswers", SUM(CASE WHEN questions.AcceptedAnswerId = answers.Id THEN 1 ELSE 0 END) AS "numaccepted", SUM(CASE WHEN questions.AcceptedAnswerId = answers.Id THEN 1 ELSE 0 END) * 100.0 / COUNT(DISTINCT questions.Id) AS "acceptedpercent" FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS questions ON questions.Id = pt.PostId INNER JOIN Posts AS answers ON answers.ParentId = questions.Id GROUP BY t.TagName ORDER BY 'acceptedpercent' DESC