Score excedent distribution

0

Please login or register to vote for this query.

(click on this box to dismiss)

Score excedent, i.e. question score minus number of answers. E.g. an excedent of 0 means that the (net) number of votes on a question is exactly the number of answers. A positive excedent means more (net) upvotes than answers. A negative excedent means fewer (net) upvotes than answers.

Stack Overflow

Q&A for programmers

-- Score excedent distribution
-- Score excedent, i.e. question score minus number of answers.
-- E.g. an excedent of 0 means that the (net) number of votes on a question is exactly the number of answers.
-- A positive excedent means more (net) upvotes than answers.
-- A negative excedent means fewer (net) upvotes than answers.

WITH TotalPosts AS (
    SELECT CAST(COUNT(*) AS FLOAT) AS Count
    FROM Posts
    WHERE PostTypeId = 1 AND AnswerCount >= 0
)
SELECT 
    Score - AnswerCount  As [Score - AnswerCount],
    Count(*) AS [#Questions],
    Round(100.0 * Count(*) / (SELECT Count FROM TotalPosts), 2) AS [%]
FROM Posts
WHERE PostTypeId = 1 AND AnswerCount >= 0
GROUP BY Score - AnswerCount
HAVING Count(*) * 1000 >= (SELECT Count FROM TotalPosts)
ORDER BY Score - AnswerCount

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results
:records returned in :time ms:cached