instruction: Average of time between posts and accepted answer creation, by months.
response: SELECT STR_TO_TIME(CONCAT(YEAR(p.CreationDate), '-', MONTH(p.CreationDate), '-01'), '%Y-%m-%d %H:%M:%S') AS Mes, CAST(AVG(CAST((JULIANDAY(ans.CreationDate) - JULIANDAY(p.CreationDate)) * 24.0 AS INT)) AS FLOAT) / 24 AS dias FROM Posts AS p JOIN Posts AS ans ON ans.Id = p.AcceptedAnswerId WHERE p.AcceptedAnswerId > 0 GROUP BY YEAR(p.CreationDate), MONTH(p.CreationDate) ORDER BY YEAR(p.CreationDate), MONTH(p.CreationDate)