Progress towards Curious, Inquisitive and Socratic badges

10

Please login or register to vote for this query.

(click on this box to dismiss)

How far are you towards the Curious, Inquisitive and Socratic badges? You need to count the days on which you had only positive questions, and no downvoted or closed questions. We cannot see deleted questions here so the count is going to be inaccurate, nor does it track your positive question record ratio.

Russian Language

Q&A for students, teachers, and linguists wanting to discuss the finer points of the Russian language

declare @epoch datetime = getdate();

with ask_days as (
  select dateadd(day, datediff(day, @epoch, CreationDate), @epoch) day,
         min(Score) worst,
         max(Score) best,
         -- only posts closed within 60 days count against qualification
         count(case when ClosedDate is not null and datediff(day, CreationDate, ClosedDate) <= 60 then 1 else null end) closed
  from Posts
  where PostTypeId = 1
        and OwnerUserId in (##UserId##)
  group by dateadd(day, datediff(day, @epoch, CreationDate), @epoch)
),

good_days as (
  select count(*) N
  from ask_days
  where best >= 1
        and worst >= 0
        and closed = 0
)

select N,
       case
         when N >= 5 then 1
       end curious,
       case
         when N >= 30 then 1
       end inquisitive,
       case
         when N >= 100 then N / 100
       end socratic
from good_days;

Enter Parameters

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