Users by Popular Question ratio

2

Please login or register to vote for this query.

(click on this box to dismiss)

(only users with at least 10 Popular Questions)

Reverse Engineering

Q&A for researchers and developers who explore the principles of a system through analysis of its structure, function, and operation

-- Users by Popular Question ratio
-- (only users with at least 10 Popular Questions)

select top 100
  Users.Id as [User Link],
  BadgeCount as [Popular Questions],
  QuestionCount as [Total Questions],
  CONVERT(float, BadgeCount)/QuestionCount as [Ratio]
from Users
inner join (
  -- Popular Question badges for each user
  select
    UserId,
    count(Id) as BadgeCount
  from Badges
  where Name = 'Popular Question'
  group by UserId
) as Pop on Users.Id = Pop.UserId
inner join (
  -- Questions by each user
  select
    OwnerUserId,
    count(Id) as QuestionCount
  from posts
  where PostTypeId = 1
  group by OwnerUserId
) as Q on Users.Id = Q.OwnerUserId
where BadgeCount >= 10
order by [Ratio] desc;

Enter Parameters

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