SQL Course

SQL (Structured Query Language) is how you ask a database questions — which rows to see, how to filter them, and how to combine data from multiple tables.

What you'll learn

Every example runs against a small real database, right in this page — powered by sql.js, a real SQLite engine compiled to WebAssembly. Click "Run query" to execute your edited SQL and see actual results.

Lessons

  1. Introduction
  2. Filtering with WHERE
  3. Sorting
  4. Aggregate Functions
  5. Insert, Update, Delete
  6. Joins
  7. Creating Tables
  8. LIKE & Wildcards
  9. DISTINCT & LIMIT
  10. Handling NULL
  11. Subqueries
  12. UNION
  13. Constraints & Keys
  14. Views
Note: each example starts from a fresh, isolated database, so feel free to experiment — including with INSERT, UPDATE, and DELETE — nothing you do here can break anything.