How do get audience peak based on daterange on a single mysql table?

41 Views Asked by At

I have one MySQL table that register the start end end streaming time of an live webinar to an specific user/course with this schema:

ID (int 11) | userID (int 11) | courseID (int 11) | streamStart (datetime) | streamEnd (datetime)

Here are some rows for example:

1 ---------------- 1409 ---------------- 189 ----------- 2015-08-20 20:15:15 ---- 2015-08-20 21:00:00

2 ---------------- 1423 ---------------- 190 ----------- 2015-08-23 20:10:03 ---- 2015-08-23 22:00:00

3 ---------------- 1408 ---------------- 189 ----------- 2015-08-20 20:45:03 ---- 2015-08-20 21:15:00

where streamStart is the datetime where user start to watch and streamEnd is the datetime that user quit the live streaming session.

I want to know using just MySQL, what was the audience peak for courseID 189 (max number of concurrent users) using this data. Is it possible? How?

Extra challenge (optional): If you can help me with that, is there a way to tell what time that the peak occurred?

0

There are 0 best solutions below