MySQL – Download Sample Database – Sakila, World, Employee

Sakila, World, and Employees answer different MySQL practice questions. Sakila models a DVD rental business with related tables, views, routines, and triggers. World is a compact geography dataset for joins and grouping. Employees is much larger and better suited to testing queries over substantial data. Choose the sample that matches the lesson, then test production performance questions against a representative workload and data distribution.

Three open cubbies holding a film reel, a globe, and work aprons for three sample datasets

Which MySQL Sample Database Should You Download?

I use Sakila frequently in training because its relationships and database objects support more than a single-table demonstration. World is easier when the lesson needs a small, recognizable set of countries, cities, and languages. Employees is useful when a few thousand rows would hide the cost of a query plan. None of these is a substitute for your application’s own schema and workload when you are making a production tuning decision.

SampleGood first useWhat you get
SakilaRelationships and routinesRental, film, customer, inventory, views, procedures, and triggers
WorldIntroductory joins and aggregatesCountry, city, and countrylanguage tables
EmployeesLarger query exercisesEmployee, department, title, and salary history plus validation scripts

Download from Oracle’s MySQL example-database page. It lists the current packages and setup guides together. The standard world database is distinct from world_x. The older link in this article pointed to world_x even though the text described world; use the world package below.

Install Sakila on Windows

Download the Sakila ZIP from Oracle and extract it to a test folder, for example C:\Temp\sakila-db. The archive contains sakila-schema.sql, sakila-data.sql, and a Workbench model. Use a MySQL account with permission to create a database. In Command Prompt or PowerShell, start the mysql client with mysql -u root -p; it will ask for the password interactively. Do not put that password on the command line.

SOURCE C:/Temp/sakila-db/sakila-schema.sql;
SOURCE C:/Temp/sakila-db/sakila-data.sql;
USE sakila;
SHOW FULL TABLES;
SELECT COUNT(*) AS film_count FROM film;

Run these lines at the mysql> prompt, in order. Adjust the path to where you extracted the ZIP. MySQL’s Windows SOURCE examples use forward slashes. The schema script creates the structure; the data script populates it and adds triggers that follow the initial load. Oracle’s installation guide shows 1,000 films for its packaged sample. If the count or object list is different, first check that both scripts completed and that you are connected to the intended server.

The original Sakila schema picture remains below because it helps you see the relationships among film, inventory, rental, customer, and payment. Treat it as a guide to the sample, not a promise that every package version has identical columns. Oracle’s Sakila distribution has changed with MySQL versions.

Original Sakila schema diagram showing film, inventory, rental, customer, and payment relationships
The Sakila schema image from the original article is kept for reference.

Install the Standard World Database

Download the World ZIP from Oracle and extract it. Its world-db folder contains world.sql. The following path assumes the extracted folder is C:\Temp\world-db. Run the commands in the mysql client, and change the path if needed.

SOURCE C:/Temp/world-db/world.sql;
USE world;
SHOW TABLES;
SELECT COUNT(*) AS country_count FROM country;
SELECT COUNT(*) AS city_count FROM city;

You should see the three tables country, city, and countrylanguage. Oracle’s setup guide reports 239 countries and 4,079 cities for its current sample. The table list is a useful first check even if you are working with a different revision of the dataset. If SOURCE cannot open the file, check the extracted folder name and the full path rather than creating an empty world database manually.

Install and Validate Employees

The Employees package is maintained as Employees DB and is linked from Oracle’s example-database page. Download its ZIP, extract the whole folder, and keep employees.sql together with its load_*.dump files. Employees contains roughly 300,000 employee records and millions of related rows, so allow more time and disk space than for World. Use a disposable MySQL instance or test database server: the installation script creates the employees schema and can replace an existing schema with that name.

Open Command Prompt in the extracted Employees folder. The example below uses C:\Temp\test_db-master; adjust it to your actual folder. Command Prompt supports the input-redirection operator used here. Run from this folder because the main script loads other files by relative name.

cd /d C:\Temp\test_db-master
mysql -u root -p < employees.sql
mysql -u root -p -t < test_employees_sha2.sql

For MySQL 9.5 and later clients, add --commands immediately after mysql in both commands so nested SOURCE statements run. The second command runs the package’s SHA-256 integrity test. Look for matching row counts and checksums in its results; a completed import command by itself does not prove all data loaded correctly. For a quick additional check, reconnect to MySQL and run USE employees; SHOW TABLES; SELECT COUNT(*) FROM employees;. Oracle’s published validation output shows 300,024 employees for the sample. The upstream package notes explain which validation script to use with newer MySQL versions.

Keep Sample Data Separate From Production Decisions

Read the scripts before loading them, particularly if a database name already exists on the target instance. Keep these examples on a test server or local instance. A sample dataset is excellent for learning syntax, relationships, and the shape of an execution plan. It does not reproduce your production row counts, data skew, concurrency, indexes, or hardware. For a performance recommendation, test again with representative data and workload evidence.

If you are looking for a SQL Server sample instead, my install guide covers WideWorldImporters and AdventureWorks. For MySQL, start with the smallest dataset that teaches the point, then move to Employees when scale matters. I still reach for Sakila when a demonstration needs real relationships and database objects, but the best sample is the one that makes the behavior you are teaching visible.

Sakila, World, and Employees are three useful MySQL sample databases because they give you different kinds of practice data, not three interchangeable downloads.

Published by Pinal Dave on SQLAuthority. More of my work at pinaldave.com.


Discover more from SQL Authority with Pinal Dave

Subscribe to get the latest posts sent to your email.

Schema, SQL Sample Database, SQL Server
Previous Post
SQL SERVER – SSMS Install Error 0x80070652 – Setup is Blocked Due to Another Install Currently running. Please Let the Other Install Complete and then Restart the Computer if Necessary
Next Post
Choosing a Processor for SQL Server: Count the Licensed Cores

Related Posts

1 Comment. Leave new

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.