想做一个查询性能测试,需要在有部分数据源的情况下,直接在mysql数据库中只运用sql语句(不借用php等工具)一次性循环插入上千条数据。创建表结构如下:
CREATE database 查询性能;
CREATE TABLE Employees
( EmployeeID char(6) NOT NULL PRIMARY KEY,
Name char(10) NOT NULL,
Birthday date NOT NULL,
PhoneNumber char(12) NULL,
DepartmentID char(3) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
部分数据源为:
('000001','王林','1966-01-23','83335668','2'),
('010008','伍容华','1976-03-28','83323321','1'),
('020010','王向荣','1982-12-09','83792361','1')。
insert into Employees values
('000001','王林','1966-01-23','83335668','2'),
('010008','伍容华','1976-03-28','83323321','1'),
('020010','王向荣','1982-12-09','83792361','1');
insert into Employees values
('000001','王林','1966-01-23','83335668','2'),
('010008','伍容华','1976-03-28','83323321','1'),
('020010','王向荣','1982-12-09','83792361','1');
余下的任务就是使用ultraedit之类的编辑器生成后边的列表,让其达到上千条了。