HallEvents table by hall_id and start_day in ascending order.start_day is within the current interval, update the interval's end_day to the maximum of the current end_day and the event's end_day.start_day is after the current interval's end_day, start a new interval with the current event's start_day and end_day.hall_id and the starting day of the merged intervals.hall_id, the starting day of each group as start_day, and the maximum end_day within each group as end_day.
erDiagram
HallEvents {
int hall_id
date start_day
date end_day
}