Question to Answer Ratio

0

Please login or register to vote for this query.

(click on this box to dismiss)

Mythology Meta

Q&A about the site for enthusiasts and scholars of mythology and folklore

-- Question to Answer Ratio for users with at least 10 questions, 10 answers, and 500 questions plus answers

WITH qAndA AS
  (SELECT Posts.OwnerUserId,
          SUM(CASE
                  WHEN Posts.PostTypeId = 1 THEN 1
                  ELSE 0
              END) AS Questions,
          SUM(CASE
                  WHEN Posts.PostTypeId = 2 THEN 1
                  ELSE 0
              END) AS Answers,
          COUNT(*) AS Total
   FROM Posts
   WHERE Posts.PostTypeId IN (1,
                              2)
   GROUP BY Posts.OwnerUserId)
SELECT OwnerUserId AS [User Link],
       Questions,
       Answers,
       Total,
       ROUND(1.0 * Questions/Answers, 3) AS qToAns
FROM qAndA
WHERE Questions > 10
  AND Answers > 10
  AND Total > 500
ORDER BY qToAns DESC

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results