Average question score for all users

0

Please login or register to vote for this query.

(click on this box to dismiss)

Physics

Q&A for active researchers, academics and students of physics

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) >= 100
order by avg_score desc, questions_count desc

Enter Parameters

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