Skip to main content

VillageSQL is a drop-in replacement for MySQL with extensions.

All examples on this page work on VillageSQL. Install Now →
Sakila arrives as 2 SQL files in 1 zip. The first builds the tables, the second fills them. You run them in that order, against the server from Install a server.

Download it

Run these in any directory you like.
That leaves a sakila-db directory. The 2 files you need from it are sakila-schema.sql and sakila-data.sql.

Load it

The schema file first, then the data file. Press Return at each password prompt if root has no password.
Neither command prints anything after the password prompt when it works. The data file takes longer, because it inserts every row in the database.
The first thing the schema file does is DROP SCHEMA IF EXISTS sakila. Running these 2 commands again rebuilds the database from scratch, so you can always get back to a clean copy. Anything you changed goes with it.

Check it

Ask the server what the database now contains.
23 names, because SHOW TABLES lists the 16 tables and the 7 views together. The tables can arrive without the data, so count something as well.
1,000 films means you are ready for the first lesson.

Work inside the database

Every lesson writes its queries as though sakila is the current database. Name it when you open the client:
Or switch to it once you are inside:
Without one of those, a query naming film fails.

See also