SQL courses: learn SQL step by step
20 complete lessons, from your first SELECT to window functions. Each lesson explains the syntax and how it works with a diagram, shows examples with their real results, lists the most common mistakes and offers exercises. Every query runs on the same sample database, a fictional online shop, which you can explore and query right in your browser.
The basics Beginner
Grouping and linking data Intermediate
Advanced queries Advanced
How to use these courses
If you are a beginner, follow the lessons in order: each notion builds on the previous ones. For every example, the “Try it in the sandbox” button opens the query in the SQL Quest editor, where you can change and run it without installing anything. Once a notion is clear, move on to the interactive exercises: your query is compared with the expected result and a tutor explains your mistakes.
The SQL taught here is standard SQL, run by SQLite. It applies to PostgreSQL, MySQL, SQL Server and Oracle; the few differences between these databases are pointed out in the lessons. The sample database keeps its French table and column names (clients = customers, produits = products, commandes = orders…): each lesson includes a glossary.