Q&A for professional and enthusiast programmers
SELECT Year(Posts.CreationDate) AS Year, Tags.TagName, COUNT(*) AS Questions FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = PostTags.PostId LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Tags.TagName IN ( 'ag.algebraic-geometry', 'nt.number-theory', 'co.combinatorics', 'at.algebraic-topology', 'gr.group-theory', 'dg.differential-geometry', 'pr.probability', 'fa.functional-analysis', 'rt.representation-theory', 'ct.category-theory', 'ac.commutative-algebra', 'lo.logic', 'gt.geometric-topology', 'gn.general-topology', 'ca.analysis-and-odes', 'mg.metric-geometry', 'ra.rings-and-algebras', 'ap.analysis-of-pdes', 'cv.complex-variables', 'mp.mathematical-physics', 'ds.dynamical-systems', 'st.statistics', 'oa.operator-algebras', 'ho.history-overview', 'na.numerical-analysis', 'sg.symplectic-geometry', 'oc.optimization-control', 'qa.quantum-algebra', 'kt.k-theory-homology', 'sp.spectral-theory', 'it.information-theory', 'gm.general-mathematics' ) AND PostTypes.Name = 'Question' AND -- Exclude the current year Posts.CreationDate < DATEADD(year, DATEDIFF(year, 0, GETDATE()), 0) AND Posts.Score > 5 GROUP BY Year(Posts.CreationDate), Tags.TagName ORDER BY Year(Posts.CreationDate), Tags.TagName