MySQL Sample Database Employees detailed

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.