CREATE TABLE EmployeeInfo ( ID INT PRIMARY KEY, Name VARCHAR(50) NOT NULL, Gender VARCHAR(10) NOT NULL, Birthday DATE, Department VARCHAR(50), Position VARCHAR(50), HireDate DATE, Salary DECIMAL(10, 2), Phone VARCHAR(20), Email VARCHAR(50) ); CREATE TABLE SalaryInfo ( ID INT PRIMARY KEY, EmployeeID INT NOT NULL, Salary DECIMAL(10, 2) NOT NULL, StartDate DATE NOT NULL, EndDate DATE, FOREIGN KEY (EmployeeID) REFERENCES EmployeeInfo(ID) );INSERT INTO EmployeeInfo (ID, Name, Gender, Birthday, Department, Position, HireDate, Salary, Phone, Email) VALUES (1, '张三', '男', '1990-01-01', '销售部', '销售经理', '2015-01-01', 8000.00, '13811111111', 'zhangsan@company.com'), (2, '李四', '女', '1992-02-02', '人力资源部', '人事专员', '2018-06-01', 5000.00, '13922222222', 'lisi@company.com'), (3, '王五', '男', '1995-05-05', '技术部', '软件工程师', '2017-03-01', 10000.00, '13633333333', 'wangwu@company.com'), (4, '赵六', '女', '1993-04-04', '市场部', '市场主管', '2016-09-01', 7000.00, '13544444444', 'zhaoliu@company.com'), (5, '陈七', '男', '1997-07-07', '财务部', '会计', '2019-02-01', 6000.00, '13755555555', 'chenqi@company.com');
时间: 2024-01-11 17:02:14 浏览: 71
EmployeeInfo:存储员工信息
好的,以下是为您插入五条数据的 SQL 语句:
```
INSERT INTO EmployeeInfo (ID, Name, Gender, Birthday, Department, Position, HireDate, Salary, Phone, Email)
VALUES
(6, '刘八', '男', '1994-03-03', '技术部', '技术主管', '2018-01-01', 9000.00, '13866666666', 'liuba@company.com'),
(7, '周九', '女', '1996-06-06', '市场部', '市场专员', '2019-07-01', 5500.00, '13977777777', 'zhoujiu@company.com'),
(8, '钱十', '男', '1991-09-09', '财务部', '出纳', '2017-05-01', 6500.00, '13688888888', 'qianshi@company.com'),
(9, '孙十一', '女', '1998-12-12', '销售部', '销售代表', '2020-01-01', 4500.00, '13599999999', 'sunyiyi@company.com'),
(10, '吴十二', '男', '1999-11-11', '人力资源部', '人事主管', '2021-06-01', 8500.00, '13700000000', 'wushier@company.com');
INSERT INTO SalaryInfo (ID, EmployeeID, Salary, StartDate, EndDate)
VALUES
(6, 1, 8500.00, '2021-01-01', '2021-06-30'),
(7, 2, 6000.00, '2021-01-01', '2021-06-30'),
(8, 3, 12000.00, '2021-01-01', '2021-06-30'),
(9, 4, 8000.00, '2021-01-01', '2021-06-30'),
(10, 5, 7000.00, '2021-01-01', '2021-06-30');
```
这将向 `EmployeeInfo` 表中插入五条员工信息记录,同时向 `SalaryInfo` 表中插入五条薪资信息记录。
阅读全文