All courses
· intermediate

Data Manipulation in SQL

Name your intermediate steps with CTEs, then rank, compare and accumulate rows with window functions. This is where SQL stops being a filter and becomes an analysis language.

Pathaxis · Original content

Written in house, from the work rather than from a syllabus. Every example is one we would use ourselves, and every exercise is checked against the same engine that grades your answer.

102 min 7 lessons 15 quiz questions 6 exercisesStart course

What you’ll learn

  • Replace nested subqueries with readable named CTEs
  • Explain how a window differs from a group
  • Rank rows and pick the top N per category
  • Compare a row with the one before or after it
  • Build running totals and moving averages with window frames

Before you start

  • · Intermediate SQL, or comfort with subqueries and GROUP BY
  • · Familiarity with joins

Syllabus

01

Naming your steps

CTEs, and why nested subqueries stop scaling.

02

Windows

Aggregating without collapsing, and ranking within partitions.

03

Across rows

Looking backwards and forwards, and accumulating over a frame.