Menu

Course · Languages & query

SQL

SQL is the core language of data work: querying, transforming and modelling data in warehouses, lakehouses and Spark. Start here before any other tool.

Lessons
10
Interview questions
9
Projects & case studies
8
Reading time
~1 h

About this course

SQL is where most Data Engineering work starts and ends. You use it to explore data, build transformations in a warehouse, define models and validate pipeline output. The same ideas carry over to Spark SQL, Snowflake, BigQuery and Delta Lake, so time spent here pays off across the whole stack.

Learn joins first, then aggregation and window functions. After that, learn to read a query plan so you can explain why a query is slow.

Your progress

Saved in this browser only

Practise

Course structure

Lessons

Work through the lessons in order. Completed lessons show a tick; lessons you have opened are outlined.

Start here

The complete overview of the course in one read.

  1. SQL for Data Engineers: Complete FundamentalsEverything a Data Engineer needs from SQL in one guide: joins, aggregation, window functions, query structure, deduplication, upserts and performance, with links to go deeper.Beginner3 min

Beginner

Core concepts you will use every day.

  1. SQL Joins Explained for Data EngineersUnderstand INNER, LEFT, FULL and CROSS joins, why row counts change after a join, and the filtering mistakes that silently break pipeline results.Beginner4 min
  2. SQL Aggregations, GROUP BY and HAVINGHow GROUP BY, aggregate functions and HAVING work, how NULLs change COUNT and AVG, and the conditional aggregation patterns used in reporting pipelines.Beginner3 min

Intermediate

Patterns used in production pipelines.

  1. SQL Window Functions: PARTITION BY, ORDER BY and FramesLearn how SQL window functions compute rankings, running totals and row-to-row comparisons without collapsing rows, including ties and frame behaviour.Intermediate4 min
  2. CTEs vs Subqueries vs Temporary TablesWhen to use a common table expression, a subquery or a temporary table in SQL pipelines, with readability, reuse and performance trade-offs explained.Intermediate3 min

Advanced

Performance, internals and edge cases.

  1. SQL Query Optimization FundamentalsA practical process for speeding up slow SQL: read the query plan, reduce the data scanned, make filters sargable, fix joins and verify the result is unchanged.Advanced3 min
  2. Gaps and Islands, Streaks and Sessionization in SQLSolve gaps-and-islands problems with window functions: find missing values, group consecutive rows, measure streaks and split clickstreams into sessions.Advanced17 min
  3. Product Analytics SQL: Retention, Cohorts, Funnels and AttributionWrite the product analytics queries interviewers ask for: day-N retention, cohort matrices, ordered funnels, first and last touch attribution and market basket lift.Advanced18 min
  4. Recursive CTEs: Hierarchies and Graph Traversal in SQLLearn how recursive CTEs work step by step, then use them to walk org charts, roll up hierarchies and traverse graphs safely without infinite loops.Advanced18 min
  5. Semi-Structured SQL: JSON, Arrays and Regular ExpressionsParse JSON, flatten nested arrays and extract text with regular expressions in SQL, with PostgreSQL examples and the Snowflake and BigQuery equivalents.Advanced16 min

Projects and case studies

Apply what you learned and prepare material to discuss in interviews.

Projects

System design case studies

Resources

Cheat sheets

Related courses

Plan your learning

Search
Filter by type