instruction: Accepted answer percentage over time. accepted answers, total answers, and their ratio: for each month; tabulated over time
response: SELECT Month AS "Month", SUM(A.AC) AS "AC", SUM(B.TOTAL) AS "Total", ROUND(CAST(SUM(A.AC) AS FLOAT) / SUM(B.TOTAL) * 100, 2) AS "AC %age" FROM (SELECT DATEFROMPARTS(TIME_TO_STR(q.CreationDate, '%Y'), TIME_TO_STR(q.CreationDate, '%M'), 1) AS "Month", COUNT(*) AS "AC" FROM Posts AS q JOIN Posts AS a ON q.AcceptedAnswerId = a.Id WHERE a.OwnerUserId = @UserId GROUP BY DATEFROMPARTS(TIME_TO_STR(q.CreationDate, '%Y'), TIME_TO_STR(q.CreationDate, '%M'), 1)) AS A JOIN (SELECT COUNT(*) AS "TOTAL" FROM Posts WHERE OwnerUserId = @UserId AND PostTypeId = 2) AS B ON 1 = 1 GROUP BY Month ORDER BY 'AC %age' DESC