Unanswered Questions by Tag with at least 100 questions

0

Please login or register to vote for this query.

(click on this box to dismiss)

Shows all tags with at least 100 questions, their total questions and of those, how many are unanswered.

Android Enthusiasts

Q&A for enthusiasts and power users of the Android operating system

-- Unanswered Questions by Tag
-- Shows all tags with at least 3000 questions, their total questions and
-- of those, how many are unanswered.

DECLARE @minQuestionCount int = 100

SELECT
  *
FROM
  (
    -- All unanswered questions grouped by tag
    SELECT
      t.TagName AS TagName,
      COUNT(1) AS UnansweredCount,
      t.Count AS QuestionCount
      FROM Posts q
      INNER JOIN PostTags pt ON q.Id = pt.PostId
      INNER JOIN Tags t ON pt.TagId = t.Id
      WHERE
        (q.PostTypeId = 1) AND
        (q.ClosedDate IS NULL) AND
        NOT EXISTS
        (
          SELECT *
            FROM Posts a
            WHERE
              (a.ParentId = q.Id) AND
              ((a.Score > 0) OR (a.Id = q.AcceptedAnswerId))
        )
      GROUP BY TagName, t.Count
  ) a
WHERE a.QuestionCount > @minQuestionCount
ORDER BY
    TagName

Enter Parameters

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