AI engineering glossary · SQL databases

What is window function?

Window function (also called Analytic function): A function that computes a value for each row using a set of related rows, its window, without collapsing rows the way GROUP BY does. Examples are ranking, running totals and previous-row lookups, written with OVER.

Level: intermediateTopic: SQL databases

Window function: an example

SUM(amount) OVER (PARTITION BY city) shows each order beside its city's total.

Related terms

More SQL databases terms

Where you learn it

Window function is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.