instruction: Average score of all answers (depending on month of questions' creationdate) - only non-CW questions.
response: WITH ascore_cte AS (SELECT q.Id AS qid, q.CreationDate AS cre, SUM(a.Score) AS ascore FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id WHERE q.PostTypeId = 1 AND (q.CommunityOwnedDate IS NULL) GROUP BY q.Id, q.CreationDate) SELECT LAST_DATE_OF_MONTH(cre), AVG(CAST(ascore AS FLOAT)) AS "average_sum_of_answer-scores" FROM ascore_cte GROUP BY LAST_DATE_OF_MONTH(cre) ORDER BY LAST_DATE_OF_MONTH(cre)