Plot the site activity by voting, questions, answers and comments, aggregated per week.
Q&A about the site for serious players and enthusiasts of poker
with Voting as (
select DATEFROMPARTS(DATEPART(Year, v.CreationDate),
1) as YearMon,
case when p.PostTypeId = 1 then 'Q' else 'A' end + vt.Name as Series,
1 as Vote
from Posts p,
where p.Id = v.PostId
and v.VoteTypeId = vt.Id
-- YearMon, Series, Count(Vote) as Votes
for Series in ([QUpMod],[QDownMod],[QFavorite],[AUpMod],[ADownMod],[AAcceptedByOriginator]))
where YearMon >= '2011-01-01'
order by YearMon
--group by YearMon, Series