Course Roadmap & Structure
Introduction
This page is the plan of Foundations - SQL: its 12 sections in the order they are taught, what each one teaches, every lesson in it, and where the course leads once it ends. Each lesson's name on this page is a link to its own page.
The Course at a Glance
Foundations - SQL has 102 lessons in 12 sections. Each section uses what the ones before it taught, so they are meant to be taken in order:

Every Section and Its Lessons
Each section with what it teaches, then its lessons, numbered through the course, each with what it covers. A lesson's name opens it.
1. Getting Started
How the course works, the practice dataset and the official documentation, the plan of every section and lesson, and where to get help and meet other learners.
4 lessons
| # | Lesson | What it covers |
|---|---|---|
| 1 | Course Introduction | What the course teaches, who it is for, how a lesson works and where to start |
| 2 | Course Resources | The practice dataset and how its tables link, the official manuals, and a cheat sheet |
| 3 | Course Roadmap & Structure | This plan: every section and lesson, the milestones and the courses after it |
| 4 | Join the Community | Where to get help: Ask Peet, the comments, the Discord and the YouTube channel |
2. Introduction to SQL
What SQL and databases are, what a DBMS does, the kinds of databases, the families of SQL commands, why SQL is worth learning, and how to set up a database on your own computer.
6 lessons
| # | Lesson | What it covers |
|---|---|---|
| 5 | What is SQL and What are Databases? | What a database and a relational database are, what SQL is, and a first query |
| 6 | What is DBMS? | What a DBMS does, how it is built, DBMS against RDBMS, and the well-known ones |
| 7 | Types of Databases | Relational, NoSQL and specialized databases, how they are deployed, and choosing one |
| 8 | SQL Commands | The five families of commands: DQL, DML, DDL, DCL and TCL |
| 9 | Why Learn SQL? | Where SQL is used, the careers that ask for it, and how it compares with other tools |
| 10 | Environment Setup: SQL Server, SSMS and Databases | Setting up SQLite, SQL Server, PostgreSQL or MySQL on your own computer |
3. SELECT Queries
What a query is and its parts; SELECT and FROM, WHERE, ORDER BY, GROUP BY, HAVING and DISTINCT; keeping only the first rows (LIMIT, and TOP in SQL Server); the order a query runs in.
11 lessons
| # | Lesson | What it covers |
|---|---|---|
| 11 | What is SQL Query | What a query is, its anatomy, and how SQLite answers one |
| 12 | Components of SQL | The clauses of a query, from SELECT to ORDER BY, and the order they are written in |
| 13 | SELECT & FROM | Choosing columns from a table: SELECT and FROM, aliases, expressions and literal values |
| 14 | WHERE | Keeping only the rows that pass a test, with a first look at every filtering operator |
| 15 | ORDER BY | Sorting the result by one column or several, by text or number, and where NULL lands |
| 16 | GROUP BY | Folding rows into groups and summarizing each with COUNT, SUM, AVG, MIN and MAX |
| 17 | HAVING | Filtering groups once they are formed, and how HAVING differs from WHERE |
| 18 | DISTINCT | Keeping one row for each different value, and counting the different values |
| 19 | TOP | Keeping only the first rows: LIMIT and OFFSET here, TOP in SQL Server |
| 20 | Coding Order vs Execution Order | The order a query is written in against the order its clauses take effect |
| 21 | Cool SQL Stuff | A preview of later tools: CASE, COALESCE, string, date and math tricks, and subqueries |
4. Data Definition (DDL)
Creating, changing and removing tables, and the indexes and views built on them: CREATE, ALTER and DROP.
5. Data Manipulation (DML)
Adding, changing and removing rows: INSERT, UPDATE and DELETE.
6. Filtering Data
The comparison operators, AND, OR, NOT, BETWEEN, IN and LIKE.
8 lessons
| # | Lesson | What it covers |
|---|---|---|
| 28 | Intro - What is Data Filtering | What filtering is, why it matters, and the kinds of operators WHERE can use |
| 29 | Comparison Operators | The six comparison operators on numbers, text and dates |
| 30 | AND Operator | Requiring every condition to hold: AND and its truth table |
| 31 | OR Operator | Keeping a row when any one condition is true, and combining OR with AND |
| 32 | NOT Operator | Turning a condition around: NOT with IN, BETWEEN, LIKE, AND and OR |
| 33 | BETWEEN Operator | Testing a range with both ends included, on numbers, dates and text |
| 34 | IN Operator | Testing a value against a list, or against the result of a subquery |
| 35 | LIKE Operator | Matching text against a pattern with its two wildcards |
7. SQL Joins
Why data is split across tables and how keys link them; INNER, LEFT, RIGHT and FULL joins, the three anti joins, CROSS JOIN, choosing a join, and joining several tables.
13 lessons
| # | Lesson | What it covers |
|---|---|---|
| 36 | Intro - What is Data Combining | Why data is split across tables, how keys link them, and the ways to combine it |
| 37 | Intro to JOINS | What a join is, its syntax, table aliases, and the ON clause |
| 38 | NO JOIN | What two tables give with no join condition: the Cartesian product |
| 39 | INNER JOIN | Only the rows that have a match in both tables |
| 40 | LEFT JOIN | Every row of the left table, with its match from the right or NULL |
| 41 | RIGHT JOIN | Every row of the right table, the mirror of LEFT JOIN |
| 42 | FULL JOIN | Every row of both tables, matched where a match exists |
| 43 | LEFT ANTI JOIN | The rows of the left table that have no match in the right |
| 44 | RIGHT ANTI JOIN | The rows of the right table that have no match in the left |
| 45 | FULL ANTI JOIN | The rows of either table that have no match in the other |
| 46 | CROSS JOIN | Every row of one table paired with every row of the other |
| 47 | Choosing the Right JOIN | Which join answers which question, with a decision guide |
| 48 | Multiple Table JOINS | Chaining joins across three or more tables, and self joins |
8. SQL SET Operators
UNION, UNION ALL, EXCEPT and INTERSECT, the rules they share, and two uses: combining lists, and finding what changed.
9 lessons
| # | Lesson | What it covers |
|---|---|---|
| 49 | Introduction to SET Operators | Combining the results of two queries, and how that differs from a join |
| 50 | Set Rules & Syntax | The rules every set operator follows, column naming and data type compatibility |
| 51 | UNION | The rows of both results with duplicates removed |
| 52 | UNION ALL | The rows of both results with duplicates kept |
| 53 | EXCEPT | The rows of the first result that are not in the second |
| 54 | INTERSECT | The rows that appear in both results |
| 55 | Use Case – Combining Information | Patterns for combining data from several sources into one view |
| 56 | Use Case – Delta Detection | Finding new, deleted and changed records between two versions of data |
| 57 | SET Operators Summary | The four set operators side by side: syntax, rules and when to use each |
9. String Functions
What a function is; joining text, changing its case, trimming it, replacing parts of it, measuring its length and taking pieces of it; and number functions.
10 lessons
| # | Lesson | What it covers |
|---|---|---|
| 58 | Intro - What is Data Transformation | What transforming data means, why it is needed, and the kinds of functions |
| 59 | SQL Functions | What a function is, its arguments, nesting functions, and functions on NULL |
| 60 | CONCAT | Joining text values into one, with separators and NULL handled |
| 61 | UPPER & LOWER | Changing the case of text, and filtering text whatever its case |
| 62 | TRIM | Removing spaces or chosen characters from the ends of text: TRIM, LTRIM and RTRIM |
| 63 | REPLACE | Replacing every occurrence of a piece of text, or removing it |
| 64 | LEN | Counting the characters of a text value: LENGTH here, LEN in SQL Server |
| 65 | LEFT & RIGHT | Taking characters from the start or the end of text, with SUBSTR in SQLite |
| 66 | SUBSTRING | Taking any part of a text value by its position and length |
| 67 | Number Functions | ROUND, ABS, integer division and the modulo operator |
10. Date & Time Functions
Taking dates apart, cutting them to a month or a year, the last day of a month, formatting and casting, adding to a date and measuring between two, and checking that a value is a date; the lessons named after a SQL Server function (DATEPART, EOMONTH, FORMAT and others) show it beside SQLite's way.
18 lessons
| # | Lesson | What it covers |
|---|---|---|
| 68 | What is Date & Time | What date and time data is, its types and formats, and the dates in the dataset |
| 69 | Overview of Date & Time Functions | The kinds of date functions, SQLite's own, and SQL Server's beside them |
| 70 | DAY, MONTH, YEAR | Extracting the year, the month or the day from a date |
| 71 | DATEPART | Any part of a date as a number: quarter, week, day of week or hour |
| 72 | DATENAME | A part of a date as text, such as the name of its month or of its day |
| 73 | DATETRUNC | Cutting a date back to the start of its month, quarter, year or week |
| 74 | EOMONTH | The last day of the month of a given date |
| 75 | Use Cases – Date Extraction | Date parts at work: year over year, day of week, hour of day, quarters and cohorts |
| 76 | Comparing Extract Functions | When to use each of the functions that take dates apart |
| 77 | Introduction to Formatting & Casting | Formatting against casting: how a date is shown, and changing a value's type |
| 78 | FORMAT | Displaying a date in a custom format, by a pattern |
| 79 | CONVERT | SQL Server's CONVERT and its style codes, with the SQLite equivalents |
| 80 | CAST | Changing a value from one data type to another, the standard way |
| 81 | DATEADD | Adding days, months or years to a date, or subtracting them |
| 82 | DATEDIFF | The time between two dates, in days, weeks, months or years |
| 83 | ISDATE | Checking that a value is a valid date before using it |
| 84 | Date & Time Summary | Every date and time function of the section in one reference |
| 85 | Date & Time Scripts | Practice scripts that put several date functions to work on the dataset |
11. NULL Functions
What NULL is and why a test on it can be neither true nor false; COALESCE and ISNULL; NULL in sums, arithmetic, joins and sorting; NULLIF; IS NULL; NULL against an empty string; rules for missing values.
11 lessons
| # | Lesson | What it covers |
|---|---|---|
| 86 | Introduction to NULLs | What NULL is, why it is not zero or an empty string, and three-valued logic |
| 87 | COALESCE vs ISNULL | Replacing NULL with a value: COALESCE, IFNULL and SQL Server's ISNULL |
| 88 | Handling NULLs – Data Aggregation | How COUNT, SUM, AVG, MIN and MAX treat NULL |
| 89 | Handling NULLs – Mathematical Operations | Why arithmetic with NULL gives NULL, and how to protect a calculation |
| 90 | Handling NULLs – Joining Data | Why NULL never matches in a join, and how to find and handle unmatched records |
| 91 | Handling NULLs – Sorting Data | Where NULL lands in a sorted result, and how to control its position |
| 92 | NULLIF | Converting a specific value into NULL, as in a safe division |
| 93 | IS NULL & IS NOT NULL | The right way to test for NULL, and why an equals sign does not work |
| 94 | NULL vs Empty vs Blank | Telling NULL, an empty string and a blank one apart, and cleaning all three |
| 95 | Handling NULLs – Data Policies | Policies a team can set for what NULL means and how it is replaced |
| 96 | NULL Summary | Everything about NULL in one reference |
12. CASE WHEN Statement
CASE's two forms and its rules, and three uses: sorting values into groups, mapping codes to names, and handling NULL.
6 lessons
| # | Lesson | What it covers |
|---|---|---|
| 97 | Introduction to CASE Statements | CASE and its two forms, simple and searched, and how it is evaluated |
| 98 | Use Case – Categorizing Data | Sorting values into named categories with CASE, and counting by category |
| 99 | CASE Rules | The rules of CASE: END, ELSE, compatible types, the first match, nesting |
| 100 | Use Case – Mapping Values | Turning codes and abbreviations into readable labels with CASE |
| 101 | Use Case – Handling NULLs | Detecting NULL and providing default values with CASE |
| 102 | CASE Statement Summary | CASE in one reference: syntax, common patterns and best practices |
Milestones
What you can do by the end of each section:
| After | You can |
|---|---|
| Getting Started | Find your way around the course: its plan, its data and where to get help |
| Introduction to SQL | Say what a database, a DBMS and SQL are, and which family a SQL command belongs to |
| SELECT Queries | Query one table: choose columns, filter, sort, group and count |
| Data Definition (DDL) | Create a table, change it and remove it |
| Data Manipulation (DML) | Add, change and remove rows |
| Filtering Data | Write the filters a question needs |
| SQL Joins | Combine two or more tables, and find the rows that have no match |
| SQL SET Operators | Stack, compare and subtract the results of two queries |
| String Functions | Clean and reshape text, and round numbers |
| Date & Time Functions | Group, compare and format dates |
| NULL Functions | Find missing values and decide what a query does with them |
| CASE WHEN Statement | Turn values into labels and categories |
After Foundations - SQL
Foundations - SQL is the first of four SQL courses. The other three go on in this order:
| Course | Its sections |
|---|---|
| Advanced Queries - SQL, 76 lessons in 7 sections | Window Functions Basics, Window Aggregate Functions, Window Ranking Functions, Window Value Functions, Subqueries, Common Table Expression (CTE), Views |
| Production SQL & Engineering, 69 lessons in 6 sections | CTAS & TEMP Tables, Stored Procedures, Indexes, Partitions, Performance Best Practices, Copilot & ChatGPT for SQL |
| Real-World SQL Projects, 58 lessons in 4 sections | SQL Data Warehouse Project, Exploratory Data Analysis Project (EDA), SQL Advanced Data Analytics Project, THANK YOU |
How to Use This Roadmap
- Take the sections in order. Joins come after you can query one table; the functions come after you can combine tables.
- Run every example. A SQL block with a Run Code button runs on CodePeet; change the query and run it again.
- Do the exercises. 90 of the 102 lessons have a Practice section, each exercise with a worked query.
- Come back to this page to see what is next and what a section covers.
Summary
What You Learned
- Foundations - SQL has 102 lessons in 12 sections, from Course Introduction to CASE Statement Summary.
- The sections build on one another and are taken in order.
- After it come Advanced Queries - SQL, Production SQL & Engineering and Real-World SQL Projects.
Next Up
Continue to Join the Community to see where to get help. Then What is SQL and What are Databases? starts the course.