instruction: Mean rep gained on posts created on that month.
response: SELECT DATEFROMPARTS(TIME_TO_STR(Posts.CreationDate, '%Y'), TIME_TO_STR(Posts.CreationDate, '%M'), 1) AS Month, SUM(CASE WHEN Votes.VoteTypeId = 1 THEN 17 WHEN Posts.PostTypeId = 1 AND Votes.VoteTypeId = 2 THEN 5 WHEN Posts.PostTypeId = 1 AND Votes.VoteTypeId = 3 THEN -2 WHEN Posts.PostTypeId = 2 AND Votes.VoteTypeId = 2 THEN 10 WHEN Posts.PostTypeId = 2 AND Votes.VoteTypeId = 3 THEN -3 ELSE 0 END) AS Rep FROM Posts, Votes WHERE Votes.PostId = Posts.Id AND Votes.VoteTypeId BETWEEN 1 AND 3 AND Posts.PostTypeId BETWEEN 1 AND 2 GROUP BY DATEFROMPARTS(TIME_TO_STR(Posts.CreationDate, '%Y'), TIME_TO_STR(Posts.CreationDate, '%M'), 1) ORDER BY Month DESC