Skip to main content
This tutorial teaches SQL on MySQL in order, one lesson at a time. Every lesson queries the same sample database, so each one builds on data you already loaded instead of inventing new tables. Every result shown is output captured from a running server, so you can check your screen against the page. Read it in sequence if you are new to SQL. If you already write SQL and want one answer to one question, the MySQL guides cover the same ground organized by task rather than by lesson.

Contents

1. Set up

2. Reading data

3. Filtering rows

4. Joining tables

5. Grouping and aggregating

6. Combining and nesting queries

7. Changing data

What you need

A running server, the Sakila sample database loaded into it, and a client. The Set up section covers all 3.

Where VillageSQL fits

VillageSQL is MySQL with an extension framework added, so every statement in this tutorial runs on it unchanged. No lesson here needs an extension. Once you finish, the guides cover what the extensions add on top. MySQL is a registered trademark of Oracle and/or its affiliates. Other names may be trademarks of their respective owners. VillageSQL is not affiliated with or endorsed by Oracle Corporation.