What tag brought a user to the site?

1

Please login or register to vote for this query.

(click on this box to dismiss)

This will figure out some statistics as to what tags bring users to a site, and how long they stick around.

Christianity Meta

Q&A about the site for committed Christians, experts in Christianity and those interested in learning more

WITH FirstPosts AS (
    SELECT OwnerUserId as SEUser,
           Min(Id) as Post
           
    FROM Posts
    GROUP BY OwnerUserId
),
UserQuestionCount AS (
  SELECT count(Id) AS PostCount, OwnerUserId AS Id
  FROM Posts
  GROUP BY OwnerUserId
 )

SELECT TOP 200 t.tagname, 
  count(Tags) AS Users, 
  PostsPerUser=1.0*Sum(UserQuestionCount.PostCount)/count(Tags)
FROM FirstPosts INNER JOIN Users on FirstPosts.SEUser = Users.Id
                INNER JOIN Posts on FirstPosts.Post = Posts.Id
  INNER JOIN PostTags pt on Posts.Id = pt.PostId
  INNER JOIN Tags t on pt.TagId = t.Id
  INNER JOIN UserQuestionCount ON Users.Id = UserQuestionCount.Id
  GROUP BY t.tagname HAVING count(Tags)>10
ORDER BY PostsPerUser DESC

Enter Parameters

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