Who's asking/answering the most questions on U.S. holidays?! (And why? ... just kidding, we know why...)
Q&A for meta-discussion of the Stack Exchange family of Q&A websites
-- Holiday Work Horse
-- Who's asking/answering the most questions on U.S. holidays?! (And why? ... just kidding, we know why...)
DECLARE @year int = ##Year##
u.DisplayName as 'User Name'
,count(p.Title) as 'Number of Questions/Answers'
,(u.Reputation/(count(p.title))) as 'Reputation'
INNER JOIN posts p on p.OwnerUserId = u.id
AND (p.PostTypeId IN (1,2)) /* Questions and Answers */
AND p.OwnerUserId IS NOT NULL /* Registered Users */
AND u.Reputation > 250 /* Reputation min. */
-- AND u.DisplayName = 'iight' /* not me... */
AND year(p.CreationDate) = @year /* Year input */
(Month(p.CreationDate) = 12 AND Day(p.CreationDate) = 25) /* Xmas */
(Month(p.CreationDate) = 7 AND Day(p.CreationDate) = 4) /* July 4 */
HAVING count(p.title) <> 0
'Number of Questions/Answers' DESC