Average score by tag

0

Please login or register to vote for this query.

(click on this box to dismiss)

Parenting

Q&A for parents, grandparents, nannies and others with a parenting role

select
  -- Asked,
  TagName,
--  count(*) Questions,
  avg(cast(Score as float)) avgscore,
  stdev(cast(Score as float)) stdscore
from
(
  select 
    t.TagName,
    a.Score
  from Posts q
    inner join PostTags pt on q.Id = pt.PostId
    inner join Tags t on pt.TagId = t.Id
    inner join Posts a on q.Id = a.ParentId
  where
    q.CreationDate between '2017-01-01' and '2017-12-31'
    and q.PostTypeId = 1
    and a.PostTypeId = 2
    -- and a.Score >= 10
    and datediff(second, q.CreationDate, a.CreationDate) < 2592000 -- 30 days
) q
where
 TagName in ('c#','java','excel-vba')
group by
  -- Asked,
  TagName
-- order by 
  -- Asked

Enter Parameters

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