Distribution of score aquired as function of age for questions and answers


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 a as
   DATEPART(YYYY, p.CreationDate) TimeYr, 
   case when VoteTypeId = 2 then 1.00 
        when VoteTypeId = 3 then -1.00 else 0.00 end VoteS,
   DATEDIFF(day, p.CreationDate, v.CreationDate) delay
   from Posts p join Votes v 
                on p.Id = v.PostId 
   where p.PostTypeId in (1)
     and v.VoteTypeId in (2,3)
     and DATEPART(YYYY, p.CreationDate) in (2010)
), c as 
   Select DATEPART(YYYY, CreationDate) TimeYr,
          count(Id) nyear from Posts
   where PostTypeId = 1 
   group by DATEPART(YYYY, CreationDate)
), d as
     floor(1.00*delay/30) mdelay, 
     SUM(VoteS) sumscore
   from a
   group by floor(1.00*delay/30), TimeYr

, e as (
  d.mdelay+1 xtime,
  CAST(d.TimeYr as Char) year, 
  (d.sumscore/c.nyear) averagescore
from d join c on d.TimeYr = c.TimeYr
where d.mdelay >= 0 and d.mdelay <= 436


select *  from e

Enter Parameters

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