# Lesson 7: Window functions Window functions comes up in almost every real SQL project. We start with the why, then write code together. Read the full lesson: [https://glibcode.net/courses/sql-essentials/lessons/7](https://glibcode.net/courses/sql-essentials/lessons/7) ## Files - `window.sql`: RANK and running totals with window functions > **Tip:** `.mode box` and `.headers on` in sqlite3 make results much easier to read. ## Run it ```sh sqlite3 shop.db < ../../setup/schema.sql sqlite3 shop.db < ../../setup/seed.sql sqlite3 shop.db < window.sql ``` ## Exercises See [exercises.md](exercises.md). Ask in the forum after you have tried.