Q&A for science fiction and fantasy enthusiasts
SELECT YEAR (p.CreationDate) AS YearDate, COUNT (p.Id) AS PostCount, SUM (p.CommentCount), COUNT (c.PostId) AS CommentCount FROM Posts AS p LEFT OUTER JOIN Comments AS c ON p.Id = c.PostId GROUP BY YEAR (p.CreationDate) ORDER BY YEAR (p.CreationDate)