What tags have the highest percentage of "rookies" asking questions?

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

/* 
  defining "rookie" as rep <= 10
  
  note that the database only stores a user's current rep, not their rep
  at the time the question was asked.  so someone who had 1 rep when he
  asked the question, but has since earned 40 rep points, will NOT be
  counted.  thus the result (especially the actual percentage) is not 
  perfectly accurate, but still gives guidance. 
*/

select
  t.tagname, 
  count(p.id) as question_count,
  sum(case when u.reputation <= 10 then 1.000 else 0.000 end) as low_rep,
  avg(case when u.reputation <= 10 then 1.000 else 0.000 end) as low_rep_pct 
  
from
  posts p 
  inner join users u on u.id = p.owneruserid
  inner join posttags pt on p.id = pt.postid
  inner join tags t on pt.tagid = t.id 
  
where
  p.posttypeid = 1 -- questions
  and p.CreationDate >= DATEADD(d, -60, GETDATE()) -- within last 60 days
  
group by
  t.tagname
  
order by
  low_rep_pct desc

Enter Parameters

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