Beginner · Free · In your browser

Learn SQL

Go from your first SELECT to reliable multi-table reports. Learn joins and deliberate writes, then deepen your toolkit with CTEs, window functions, existence tests, combined results, and transactions.

20 lessons6 modules3.7 hours of practice4 challenges
Start the SQL course →

No installation. Your code runs right in the browser. No SQL experience needed. All sample tables are provided.

What you will be able to do

Course outline

Module 1

Read & shape results

Choose columns, remove duplicates, and filter records.

  1. Meet your first databaseSELECT your data · 5 min
  2. Choose useful columnsDISTINCT, expressions & aliases · 8 min
  3. Find what mattersFiltering with WHERE · 6 min
Module 2

Ask precise questions

Combine conditions, sort results, and calculate labels.

  1. Ask a more specific questionCombining conditions · 7 min
  2. Bring a little orderORDER BY & LIMIT · 6 min
  3. Turn values into labelsCASE expressions · 8 min
Module 3

See patterns in data

Aggregate, filter groups, and compare with a subquery.

  1. See the bigger pictureAggregates & groups · 7 min
  2. Filter a group, not a rowHAVING & aggregate conditions · 9 min
  3. Ask a question inside a questionSubqueries · 9 min
Module 4

Relationships & real reports

Join tables, modify records, and report on every course.

  1. Connect related tablesINNER JOIN & keys · 11 min
  2. Change data deliberatelyINSERT, UPDATE & DELETE · 11 min
  3. Project: a course activity reportFinal project · joins & aggregates · 20 min
Module 5

Explain a more complex report

Handle missing averages, name query stages, rank rows, and retain detail alongside totals.

  1. Calculate an average without inventing dataNULLIF, numeric division & ROUND · 12 min
  2. Name each stage of a queryCommon table expressions · 13 min
  3. Number rows without grouping them awayROW_NUMBER & window ordering · 13 min
  4. Show detail alongside its group totalPARTITION BY & window aggregates · 13 min
Module 6

Trustworthy database features

Test relationships, combine results, use transactions, and build a ranked learner report.

  1. Ask whether a relationship existsEXISTS & NOT EXISTS · 12 min
  2. Combine compatible result setsUNION ALL & provenance · 12 min
  3. Treat related changes as a transactionBEGIN, COMMIT & ROLLBACK · 15 min
  4. Project: a ranked learner activity reportCapstone · CTEs, joins & dense ranks · 25 min

Ready for your first line?

Every lesson is short, hands-on, and checked automatically.

Start learning SQL →