Q&A for professional and enthusiast programmers
SELECT FORMAT(COUNT(CASE WHEN AnswerCount > 0 THEN 1 END), 'N0') As QuestionsAnswered, FORMAT(COUNT(*), 'N0') As QuestionsAll, FORMAT(CAST(COUNT(CASE WHEN AnswerCount > 0 THEN 1 END) AS FLOAT) / COUNT(*), 'P0') As AnsweredPercent FROM Posts WHERE PostTypeId = 1