From the course: Advanced SQL for Data Science: Time Series

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Tumbling windows

Tumbling windows - SQL Tutorial

From the course: Advanced SQL for Data Science: Time Series

Start my 1-month free trial

Tumbling windows

- [Instructor] And another kind of window we'll encounter is called the tumbling window. A tumbling window is defined by a window, which again, is a set of contiguous rows. But when we slide the window, we don't slide just one row at a time. We move the entire window to the next non overlapping area. So let's visualize that. Here we have a window defined by the number of rows within the red box. Now, with a tumbling window, we jump down to the next row that was not included in the window. And that marks the beginning of our next window. So when we move again, we do it at an entire block or window at a time. Now, we sometimes do tumbling windows when we're monitoring change over time, so this is similar to using sliding windows. And we often see it when there's some kind of logical grouping of data by time. For example, if we were looking at the stock market and we wanted to understand the average price per day of a particular stock, we might not want to have a tumbling window that…

Contents