unzip test_db-master.zip
cd test_db-master
mysql -u root -p*** -t < employees.sql
mysql -u root -p*** -t < employees_partitioned.sql
测试安装的数据
mysql -u root -p*** -t < test_employees_md5.sql
mysql> show tables;
±---------------------+
| Tables_in_employees |
±---------------------+
| current_dept_emp | # 当前部门人数
| departments | # 部门
| dept_emp | # 部门总人数
| dept_emp_latest_date | # 最新的入离职信息
| dept_manager | # 部门经理
| employees | # 职员
| salaries | # 薪水
| titles | # 职称
±---------------------+
sql语句回顾
select database(); # 查看当前所在库
select user(); # 查看当前用户
select now(); # 查看当前时间
DESC table_name; # 查看表结构
show create table table_name # 查看表的创建信息
status # 查看当前数据库信息
show full processlist; # 查看当前所有正在执行的sql语句
show processlist; # 查看当前正在执行的sql语句前100条
avg() # 求平均值
count() # 求记录总数
distinct() # 去重