Question score against number of answers (relative)

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

-- Question score against number of answers (relative)
-- 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.

SELECT 
    AnswerCount As [Answers],
    Count(*) AS [#Questions],
    Round(100.0 * Count(CASE WHEN Score-AnswerCount < -3 THEN 1 END) / Count(*), 1) AS [excedent < -3],
    Round(100.0 * Count(CASE WHEN Score-AnswerCount = -3 THEN 1 END) / Count(*), 1) AS [-3],
    Round(100.0 * Count(CASE WHEN Score-AnswerCount = -2 THEN 1 END) / Count(*), 1) AS [-2],
    Round(100.0 * Count(CASE WHEN Score-AnswerCount = -1 THEN 1 END) / Count(*), 1) AS [-1],
    Round(100.0 * Count(CASE WHEN Score-AnswerCount = 0 THEN 1 END) / Count(*), 1) AS [0],
    Round(100.0 * Count(CASE WHEN Score-AnswerCount = 1 THEN 1 END) / Count(*), 1) AS [1],
    Round(100.0 * Count(CASE WHEN Score-AnswerCount > 2 THEN 1 END) / Count(*), 1) AS [> 1]
FROM Posts
WHERE PostTypeId = 1 AND AnswerCount >= 0
GROUP BY AnswerCount
ORDER BY AnswerCount

Enter Parameters

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