MySQL Sakila Sample Database

This article introduces the Sakila sample database used in this tutorial.

In the whole MySQL tutorial, we use the Sakila sample database as a demo database to learn MySQL more quickly and effectively. The Sakila sample database is one of the most widely used sample databases. The Sakila database models the DVD rental store business, which contains content such as films, actors, inventory, stores, customers and staffs.

Install the Sakila sample database

If you choose the Full type of MySQL Installation, the Sakila sample database will be installed by default. If not, please install the Sakila sample database first.

Sakila sample database architecture

There are 16 tables, 7 views, 3 stored procedures, 3 stored functions and 6 triggers in The Sakila database.

Tables in the Sakila database:

  • actor: The actor table lists information for all the actors, includes first name and last name of actors.
  • address: The address table contains address information for customers, staff, and stores.
  • category: The category table lists the categories that can be assigned to films.
  • city: The city table contains a list of cities.
  • country: The country table contains a list of countries or regions.
  • customer: The customer table contains a list of all customers.
  • film: The film table lists all the films that may be in stock in the store.
  • film_text: The content of film_text table is kept in synchrony with the film table by means of triggers on the film table INSERT, UPDATE and DELETE operations。
  • film_actor: The film_actor table is used to support many-to-many relationships between films and actors.
  • film_category: The film_category table is used to support many-to-many relationships between films and categories.
  • inventory: A row in the inventory table represents a copy of a given film in a given store.
  • language: The language table lists all possible values ​​for the film language and original language.
  • payment: The payment table records every payment made by the customer, includes information such as the amount and rent paid.
  • rental: The rental table contains a row for each rental of each inventory item, which contains information about who rented what, when it rented it, and when it was returned.
  • staff: The staff table lists all staff information, including email addresses, login information, and pictures.
  • store: The store table lists all stores in the system.

Sakila sample database architecture diagram
Sakila sample database architecture diagram

Conclusion

In this article, we introduced the Sakila sample database used in this tutorial. In the whole MySQL tutorial, the Sakila sample database is used as the demo database.

Now the Sakila sample database is ready, please start the following tutorial.