This page contains MySQL examples, including sample scripts for installing a DB, inserting data, running queries, and more.
Most examples linked to from this page use the Sakila sample database.
Installs the "Sakila" sample database complete with thousands of rows of data. Enables you to practice running queries against a database that contains lots of data.
Joins & Subqueries
For queries across multiple tables. Returns records where there is at least one row in both tables that match the join condition.
For queries across multiple tables. All rows from the left table will be returned, even if there's no matching row in the right table.
For queries across multiple tables. All rows from the right table will be returned, even if there's no matching row in the left table.
Clauses & Keywords
Removes duplicate rows from the result set of an SQL query.
Allows you to group the results of an SQL statement.
Allows you to filter a
GROUP BY clause.
Returns the number of characters in its parameter. Same as
Returns the string that results from concatenating its parameters.
Returns the number of rows in the result set of an SQL query.