Skip to content

SQL for data engineers

18 in-depth lessons. The SQL that data engineering interviews test, in Spark SQL: filtering and NULL logic, aggregates, every kind of join, window functions, CTEs and dates, then gaps and islands, sessions, pivots and query plans. Every example is a query you can edit and run in your browser.

Bronze

Module 1: Reading a table

Pick columns, filter rows correctly around NULLs, and derive new values row by row.

Module 2: Summarising

Aggregate a table per group, and count only the rows you mean.

Module 3: Joining tables

Combine tables with the right join, find rows with no match, and compare rows of one table.

Silver

Module 4: Window functions

Rank rows, compare them with their neighbours, and compute running totals and moving averages.

Module 5: Structure, sets and dates

Write multi-step queries, compare whole results, and report every day, including empty ones.

Gold

Module 6: Interview patterns

Solve streak, session and reshaping questions that most candidates find hard.

Module 7: How a query runs

Read a query plan and explain why a query is slow.