Q&A for scientific skepticism
/*12. You are interested in looking at the Comment activity
at a Daily level the hottest topics of the past year.
Assuming you have a Date dimension table (Date) which is a table with all days
going from 1990 to 2999 (Column Name: dateId), create a query that returns the
number of comments made on each day
for each post from the top 50 most commented on posts in the past year.*/
with Date as (
SELECT CAST('2015-3-10' as datetime) DateId
SELECT DateId + 1
WHERE DateId + 1 <= '2015-03-18'
from Date d LEFT JOIN Comments c
group by d.dateId, c.PostId
order by Count(c.Id) desc