Learn SQL online by writing real queries

Write queries, get instant feedback, and build real SQL skills in bite-sized lessons that run in your browser. Start free with your first SELECT, no install or card needed.

Start learning free

The SQL course

27 lessons, about 2 hours. SQL Pro from $10.99 a month.

  1. Unit 1: SELECT basics

    Pull columns out of a table.

    • Your first SELECT (free)
    • SELECT * and LIMIT (free)
    • Rename and dedupe
  2. Unit 2: Filter with WHERE

    Keep only the rows you care about.

    • Filter with WHERE
    • AND, OR, NOT
    • IN, BETWEEN, LIKE
    • Working with NULL
  3. Unit 3: Sort with ORDER BY

    Put results in the order you need.

    • ORDER BY
    • Top N results
  4. Unit 4: Count and group

    Summarize data with aggregates.

    • COUNT, SUM, AVG
    • GROUP BY
    • HAVING
  5. Unit 5: Join tables

    Combine data from several tables.

    • INNER JOIN
    • LEFT JOIN
    • Joining many tables
  6. Unit 6: Subqueries and CTEs

    Use one query’s answer inside another.

    • Subqueries in WHERE
    • Subqueries as tables
    • WITH (CTEs)
  7. Unit 7: CASE, text and dates

    Label, reshape and work with dates.

    • CASE expressions
    • Text functions
    • Working with dates
  8. Unit 8: Window functions

    Rank, compare and total across rows.

    • ROW_NUMBER and RANK
    • PARTITION BY
    • Running totals, LAG and LEAD
  9. Unit 9: Change data

    Insert, update, delete and create tables.

    • INSERT
    • UPDATE and DELETE
    • CREATE TABLE

Free SQL guides

Frequently asked questions

Can I learn SQL online for free?

Yes. The first 2 lessons, 3 practice problems and the SQL cheat sheet are free, with no card needed. SQL Pro unlocks all 27 lessons for $10.99 a month or $69.99 a year.

Do I need to install anything?

No. Every query runs in a real SQL database inside your browser, so you can practice on a laptop, tablet or phone without setting anything up.

Which SQL will I learn?

Standard SQL: SELECT, WHERE, ORDER BY, GROUP BY, JOINs, subqueries, CTEs, CASE, window functions, and INSERT, UPDATE and DELETE. Lessons run on SQLite, and the same skills carry over to PostgreSQL, MySQL and SQL Server.

How long does it take to learn SQL?

Each lesson takes 3 to 5 minutes. The full course is 27 lessons, about 2 hours of hands-on practice, taking you from your first SELECT to window functions.

Is this good for SQL interview prep?

Yes. The interview prep track has 15 classic SQL interview questions, such as second-highest salary, self joins and window functions, each checked instantly.

Do I get a SQL certificate?

SQL Pro members earn 3 certificates: SQL Fundamentals, Intermediate SQL, Advanced SQL. Each has a link and QR code anyone can use to verify it, and you can add it to LinkedIn in one click.

Can I cancel SQL Pro anytime?

Yes. Cancel in Account under Manage billing. You keep Pro until the end of the period you’ve paid for.