Loading sample data
MySQL has provided a sample employee database and a lot of data to play around with.
Load the data:
git clone https://github.com/datacharmer/test_db.git
cd test_db/
mysql -u root -p < employees.sql
Enter password:
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
00:01:23
Verify the data:
mysql -u root -p employees -A
SHOW TABLES;
+----------------------+
| Tables_in_employees |
+----------------------+
| current_dept_emp |
| departments |
| dept_emp |
| dept_emp_latest_date |
| dept_manager |
| employees |
| salaries |
| titles |
+----------------------+
8 rows in set (0.00 sec)
DESC employees\G
*************************** 1. row ***************************
Field: emp_no
Type: int(11)
Null: NO
Key: PRI
Default: NULL
Extra:
*************************** 2. row ***************************
Field: birth_date
Type: date
Null: NO
Key:
Default: NULL
Extra:
*************************** 3. row ***************************
Field: first_name
Type: varchar(14)
Null: NO
Key:
Default: NULL
Extra:
*************************** 4. row ***************************
Field: last_name
Type: varchar(16)
Null: NO
Key:
Default: NULL
Extra:
*************************** 5. row ***************************
Field: gender
Type: enum('M','F')
Null: NO
Key:
Default: NULL
Extra:
*************************** 6. row ***************************
Field: hire_date
Type: date
Null: NO
Key:
Default: NULL
Extra:
6 rows in set (0.00 sec)