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)

Stack Overflow Meta en español

Preguntas y respuestas sobre el sitio para programadores y profesionales de la informática

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

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

SELECT 
    Tags.Tagname AS Tag, 
    Count(*) AS Questions, 
    Sum(Posts.ViewCount) AS Views,
    str(100 * Sum(Posts.ViewCount) / @total,6,2) AS percentOfSite,
    Sum(Posts.Score) AS Score,
    Sum(Posts.AnswerCount) AS Answers,
    Sum(Posts.ViewCount) / 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 (Tags.Tagname != 'spoiler') 
     AND (Tags.Tagname != 'achievements')) 
     AND (Tags.Tagname != 'iphone')
     AND (Tags.Tagname != 'pc')
     AND (Tags.Tagname != 'strategy')
     AND (Tags.Tagname != 'xbox-360')
     AND (Tags.Tagname != 'puzzle')
     AND (Tags.Tagname != 'steam')
     AND (Tags.Tagname != 'role-playing-game')
     AND (Tags.Tagname != 'ps3')
     AND (Tags.Tagname != 'mac')
     AND (Tags.Tagname != 'multiplayer')
     AND (Tags.Tagname != 'campaign')
     AND (Tags.Tagname != 'zerg')
     AND (Tags.Tagname != 'battle.net')
     AND (Tags.Tagname != 'armor')
     AND (Tags.Tagname != 'terminology')
     AND (Tags.Tagname != 'offline')
     AND (Tags.Tagname != 'online-multiplayer')
     AND (Tags.Tagname != 'identify-this-game')
     AND (Tags.Tagname != 'wii')
     AND (Tags.Tagname != 'game-mechanics')
  GROUP BY Tags.Tagname
  ORDER BY Questions DESC

Enter Parameters

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