Q&A about the site for finance professionals and academics
SELECT u.Reputation, COUNT(CASE WHEN p.Id = q.AcceptedAnswerId THEN 1 END) AS AcceptedAnswers, COUNT(*) AS TotalAnswers, CAST(COUNT(CASE WHEN p.Id = q.AcceptedAnswerId THEN 1 END) AS FLOAT) / COUNT(*) AS AcceptanceRate FROM Posts p JOIN Users u ON p.OwnerUserId = u.Id JOIN Posts q ON p.ParentId = q.Id WHERE p.PostTypeId = 2 -- 2 for Answers GROUP BY u.Reputation ORDER BY u.Reputation;