select
tags,
extract(year from creation_date) year,
extract(quarter from creation_date) quarter,
count(*) count
from`bigquery-public-data.stackoverflow.posts_questions`group by tags, year, quarter
order bycount(*) desc
SELECTt.TagName,
DatePart(quarter, p.LastActivityDate) AS q,
Year(p.LastActivityDate) AS y,
COUNT(p.Id) As NumPosts
FROM Posts p
JOIN PostTags pt ONp.Id=pt.PostIdJOIN Tags t ONt.Id=pt.TagIdWHERE Year(p.LastActivityDate) =2021AND DatePart(quarter, p.LastActivityDate) =4GROUP BY DatePart(quarter, p.LastActivityDate), Year(p.LastActivityDate), t.TagNameORDER BY y, q, NumPosts DESC