Average question score for all users

0

Please login or register to vote for this query.

(click on this box to dismiss)

Japanese Language Meta

Q&A about the site for students, teachers, and linguists wanting to discuss the finer points of the Japanese language

SELECT
  u.id as [User Link],
  COUNT(1) AS questions_count,
  SUM(a.score) AS total_score,
  SUM(a.score) * 1.0 / COUNT(1) AS avg_score
FROM users u
JOIN posts a
  ON u.id = a.owneruserid
  AND a.posttypeid = 1
GROUP BY u.id, u.displayname
HAVING COUNT(1) >= 10
order by avg_score desc, questions_count desc

Enter Parameters

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