Q&A for professional and enthusiast programmers
SELECT NumClosed, NumQuestions, NumClosed * 100.0 / NumQuestions AS PercentClosed FROM ( SELECT COUNT(CASE WHEN ClosedDate IS NOT NULL THEN 1 END) AS NumClosed, COUNT(*) AS NumQuestions FROM Posts WHERE PostTypeId = 1 -- Questions ) Counts