AlgoInsight

Free lesson · Mastering SQL

Your SQL Roadmap - From First Query to FAANG Interview

Easy10 min readsqldatabase

So you want to learn SQL.

Maybe you have never written a single query in your life. Maybe you have been writing SELECT * FROM users for three years and you still freeze when an interviewer drops a window function on you. Maybe you are somewhere in between - you know enough SQL to pull data from a dashboard, but you would not bet your next job offer on it.

Wherever you are right now, this course meets you there and takes you all the way to the other side: the person who walks into a Meta SQL screen, a Netflix data round, or an Amazon analytics interview and handles it.

My name is Emeka. I am a Senior Software Engineer at Netflix, where I run data infrastructure - real-time event streaming, pipelines that ingest over eight billion viewing events every single day. I write SQL constantly. Not tutorial SQL. Production SQL. The kind that powers the dashboards your VP checks at 7 AM, the kind that processes more data before breakfast than most applications see in a month.

But here is the thing I want you to hear before anything else: I did not start here. I started in Lagos, Nigeria, teaching myself to code on a second-hand computer with a pirated Pascal compiler. I had never seen a relational database until I was nineteen. If you are starting from zero, I have been exactly where you are. And if you already know the basics and just need to sharpen your interview game, I have been there too - I went through seven rounds at Netflix before I got in.

This lesson is your map. Let us walk through everything this course covers, why it is structured the way it is, and what you will be able to do when you come out the other side.


Alex: Okay, I have a question before we even start. There are hundreds of SQL courses out there. Why this one?

Emeka: Fair question. Most SQL courses teach you syntax. They show you what SELECT does, what JOIN does, what GROUP BY does, and then they stop. You finish the course knowing how SQL works but not how to think in SQL. The gap between those two things is exactly where interview failures happen.

This course does something different. Every concept we cover, I am going to explain why it exists, when you would actually reach for it in a real system, and how an interviewer expects you to use it under pressure. I am not going to just teach you window functions. I am going to teach you how to recognize a window function problem in the first fifteen seconds of reading it, how to pick the right function, and how to talk your way through it out loud so the interviewer knows you are not guessing.

Alex: That sounds good, but I literally do not know what a window function is.

Emeka: Perfect. You do not need to. That is the point of having a roadmap. Let me show you how this whole course fits together.


The Course Map

This course is structured as a sixteen-module journey. The modules are not random - each one builds on the ones before it, like floors in a building. You cannot put the roof on before you have walls.

Here is the full architecture:

graph TD
    M0["M0: Welcome & Orientation"] --> M1["M1: SQL Foundations"]
    M1 --> M2["M2: Querying Data"]
    M2 --> M3["M3: Aggregations"]
    M2 --> M4["M4: Joins"]
    M3 --> M5["M5: Subqueries & CTEs"]
    M4 --> M5
    M5 --> M6["M6: Window Functions"]
    M6 --> M7["M7: Set Operations"]
    M5 --> M8["M8: DDL, DML & Views"]
    M6 --> M9["M9: Data Modeling"]
    M6 --> M10["M10: Indexing & Performance"]
    M10 --> M11["M11: Transactions & Concurrency"]
    M11 --> M12["M12: SQL at Scale"]
    M8 --> M13["M13: Procedural SQL"]
    M8 --> M14["M14: Database Security"]
    M6 --> M15["M15: Interview Patterns"]
    M15 --> M16["M16: Interview Strategy & Mock"]

    style M0 fill:#6366f1,color:#fff
    style M1 fill:#6366f1,color:#fff
    style M12 fill:#f59e0b,color:#000
    style M15 fill:#f59e0b,color:#000
    style M16 fill:#f59e0b,color:#000
This diagram shows the full course architecture as a dependency graph. Module zero, Welcome, leads into Module one, SQL Foundations. Foundations leads to Module two, Querying Data. From there, the path branches: Querying leads to both Aggregations (Module three) and Joins (Module four). Both of those converge into Subqueries and CTEs (Module five). Module five leads to Window Functions (Module six), which is the central hub - it connects forward to Set Operations, Data Modeling, Indexing, and the Interview Patterns module. The advanced track flows from Indexing through Transactions and Concurrency into SQL at Scale. The course culminates in Interview Strategy and Mock in Module sixteen. Three modules are highlighted in gold as differentiators: SQL at Scale, Interview Patterns, and Interview Strategy.

Alex: That is a lot of modules. Do I need to go through all of them?

Emeka: It depends on where you are starting and what you need. Let me break this into three phases so you can see where you fit.


Phase 1 - The Foundation (Modules 0–4)

This is where everyone starts, even if you have written SQL before. These modules build the mental model that everything else depends on.

Module 0 is where you are right now - orientation, understanding how the course works, and getting comfortable with the format.

Module 1: SQL Foundations is where we talk about what SQL actually is before you write a single query. Declarative thinking, the relational model, keys, constraints, normalization. And we cover something most courses completely skip: three-valued logic and NULL semantics. If you have ever been confused about why WHERE status = NULL returns zero rows, this module explains why - and it saves you from a trap that has ended more interviews than I can count.

Module 2: Querying Data is the workhorse. SELECT, WHERE, filtering, sorting, functions, dates, aliases. This is where you start writing real queries. I will teach you the logical execution order of a SQL statement here - FROM first, then WHERE, then GROUP BY, all the way to ORDER BY at the end - and once you understand that order, about eighty percent of SQL confusion just evaporates.

Module 3: Aggregations takes you from retrieving rows to summarizing data. COUNT, SUM, AVG, GROUP BY, HAVING, and the advanced grouping tools like ROLLUP and CUBE that most candidates have never touched.

Module 4: Joins is where SQL starts to feel powerful. We are combining data from multiple tables, and I am going to teach you why the Venn diagram everyone uses to explain joins is actually misleading. The real mental model is a cross product with a filter, and once you see it that way, every join type clicks into place.

Alex: So after Module 4, I can query a database?

Emeka: You can query any relational database. You can pull data, filter it, aggregate it, and combine tables. That alone is enough to be productive at work. But it is not enough to pass an interview. For that, you need Phase 2.


Phase 2 - The Power Tools (Modules 5–8)

This is where you go from "I can write SQL" to "I can write SQL that solves hard problems."

Module 5: Subqueries and CTEs teaches you composition - building complex queries from simple parts. We will cover the critical difference between EXISTS and IN, including the NULL trap that catches people in interviews constantly. And Common Table Expressions will change how you think about structuring queries. Instead of one giant tangled query, you will learn to write SQL in paragraphs of thought.

Module 6: Window Functions is the single most important module in this course for interview preparation. Window functions are what separate "knows SQL" from "is dangerous with SQL" in an interviewer's mind. ROW_NUMBER, RANK, LAG, LEAD, running totals, moving averages, and the frame clause that most courses skip entirely - I am going to teach you all of it. If you only study one module before an interview, make it this one.

Module 7: Set Operations covers UNION, INTERSECT, EXCEPT, and data pivoting. Shorter module, but the pivot pattern shows up in analytics interviews constantly.

Module 8: DDL, DML, and Views is about building and modifying the structures data lives in. Creating tables, inserting data, views, materialized views, temp tables, and working with JSON data. This is the module that makes you useful in a production environment, not just in a query tool.

Alex: What about performance? I have heard that writing fast SQL matters a lot.

Emeka: It matters enormously. That is Phase 3.


Phase 3 - The Production Stack (Modules 9–14)

These modules are what separate a SQL user from a SQL engineer.

Module 9: Data Modeling teaches you to design a database, not just query one. Entity-relationship modeling, normal forms in practice, and dimensional modeling with star and snowflake schemas. If your interview includes a "design the schema for X" question, this module is your preparation.

Module 10: Indexing and Query Performance is where I teach you what happens under the hood when your query runs. B-tree internals, how the query planner makes decisions, how to read an execution plan, and why your query is slow. I will walk you through taking a twelve-second query down to forty milliseconds.

Module 11: Transactions and Concurrency covers what happens when two queries hit the same row at the same time. ACID properties, isolation levels, locking, deadlocks, and MVCC. This is the module that matters if you are interviewing for backend or infrastructure roles.

Module 12: SQL at Scale is the module that no other SQL course offers. This is my world. OLTP versus OLAP, columnar stores, partitioning and sharding, streaming SQL with Flink, and how SQL fits into the modern data stack. I will tell you exactly how Netflix processes over eight billion events per day using SQL-based tools. If you are interviewing for data engineering or platform roles, this module is why you are taking this course instead of someone else's.

Modules 13 and 14 cover procedural SQL (functions, stored procedures, triggers) and database security (roles, privileges, row-level security, SQL injection). These are shorter, more reference-oriented modules that round out your knowledge.


Phase 4 - The Interview (Modules 15–16)

This is where everything comes together.

Module 15: Interview Patterns is fourteen battle-tested patterns that cover ninety percent of the SQL questions you will see in FAANG interviews. Top-N per group. Consecutive streaks. Funnel analysis. Sessionization. Gaps and islands. Each pattern taught with the exact approach you would use under time pressure, including how to talk your way through it with the interviewer.

Module 16: Interview Strategy and Mock is the capstone. How FAANG SQL rounds actually run - because Meta, Amazon, Google, and Netflix all run them differently. How to think aloud. How to clarify the schema before you write a single line. And a full end-to-end mock interview with both a strong and weak candidate walkthrough so you can see exactly what "good" looks like.

Alex: Okay, so who is this course actually for? Because you are talking about both beginners and people preparing for Netflix interviews. That is a huge range.

Emeka: It is. And that is intentional. Let me map it out.


Who This Course Is For

Tip: Find yourself below. That is your starting point.

The complete beginner. You have never written a query. You are not sure what a database even is. Start at Module 0 and go straight through. Every concept is explained from first principles. I assume nothing.

The self-taught developer. You can write SELECT and JOIN. You can pull data at work. But you have gaps - window functions make your eyes glaze over, you have never thought about query performance, and you would not survive a SQL interview right now. Start at Module 1 to fill the foundation gaps, then accelerate through Modules 5–6.

The backend engineer prepping for interviews. You use SQL in production every day. You need to sharpen your interview game specifically. Jump to Module 6 (window functions), then go straight to Modules 15 and 16. Use the earlier modules as reference when you need to brush up on something.

The data engineer going deep. You want the production-grade material: performance, transactions, concurrency, scale. Modules 9–12 are your territory. Module 12 (SQL at Scale) is written from my direct experience running data infrastructure at Netflix and Booking.com.

The career switcher. You are coming from a non-technical background and SQL is your entry point into data. Start at Module 0, go slow, do every exercise. The conversational format is designed for you. By the end of Module 6, you will know more SQL than most people who have been using it casually for years.


What You Will Be Able To Do When You Finish

I want to be specific about this, because vague promises are worthless.

Important: By the end of this course, you will be able to:

  • Write complex analytical queries using joins, subqueries, CTEs, and window functions - fluently, not by copying from Stack Overflow
  • Recognize and solve the fourteen SQL interview patterns that cover ninety percent of FAANG SQL questions
  • Design a database schema from a business problem description
  • Read a query execution plan and identify why a query is slow
  • Understand transactions, isolation levels, and concurrency at a level that lets you reason about production systems
  • Talk your way through a SQL solution out loud, with the structured approach interviewers are trained to listen for
  • Explain OLTP vs OLAP, partitioning, sharding, and streaming SQL - the concepts that elevate you from "SQL user" to "data systems thinker"

That is not a marketing claim. That is a checklist. If you do the work across these sixteen modules, you will check every box.

Alex: That is a lot. How long does the whole course take?

Emeka: If you are going cover to cover, expect roughly sixty to eighty hours of focused study. That is about two months at an hour a day, or one intense month if you are in full interview-prep mode. But honestly, most people will not go cover to cover. You will find the modules you need, go deep on those, and use the rest as reference.

The AI summary at the bottom of every lesson gives you the quick refresher version when you come back later. And the AI quizzes test whether the concepts actually stuck. Between the full lesson, the summary, and the quiz, every topic gets three passes at making it into your long-term memory.

Alex: Okay. I am in. Where do we start?

Emeka: Next lesson. I am going to explain exactly how this course works - the format, the exercises, the two of us talking like this, and how to use the course as a reference after you have finished it. Then in the lesson after that, I will tell you my full story - how I got from Lagos to Netflix - because I think it matters for you to know who is teaching you and why I built this course the way I did.

Let us go.


Tip: Your next step: Move on to the next topic - How This Course Works - where we break down the format, the exercises, and how to get the most out of every lesson.

Back to Mastering SQL