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

0

Please login or register to vote for this query.

(click on this box to dismiss)

Anime and Manga

Q&A for anime and manga fans

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

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 meta site
loading Hold tight while we fetch your results