SQL Learning Roadmap — From Basics to Advanced

A structured journey from SQL fundamentals to real-world data projects.

1. Foundations

SQL (Structured Query Language) is a language for working with relational databases. Start by understanding tables, rows and columns.

First query

SELECT *
FROM Customers;

This retrieves all rows and columns from the Customers table.

Key Takeaway

SELECT decides what data I want. FROM decides where the data comes from. WHERE decides which rows I want.

Topics in this chapter

  • What is SQL?

  • Why learn SQL?

  • Relational databases and tables

  • Setting up my local environment

  • Loading sample data

2. Defining Database Structure

A table describes the shape of your data. Choose names and data types that make its purpose clear.

CREATE TABLE Customers (
    CustomerID INT PRIMARY KEY,
    Name VARCHAR(100)
);

Here I am defining the structure in which data will live.

3. Manipulating Data

Practise INSERT, UPDATE and DELETE on a small sample database. Check which rows you will affect before making changes.

4. Filtering Data

Use WHERE to select the rows you need. Explore comparisons, AND, OR, IN, BETWEEN and NULL.

5. Combining Tables

JOIN connects related data. Learn how INNER JOIN and LEFT JOIN differ, especially when a relationship is missing.

6. Row-Level Functions

Transform text, dates and numbers with functions. Keep an eye on how your database handles NULL values.

7. Aggregation and Analytics

GROUP BY turns individual rows into useful summaries. COUNT, SUM and AVG are good places to start.

8. Window Functions

Window functions calculate across related rows while retaining each individual row. Try ROW_NUMBER and a running total.

9. Subqueries

Use the result of one query inside another. Compare subqueries with joins and inspect how clearly each expresses your intent.

10. Common Table Expressions

A CTE gives a name to a query step. Use WITH to break a larger problem into readable pieces.

11. Views

Save a useful query as a view to provide a consistent interface to your data.

12. Stored Procedures and Triggers

Explore database-side routines and event-driven actions. Syntax and behaviour depend on the database you choose.

13. Performance Optimisation

Read execution plans and measure before optimising. Learn how indexes support your actual query patterns.

14. SQL + AI

Use AI to explain unfamiliar SQL and suggest exercises. Verify every generated query against a small, known dataset.

const res = await fetch("https://jsonplaceholder.typicode.com/users/1");
const user = await res.json();
console.log("A row from a free sample API, no key needed:");
console.log(user.name, "-", user.email, "-", user.address.city);

15. Projects

Build a small sales analysis project: define questions, model the data, write queries and explain your findings.

16. My SQL Learning Map

Return to this roadmap as your understanding grows. Add examples, questions and links to the lessons you publish.