> ## Documentation Index
> Fetch the complete documentation index at: https://villagesql.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# MySQL Tutorial

> Learn MySQL one lesson at a time against the Sakila sample database. Each lesson gives the syntax, worked examples, and the output the server returns.

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](/docs/guides/index) cover the same
ground organized by task rather than by lesson.

## Contents

### 1. Set up

* [Install a server](/docs/tutorial/install-mysql)
* [The Sakila sample database](/docs/tutorial/sakila-database)
* [Load Sakila](/docs/tutorial/load-sakila)

### 2. Reading data

* [SELECT](/docs/tutorial/select)
* [Column aliases](/docs/tutorial/column-aliases)
* [ORDER BY](/docs/tutorial/order-by)
* [SELECT DISTINCT](/docs/tutorial/select-distinct)
* [LIMIT](/docs/tutorial/limit)
* [Operators](/docs/tutorial/operators)

### 3. Filtering rows

* [WHERE](/docs/tutorial/where)
* [AND, OR and NOT](/docs/tutorial/and-or-not)
* [IN](/docs/tutorial/in)
* [BETWEEN](/docs/tutorial/between)
* [LIKE](/docs/tutorial/like)
* [IS NULL](/docs/tutorial/is-null)
* [REGEXP](/docs/tutorial/regexp)
* [Case sensitivity](/docs/tutorial/case-sensitivity)

### 4. Joining tables

* [How joins work](/docs/tutorial/joins)
* [Table aliases](/docs/tutorial/table-aliases)
* [INNER JOIN](/docs/tutorial/inner-join)
* [LEFT JOIN](/docs/tutorial/left-join)
* [RIGHT JOIN](/docs/tutorial/right-join)
* [CROSS JOIN](/docs/tutorial/cross-join)
* [Self join](/docs/tutorial/self-join)

### 5. Grouping and aggregating

* [Aggregate functions](/docs/tutorial/aggregate-functions)
* [GROUP BY](/docs/tutorial/group-by)
* [HAVING](/docs/tutorial/having)
* [COUNT DISTINCT](/docs/tutorial/count-distinct)
* [GROUP\_CONCAT](/docs/tutorial/group-concat)
* [WITH ROLLUP](/docs/tutorial/with-rollup)

### 6. Combining and nesting queries

* [UNION](/docs/tutorial/union)
* [Subqueries](/docs/tutorial/subqueries)
* [Correlated subqueries](/docs/tutorial/correlated-subqueries)
* [EXISTS](/docs/tutorial/exists)
* [ANY and ALL](/docs/tutorial/any-all)
* [Derived tables](/docs/tutorial/derived-tables)
* [Common table expressions](/docs/tutorial/cte)
* [Recursive CTEs](/docs/tutorial/recursive-cte)

### 7. Changing data

* [INSERT](/docs/tutorial/insert)
* [Insert multiple rows](/docs/tutorial/insert-multiple-rows)
* [INSERT SELECT](/docs/tutorial/insert-select)
* [UPDATE](/docs/tutorial/update)
* [DELETE](/docs/tutorial/delete)
* [Upsert](/docs/tutorial/upsert)
* [Transactions](/docs/tutorial/transactions)

## 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](/docs/guides/index) 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.
