Q&A for practitioners, researchers, and students in cognitive science, psychology, neuroscience, and psychiatry
SELECT DATEPART(YEAR, Posts.CreationDate) as Year, COUNT(*) as IssueCount, AVG(CAST(Posts.Score as FLOAT)) as AvgScore, SUM(CASE WHEN Posts.AcceptedAnswerId IS NOT NULL THEN 1 ELSE 0 END) as ResolvedIssues FROM Posts LEFT JOIN PostTags ON Posts.Id = PostTags.PostId LEFT JOIN Tags ON PostTags.TagId = Tags.Id WHERE Tags.TagName IN ('cancellation', 'refunds', 'booking-changes', 'flexibility') AND Posts.PostTypeId = 1 GROUP BY DATEPART(YEAR, Posts.CreationDate) ORDER BY Year DESC;