instruction: Second order approximation of the ups to the most upvoted answer by tag.
response: WITH Raw AS (SELECT Posts.Id AS AId, MIN(Posts.ParentId) AS QId, COUNT(*) AS Ups FROM Posts, Votes WHERE Votes.VoteTypeId = 2 AND Votes.PostId = Posts.Id GROUP BY Posts.Id), Raw2 AS (SELECT QId, CASE WHEN MAX(Ups) > '##MaxUps:int?10##' THEN '##MaxUps##' ELSE MAX(Ups) END AS Ups FROM Raw GROUP BY QId), QTagNo AS (SELECT PostId AS QId, COUNT(*) AS Count FROM PostTags GROUP BY PostId), Raw3 AS (SELECT PostTags.TagId, 1.0 * SUM(1.0 * Raw2.Ups / QTagNo.Count) / COUNT(*) AS TagLoved FROM Raw2, PostTags, QTagNo WHERE Raw2.QId = PostTags.PostId AND Raw2.QId = QTagNo.QId GROUP BY TagId) SELECT Tags.TagName, Raw3.TagLoved FROM Raw3, Tags WHERE Raw3.TagId = Tags.Id ORDER BY Raw3.TagLoved DESC, Tags.Id LIMIT 100