Introduction
It seems to me to be a more demanding hands-on, but not mindset, and people's skills are mostly learned through learning, except for some instincts.
A period of time has been in the material, writing a series of articles about explain; I had a problem at the beginning that I needed a sample database, otherwise
There's no way to do it, but when I was working on SQL Server, I found out that SQL Server was officially a sample database. Thought MySQL should also have, the result is to find
A half a day did not find, no way to design one, and finally found that design is not a problem, the problem is the data integrity and the amount of data. Data integrity affects data over the entire
Self-consistency in the context of logic, the amount of data directly affects the optimizer's choice of execution plan. Therefore, it is very expensive to construct a database that satisfies the above conditions.
I see a sample database employees when I look at Mysql-connector-python 8.0.11 version of the official documentation.
1. Introduction to the Employees sample database
1): Employees's source code is hosted on GitHub, downloaded to the data into MySQL can be used
2): Project address: https://github.com/datacharmer/test_db
2. Download the Employees sample database
https://github.com/datacharmer/test_db
3. The contents of the extracted directory are as follows
Tree test_db-master/test_db-master/├──changelog├──employees_partitioned_5.1. Sql├──employees_partitioned.sql├──employees.sql├──images│├──employees.gif│├──employees.jpg│└──employee S.png├──load_departments.dump├──load_dept_emp.dump├──load_dept_manager.dump├──load_employees.dump├──load_ salaries1.dump├──load_salaries2.dump├──load_salaries3.dump├──load_titles.dump├──objects.sql├──readme.md├── Sakila│├──readme.md│├──sakila-MV-Data.sql│└──sakila-MV-schema.sql├──show_elapsed.sql├──sql_test.SH├──test_employees_md5.sql└──test_employees_sha.sql
4. Import data into the database
Mysql-uroot-pxxxxxx-t < test_db-master/employees.sqlWarning:Using a password on the command line interface can is insecure.+-----------------------------+| INFO |+-----------------------------+| CREATING DATABASE STRUCTURE |+-----------------------------+ +------------------------+| INFO |+------------------------+| Storage Engine:innodb |+------------------------+ +---------------------+| INFO |+---------------------+| LOADING Departments |+---------------------+ +-------------------+| INFO |+-------------------+| LOADING Employees |+-------------------+ +------------------+| INFO |+------------------+| LOADING dept_emp |+------------------+ +----------------------+| INFO |+----------------------+| LOADING Dept_manager |+----------------------+ +----------------+| INFO |+----------------+| LOADING titles |+----------------+ +------------------+| INFO |+------------------+| LOADING Salaries |+------------------+ +---------------------+| Data_load_time_diff |+---------------------+| Null |+---------------------+
5. Summary
Complete the steps above your own employees library is good, its structure is as follows:
-----
MySQL Sample Database Employees detailed