Do Bounties Increase The Chances of Getting An Accepted Answer

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

DECLARE @questions int
DECLARE @questionsWithAcceptedAnswers int
DECLARE @questionsWithBounties int
DECLARE @questionsWithBountiesAndAcceptedAnswers int

-- SELECT ALL QUESTIONS FROM PAST 30 DAYS
SELECT @questions = count(*) 
FROM Posts Questions
WHERE Questions.PostTypeId = 1 -- Q
AND Questions.Score >= 1 -- Filter out poor quality questions
AND Questions.CreationDate > DateAdd(day, -30, getdate()) -- Past 30 days
AND Questions.Id NOT IN (
   SELECT Posts.Id
   FROM Posts 
   INNER JOIN Votes on Votes.PostId = Posts.Id
   WHERE Votes.VoteTypeId = 8 -- Bounty started
)

-- SELECT ALL QUESTIONS FROM PAST 30 DAYS WITH ACCEPTED ANSWERS
SELECT @questionsWithAcceptedAnswers = count(*) 
FROM Posts Questions
WHERE Questions.PostTypeId = 1 -- Is a question
AND Questions.Score >= 1 -- Filter out poor quality questions
AND Questions.AcceptedAnswerId is NOT NULL -- Accepted answer
AND Questions.CreationDate > DateAdd(day, -30, getdate()) -- Past 30 days
AND Questions.Id NOT IN (
   SELECT Posts.Id
   FROM Posts 
   INNER JOIN Votes on Votes.PostId = Posts.Id
   WHERE Votes.VoteTypeId = 8 -- Bounty started
)

-- SELECT ALL QUESTIONS WITH BOUNTIES FROM PAST 300 DAYS (LARGER SAMPLE FOR STATISTICAL SIGNIFICANCE)
SELECT @questionsWithBounties = count(*) 
FROM Posts
INNER JOIN Votes on Posts.Id = Votes.PostId
WHERE Posts.PostTypeId = 1 -- Is a question
AND
Votes.BountyAmount is NOT NULL -- Has Bounty
AND
Posts.CreationDate > DateAdd(day, -300, getdate()) -- Past 300 days

-- SELECT ALL QUESTIONS WITH BOUNTIES FROM PAST 300 DAYS WITH ACCEPTED ANSWERS
SELECT @questionsWithBountiesAndAcceptedAnswers = count(*) 
FROM Posts
INNER JOIN Votes on Posts.Id = Votes.PostId
WHERE PostTypeId = 1 -- Is a question
AND
Posts.AcceptedAnswerId is NOT NULL -- Accepted answer
AND
Votes.BountyAmount is NOT NULL -- Has Bounty
AND
Posts.CreationDate > DateAdd(day, -300, getdate()) -- Past 300 days

SELECT @questions as [Questions], 
@questionsWithAcceptedAnswers as [Questions with Accepted Answers],
@questionsWithBounties as [Questions with Bounties],
@questionsWithBountiesAndAcceptedAnswers as [Questions with Bounties and Accepted Answers]

Enter Parameters

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