Loading sample data
You have created the schema (databases and tables) and some data (through INSERT
, UPDATE
, and DELETE
). To explain the further chapters, more data is needed. MySQL has provided a sample employee
database and a lot of data to play around with. In this chapter, we will discuss how to get that data and store it in our database.
How to do it...
- Download the zipped file:
shell> wget 'https://codeload.github.com/datacharmer/test_db/zip/master'-O master.zip
- Unzip the file:
shell> unzip master.zip
- Load the data:
shell> cd test_db-master
shell> mysql -u root -p < employees.sql
mysql: [Warning] Using a password on the command line interface can be 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
- Verify the data:
shell> mysql -u root -p employees -A mysql: [Warning] Using a password on the...