Average quality of answers by users

4

Please login or register to vote for this query.

(click on this box to dismiss)

Average votes of answers for users with at least MinAnswers answers

Robotics Meta

Q&A about the site for professional robotic engineers, hobbyists, researchers and students

-- Average number of votes per question
SELECT 
  Votes / Posts AS [Votes],
  Upvotes / Posts AS [Upvotes],
  Downvotes / Posts AS [Downvotes],
  Cast (Downvotes AS Float) / Upvotes AS [Down/Up ratio]
FROM
(
SELECT
  Count(DISTINCT v.PostId) AS [Posts],
  Count(*) AS [Votes],
  Count(CASE v.VoteTypeID WHEN 2 THEN 1 END) AS [Upvotes],
  Count(CASE v.VoteTypeID WHEN 3 THEN 1 END) AS [Downvotes]
FROM 
  Votes v
JOIN 
  Posts p ON v.PostId=p.Id
WHERE 
  p.PostTypeId = 2 and
  p.ClosedDate is null and 
  ( 
    DATEPART(YYYY, p.CreationDate) > ##YYYY##  or 
    (
      DATEPART(YYYY, p.CreationDate) = ##YYYY## and 
      DATEPART(MM, p.CreationDate) >= ##MM##
    )
  ) and
  ( 
    v.VoteTypeId = 2 or
    v.VoteTypeId = 3
  )
) AS Data

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results