AI engineering glossary · SQL databases
What is window frame?
Window frame (also called Frame clause): The range of rows around the current row that a window function uses, set with ROWS or RANGE between bounds like UNBOUNDED PRECEDING and CURRENT ROW. It turns SUM or AVG into running totals and moving averages.
Window frame: an example
AVG(sales) OVER (ORDER BY day ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) gives a seven-day moving average.
Related terms
More SQL databases terms
Where you learn it
Window frame is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.