MySQL配置test_db数据库

本文档介绍了如何配置和加载MySQL的employees测试数据库,该数据库包含约30万员工记录和280万薪资条目。数据由Fusheng Wang和Carlo Zaniolo在Siemens Corporate Research创建,Giuseppe Maxima制作关系模式,Patrick Crews导出为关系格式。数据中存在不一致性和问题,被保留下来作为数据清理练习。通过执行SQL脚本完成数据库结构创建和数据加载,验证结果显示数据库和表已成功创建。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

说明

employees是mysql官方提供的测试数据库,具体介绍如下:

The original data was created by Fusheng Wang and Carlo Zaniolo at Siemens Corporate Research. The data is in XML format. http://timecenter.cs.aau.dk/software.htm

Giuseppe Maxia made the relational schema and Patrick Crews exported the data in relational format.

The database contains about 300,000 employee records with 2.8 million salary entries. The export data is 167 MB, which is not huge, but heavy enough to be non-trivial for testing.

The data was generated, and as such there are inconsistencies and subtle problems. Rather than removing them, we decided to leave the contents untouched, and use these issues as data cleaning exercises.

具体地址:

https://dev.mysql.com/doc/index-other.html

git地址:项目名称为test_db
https://github.com/datacharmer/test_db

配置employees数据库

mysql -u root -pXXXXXXX <  /Users/software/workspace/mysql/test_db/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
00:00:53

验证

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| employees          |
| information_schema |
| mysql              |
| nwti               |
| performance_schema |
| pySpiderDianPing   |
| sys                |
+--------------------+
7 rows in set (0.00 sec)

mysql> use employees ;
Database changed
mysql> 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)

这下就可以可劲儿的造了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值