Average Answerer's Age (among the tags answered by more than 1000 users with age filled)

10

Please login or register to vote for this query.

(click on this box to dismiss)

Earth Science Meta

Q&A about the site for those interested in the geology, meteorology, oceanography, and environmental sciences

SELECT  TagName AS Tags, AVG(Age * 1.0) AS [Average Answerer's Age], COUNT(*) AS [Number of Answerers]
FROM    (
        SELECT  DISTINCT pa.OwnerUserId, pt.TagId
        FROM    Users u
        JOIN    Posts pa
        ON      pa.OwnerUserId = U.Id
        JOIN    Posts pq
        ON      pq.Id = pa.ParentId
        JOIN    PostTags pt
        ON      pt.PostId = pq.Id
        ) ut
JOIN    Tags t
ON      t.Id = ut.TagId
JOIN    Users u
ON      u.Id = ut.OwnerUserId
WHERE   u.Age BETWEEN 10 AND 90
GROUP BY
        t.Id, t.TagName
HAVING  COUNT(*) > 1000
ORDER BY
        2 DESC

Enter Parameters

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