◐ ai-teacher

🗄 Free course

SQL & Databases

Answer any SQL round out loud, and know why the query is slow.

Start the course free →

What you will learn

  1. SELECT, WHERE, ORDER BY — your first question
    SQL is not a programming language. You describe the answer you want and the database works out how to get it.
  2. Aggregation: GROUP BY and HAVING
    GROUP BY answers 'how many' and 'how much' — and the only question that matters is: one row per what?
  3. NULL: the value that isn't there
    NULL is not zero, not empty, not false. It is 'unknown' — and unknown behaves differently from everything else in SQL.
  4. CTEs and readable query structure
    A 200-line query nobody can read is not clever. Name each step and the same logic becomes six paragraphs anyone can review.
  5. Joins in depth — and the fan-out trap
    Everyone can name the join types. The question that separates candidates is: how many rows come out?
  6. SQL: window functions vs GROUP BY
    GROUP BY collapses rows. A window function keeps every row and adds the group's answer beside it.
  7. Indexes: when they help, when they cost
    An index is a second copy of your data, sorted differently. That sentence explains both why reads get faster and why writes get slower.
  8. Query plans: reading EXPLAIN without fear
    Stop guessing why a query is slow. The database will tell you exactly what it plans to do — you just have to read it bottom-up.
  9. Normalisation vs denormalisation
    Normalise so a fact is stored once. Denormalise so a question is answered once. Which you want depends entirely on whether you're writing or reading.
  10. Transactions and isolation levels
    A transaction is a promise that several statements happen as one. Isolation levels decide how much of other people's half-finished work you're allowed to see.
  11. The 20 SQL interview questions that keep reappearing
    SQL interviews recycle about eight shapes. Recognise the shape and the query writes itself.

How the course works