Database ranking

0

Please login or register to vote for this query.

(click on this box to dismiss)

Science Fiction and Fantasy Meta

Q&A about the site for science fiction and fantasy enthusiasts

WITH 
rate AS 
(
  select count(PostId) as Rate, TagName
  from
    Tags inner join
    PostTags  on Tags.Id = PostTags.TagId inner join
    Posts on Posts.Id = PostId
  where 
  year(Posts.CreationDate) >= year( getdate() ) - 1
  group by TagName
),
num as 
(
  select count(PostId) as Num, TagName
  from
    Tags inner join
    PostTags on Tags.Id = PostTags.TagId inner join
    Posts on Posts.Id = PostId 
  group by TagName
  having count(PostId) > 800
)
select 
       num.TagName as Tag,
       row_number() over (order by rate.Rate desc) as CurrentAndPreviousYearRany,
       row_number() over (order by num.Num desc) as TotalRank,
       rate.Rate as QuestionsInCurrentOrPrevious,
       num.Num as QuestionsAllTime

from
 rate
INNER JOIN
 num ON rate.TagName = num.TagName
WHERE
 rate.TagName in ( 'oracle', 'sql-server', 'mysql', 'postgresql', 'mongodb', 'cassandra', 'ms-access', 'sqlite', 'sqlite3'    )
ORDER BY rate.rate DESC
;

Enter Parameters

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