SELECT p.Id AS QuestionId, AVG(a.Score) AS AverageScore F...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Bicycles Meta

Q&A about the site for people who build and repair bicycles, people who train cycling, or commute on bicycles

-- Query for retrieving IDs of questions with more than 5 answers and their average score
SELECT p.Id AS QuestionId, AVG(a.Score) AS AverageScore
FROM Posts p
JOIN Posts a ON p.Id = a.ParentId
WHERE p.PostTypeId = 1 AND p.AnswerCount > 5 AND a.PostTypeId = 2
GROUP BY p.Id;

Enter Parameters

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