Tag statistics

0

Please login or register to vote for this query.

(click on this box to dismiss)

Views, Score and Answers per Game (with limited blacklist for other tags)

Home Improvement

Q&A for contractors and serious DIYers

-- Tag statistics
-- Views, Score and Answers per Tag

DECLARE @total float
SELECT @total = Sum(Cast(ViewCount as bigint)) FROM Posts WHERE PostTypeId = 1

SELECT 
    Tags.Tagname AS Tag, 
    Count(*) AS Questions, 
    Sum(Cast(Posts.ViewCount as bigint)) AS Views,
    str(100 * Sum(Cast(Posts.ViewCount as bigint)) / @total,6,2) AS percentOfSite,
    Sum(Posts.Score) AS Score,
    Sum(Posts.AnswerCount) AS Answers,
    Sum(Cast(Posts.ViewCount as bigint)) / Count(*) AS AvgViews,
    str(Sum(Posts.Score) / Cast(Count(*) AS Float),6,2) AS AvgScore,
    str(Sum(Posts.AnswerCount) / Cast(Count(*) AS Float),6,2) AS AvgAnswers
  FROM Posts 
  JOIN PostTags ON Posts.Id = PostTags.PostId
  JOIN Tags ON PostTags.TagId = Tags.Id
  WHERE Posts.PostTypeId = 1  AND Tagname in ('marmalade','collision-detection','physics','animation','multiplayer','game-engine',
                'game-physics','pygame','game-maker','gameplay-kit','unity2d','unity3d','textures',
                'path-finding','tilemap','libgdx','animation','game-loop','glsl','rotation',
                'unreal-engine4','corona','game','gamekit','gamepad','game-ai','2d-games',
                'game-center','xbox','xbox360','xbox-one','wii','unity5','cocos2d-iphone','cocos2d-x',
                'cocos2d-html5','unityscript','gaming','cryengine','unreal-engine4')
  GROUP BY Tags.Tagname
  ORDER BY Views DESC

Enter Parameters

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