Topic hub

SQL for Analytics Engineers

The query language every analytics engineer ships every day — from SELECT to window functions, query optimization, and production patterns.

SQL is the single most important skill for an analytics engineer. Every dbt model is SQL. Every BI dashboard is backed by SQL. Every interview at every data company starts with a live SQL screen. If you only learn one thing on this platform, learn this.

But there's a gap between writing SELECT statements in a tutorial and writing the SQL that ships at scale. Production SQL handles billions of rows, leverages window functions and CTEs without falling apart, gets reviewed in pull requests, and runs as part of dbt models that other people depend on. That's what this hub trains.

The articles below cover the fundamentals and the advanced patterns analytics engineers use daily: window functions, CTEs, performance tuning, join logic, and the interview questions that actually come up. The practice library has nearly 200 graded SQL exercises across difficulty levels. The capstone uses dbt + BigQuery to put it all together.

What you'll learn

By the end of this path you can…

  • Write efficient SELECT, JOIN, GROUP BY, and aggregation queries
  • Master window functions and CTEs
  • Optimize queries for warehouse performance
  • Use SQL inside dbt models the way production teams do
  • Ace SQL interview screens
  • Build SQL portfolio projects on real datasets
The learning path

From beginner to job-ready.

  1. 01 · Foundations

    SELECT, WHERE, ORDER BY, LIMIT — the SQL you'll write a hundred times a week.

  2. 02 · Joins

    INNER, LEFT, multi-table joins, and avoiding row-count explosions.

  3. 03 · Aggregations

    GROUP BY, HAVING, aggregate functions, and the gotchas with NULLs and DISTINCT.

  4. 04 · Window functions

    ROW_NUMBER, RANK, LAG, LEAD, partitioning, and frame clauses.

  5. 05 · CTEs

    Layered query design with WITH clauses for readable, reviewable SQL.

  6. 06 · Performance

    Query plans, indexing, partitioning, and warehouse-specific optimization.

  7. 07 · Interview drills

    The SQL patterns hiring managers ask for in screens.

Articles

Read the playbook.

All resources →
In the course

SQL for Analytics Engineers

32 lessons in this module

Common questions

Common questions about this topic.

Which SQL dialect should I learn?

Pick BigQuery or Snowflake SQL — both are GoogleSQL-like dialects that match what most modern data teams use. The fundamentals (SELECT, joins, window functions, CTEs) translate cleanly between any of them.

How long until I can pass a SQL interview?

Two to four months of consistent practice for an entry-level analytics engineering screen. The SQL interview questions article and the corresponding practice exercises map directly to what hiring managers ask.

Do I need to know SQL before learning dbt?

Yes. dbt is a SQL framework — it organizes and tests SQL, but you still write the queries. If you're not yet comfortable with joins, CTEs, and window functions, work through the SQL practice topics before the dbt hub.

What's the most underrated SQL skill?

Reading other people's queries. Production work is mostly debugging someone else's SQL or extending a dbt model written by a teammate. Practice opening a 200-line CTE chain and reasoning about it from the bottom up.

Start practicing this topic.

Graded exercises with hints, worked solutions, and a GPT tutor. Free to start, no credit card.