Business Analysis / Learning brief
Sam smooths a daily count and finds the latest task
In simple terms / 01
What this means in plain language
Sam builds a moving average, a day-to-day change and a latest-task query.
Complete lesson / 02
Understand the full idea, step by step
Analogy: a moving spotlight. On a stage, a spotlight lights the dancer in front and the two behind. As the dance moves, the spotlight moves, but the stage does not change.
The lit group is the frame.
A frame clause sets how many rows are lit. Sam, an analyst at Daily List, a to-do list app, uses it for a three-day average.
Evidence & review / 03
Evidence & review
The date on this lesson is when it went up on Payments Signal, not when its material was written — most of these were brought across from an earlier catalogue in a single run, which is why so many of them share a date. What the lesson says about the world is dated by the review above and by the sources below it.
Window frames, lag and lead, and top N. The people, app and data are invented.
What this brief simplifies: Fiction labelled SYNTHETIC / TRAINING ONLY. Sources were seen only as search excerpts. Tools and screens change, and each team sets its own.
Sources for this brief — 3 sources
- Market practice
Window Functions (PostgreSQL tutorial) ↗ — PostgreSQL Global Development Group · PostgreSQL tutorial: partition by splits rows into groups, order by sets the order inside each group, and with an order the default frame runs from the start of the group to the current row plus any ties (search excerpt, page not opened)
PostgreSQL18 publisher documentation opened on6November2026: §3.5 window placement, partition/order/frame. No execution on PostgreSQL is claimed; engine-specific examples remain scoped to18.
- Market practice
Window functions reference (PostgreSQL documentation) ↗ — PostgreSQL · PostgreSQL reference: lag looks back and lead looks forward by an offset that defaults to one, and a window function cannot be used in where so a top N filter needs a subquery (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Simplified educational illustration
Payments Signal editorial teaching models — Payments Signal
Used wherever diagrams, scenarios, figures, or example values are didactic constructions rather than sourced facts; every such use carries a simplifications disclosure. All people, companies, banks, and list entries in examples are fictional.