instruction: Mean top score for questions where accepted answer is not top voted.
response: WITH TopAnswerScore AS (SELECT q.Id AS question, MAX(a.Score) AS topscore FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id GROUP BY q.Id) SELECT AVG(topscore), a.Score FROM Posts AS p INNER JOIN TopAnswerScore ON question = p.Id INNER JOIN Posts AS a ON a.Id = p.AcceptedAnswerId WHERE a.Score < topscore GROUP BY a.Score ORDER BY a.Score DESC