SQL Window Functions

Created by Abhyuday DesaiPublished , v1Runs 7 min 50 sec
0 views

About this video

Window functions compute across rows while keeping every row, which is what the hard tier of interview questions usually asks for: latest per group, top N, deduplication, running totals. One six-row orders table powers every example.

You'll review how to:

  • Tell GROUP BY from OVER, and define a window with PARTITION BY and ORDER BY
  • Rank ties with ROW_NUMBER, RANK and DENSE_RANK, and say which one the question wants
  • Compute in a CTE and filter outside it for latest-row, top-N and duplicate questions
  • Compare a row with the previous one using LAG, and build a running total with an ordered frame

For engineers who know SELECT, JOIN, GROUP BY and CTEs. Ranking and per-group questions, the most common hard tier.

What changed

  1. v103 Oct 2026abhydesai7 min 50 sec037acd5

    First published version.

    0 views0 likes on this version