Shows users with accept rates below a certain threshold
Q&A for scientific skepticism
-- Users with low accept rates -- Shows users with accept rates below a certain threshold WITH QuestionCounts AS ( SELECT p.OwnerUserId AS UserId, COUNT(*) AS QuestionCount FROM Posts p WHERE p.PostTypeId = 1 AND EXISTS ( SELECT 1 FROM Posts a WHERE a.ParentId = p.Id AND a.Score > 0 ) GROUP BY p.OwnerUserId ), AcceptedAnswerCounts AS ( SELECT q.OwnerUserId AS UserId, COUNT(*) AS AcceptedAnswerCount FROM Votes v INNER JOIN Posts p ON p.Id = v.PostId INNER JOIN Posts q ON q.Id = p.ParentId WHERE p.Score > 0 GROUP BY q.OwnerUserId ), AcceptRates AS ( SELECT q.UserId, ISNULL(a.AcceptedAnswerCount, 0) / CAST(q.QuestionCount AS float) AS AcceptRate FROM QuestionCounts q LEFT JOIN AcceptedAnswerCounts a ON a.UserId = q.UserId WHERE q.QuestionCount > ##MinQuestionCount## ) SELECT TOP ##MaxResults## UserId AS [User Link], AcceptRate * 100 AS AcceptRate FROM AcceptRates --WHERE AcceptRate <= (##MaxAcceptRatePercent## / 100.0) ORDER BY AcceptRate