Welcoming Index

1

Please login or register to vote for this query.

(click on this box to dismiss)

Biology

Q&A for biology researchers, academics, and students

select NewUserNegProportion, AllUserNegProportion, 
NewUserNegProportion*1.0/AllUserNegProportion AS Evil_Index
from (
Select
Sum(A.Neg)*1.0/(sum(A.Neg)+sum(A.Pos)) as NewUserNegProportion,
1 AS DUMMY
from (select
case when v.VoteTypeId = 2 then 1 else 0 end as Pos,
case when v.VoteTypeId = 3 then 1 else 0 end as Neg
from Users u
inner join Posts p
on p.OwnerUserId = u.Id
inner join Votes v
on v.PostId = p.Id
--where u.reputation <100
where datediff(day, u.CreationDate, getdate()) < 30
and u.Id <> -1
and (v.VoteTypeId = 2 or v.VoteTypeId = 3)
) A ) C
inner join
(
Select Sum(A.Neg)*1.0/(sum(A.Neg)+sum(A.Pos)) as AllUserNegProportion,
1 AS DUMMY
FROM
(select
case when v.VoteTypeId = 2 then 1 else 0 end as Pos,
case when v.VoteTypeId = 3 then 1 else 0 end as Neg
from Users u
inner join Posts p
on p.OwnerUserId = u.Id
inner join Votes v
on v.PostId = p.Id
where u.Id <> -1
and (v.VoteTypeId = 2 or v.VoteTypeId = 3)
and datediff(day, v.CreationDate, getdate()) < 30
) A) D
ON C.DUMMY = D.DUMMY

Enter Parameters

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