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.
Sliding windows - SQL Tutorial
From the course: Advanced SQL for Data Science: Time Series
Sliding windows
- [Instructor] Sliding windows is an important concept in working with time series data. Now, a window, as I mentioned before, is a set of contiguous rows. A sliding window is a window that moves through the table, typically one row at a time, but there could be other intervals as well. Now, if you want to think about it visually, imagine this block of rows that is demarcated by the red box. That's a window. And sliding that window means that we move it one times increment at a step. And we perform certain operations, like calculating averages or maxes or mins, across each of these. We see these kinds of operations when we're monitoring change over time on a continuous time series. It only usually is used when there's no logical boundaries. So, for example, in the case of a stock market, we might want to have a moving average of the price of a stock over the course of a day. Now at the end of the day, a stock market closes. So you wouldn't necessarily want to have a moving average…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.