
dimDate : 1 row per date
dimTime : 1 row per minute
" " , .
, TimeKey "23:59".
, TimeKey "HH: 59".
, TimeKey "HH: MM"
15 , TimeKey "HH: 14", "HH: 29", "HH: 44", "HH: 59"
...
select
DayOfWeek
, sum(NewFriends) as FriendCount
from factUserAction as f
join dbo.dimUser as u on u.UserKey = f.UserKey
join dbo.dimDate as d on d.DateKey = f.DateKey
join dbo.dimTime as t on t.TimeKey = f.TimeKey
where CalendarYear between 2008 and 2010
and MonthNumberInYear between 1 and 3
and t.Hour between 3 and 5
and d.IsHoliday = 'no'
and UserEmail = 'john_doe@gmail.com'
group by DayOfWeek
order by DayOfWeek ;