MySQL Sakila Sample Database

官方文档
https://dev.mysql.com/doc/sakila/en/

Sakila示例数据库最初由MySQL AB文档团队的前成员Mike Hillyer开发,提供了一些标准的schema示例

安装

下载地址 https://dev.mysql.com/doc/index-other.html

解压文件

sakila-data.sql   sakila-schema.sql sakila.mwb

sakila.mwb 为 MySQL Workbench 文件

导入 数据库

$ mysql -uroot -proot
mysql> source  sakila-schema.sql
mysql> source sakila-data.sql

mysql> USE sakila;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql>
mysql> SHOW TABLES;
+----------------------------+
| Tables_in_sakila           |
+----------------------------+
| actor                      |
| actor_info                 |
| address                    |
| category                   |
| city                       |
| country                    |
| customer                   |
| customer_list              |
| film                       |
| film_actor                 |
| film_category              |
| film_list                  |
| film_text                  |
| inventory                  |
| language                   |
| nicer_but_slower_film_list |
| payment                    |
| rental                     |
| sales_by_film_category     |
| sales_by_store             |
| staff                      |
| staff_list                 |
| store                      |
+----------------------------+
23 rows in set (0.01 sec)

mysql> SELECT COUNT(*) FROM film;
+----------+
| COUNT(*) |
+----------+
|     1000 |
+----------+
1 row in set (0.00 sec)

mysql>
mysql> SELECT COUNT(*) FROM film_text;
+----------+
| COUNT(*) |
+----------+
|     1000 |
+----------+
1 row in set (0.00 sec)

表结构

各个表的说明

https://dev.mysql.com/doc/sakila/en/sakila-structure-tables.html

links

2018/8/29 posted in  database