What a Window Frame Actually Is
Concepts covered: sqlWindowFrame
This section is about the one bug that every first-time author of a running total ships at least once. It is silent, it is engine-default behavior, and it produces visibly plausible numbers that are subtly wrong. The fix is one word in the query. The reason most candidates miss it is that they have never read the docs carefully enough to know that the default is wrong. The bug, stated plainly Concrete example of the bug Account A has three transactions on January 1: $100, $50, $30. The intended running total is 100, 150, 180. With RANGE (the default), all three rows tie on date, so they share a single cumulative value: 180, 180, 180. With ROWS, each row gets its own value: 100, 150, 180. Same query, same data, different answer based on which frame the engine used. Why the default is the wa
About This Interactive Section
This section is part of the Running Totals: Beginner lesson on DataDriven, a free data engineering interview prep platform. Each section includes explanations, worked examples, and hands-on code challenges that execute in real time. SQL queries run against a live database. Python runs in a sandboxed Docker container. Data modeling problems validate against interactive schema canvases. All content is framed around what data engineering interviewers actually test at companies like Meta, Google, Amazon, Netflix, Stripe, and Databricks.
How DataDriven Lessons Work
DataDriven combines four interview rounds (SQL, Python, Data Modeling, Pipeline Architecture) with adaptive difficulty and spaced repetition. Easy problems get harder as you improve. Weak concepts resurface until you master them. Your readiness score tracks progress across every topic interviewers test. Every lesson section ends with problems you solve by writing and running real code, not by picking multiple-choice answers.