Users who answer closed homework questions

0

Please login or register to vote for this query.

(click on this box to dismiss)

Physics

Q&A for active researchers, academics and students of physics

SELECT TOP ##NumberOfRows?1000##
  answers.OwnerUserId AS [User Link],
  Users.Reputation,
  COUNT(*) AS 'Total',
  SUM(answers.Score) AS 'TotalScore',
  COUNT(CASE WHEN questions.ClosedDate IS NOT NULL THEN 1 END) AS 'Closed',
  SUM(CASE WHEN questions.ClosedDate IS NOT NULL THEN answers.Score END) AS 'ClosedScore',
  ROUND(100*CAST(COUNT(CASE WHEN questions.ClosedDate IS NOT NULL THEN 1 END) AS Decimal) / COUNT(*) ,2) AS 'Closed%',
  CASE WHEN SUM(answers.Score) > 0 THEN ROUND(100*CAST(SUM(CASE WHEN questions.ClosedDate IS NOT NULL THEN answers.Score END) AS Decimal) / SUM(answers.Score), 2) END AS 'ClosedScore%'
FROM Posts questions
JOIN Posts answers ON answers.ParentId = questions.Id
JOIN Users ON Users.Id = answers.OwnerUserId
WHERE questions.Tags LIKE '%<homework-and-exercises>%'
  AND answers.OwnerUserId IS NOT NULL
  AND answers.CreationDate >= DATEADD(day,-##AnswerMaxAgeInDays?7000##,GETDATE())
GROUP BY answers.OwnerUserId, Users.Reputation
HAVING COUNT(*) >= ##MinTotalQs?0##
ORDER BY 'Total' DESC

Enter Parameters

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