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) ); CREATE TABLE AttendanceInfo ( ID INT PRIMARY KEY, EmployeeID INT NOT NULL, AttendanceDate DATE NOT NULL, SignTime DATETIME, LeaveTime DATETIME, FOREIGN KEY (EmployeeID) REFERENCES EmployeeInfo(ID) ); CREATE TABLE WelfareInfo ( ID INT PRIMARY KEY, EmployeeID INT NOT NULL, WelfareType VARCHAR(50) NOT NULL, WelfareAmount DECIMAL(10, 2) NOT NULL, WelfareDate DATE NOT NULL, FOREIGN KEY (EmployeeID) REFERENCES EmployeeInfo(ID) ); CREATE TABLE DepartmentInfo ( ID INT PRIMARY KEY, DepartmentName VARCHAR(50) NOT NULL, ManagerID INT, Description VARCHAR(200) );
时间: 2024-04-28 16:27:00 浏览: 52
create table
5星 · 资源好评率100%
好的,以下是向AttendanceInfo表插入五条内容的SQL语句示例:
INSERT INTO AttendanceInfo(ID, EmployeeID, AttendanceDate, SignTime, LeaveTime) VALUES (1, 1001, '2021-07-01', '2021-07-01 09:00:00', '2021-07-01 18:00:00');
INSERT INTO AttendanceInfo(ID, EmployeeID, AttendanceDate, SignTime, LeaveTime) VALUES (2, 1001, '2021-07-02', '2021-07-02 09:10:00', '2021-07-02 18:00:00');
INSERT INTO AttendanceInfo(ID, EmployeeID, AttendanceDate, SignTime, LeaveTime) VALUES (3, 1002, '2021-07-01', '2021-07-01 09:05:00', '2021-07-01 18:30:00');
INSERT INTO AttendanceInfo(ID, EmployeeID, AttendanceDate, SignTime, LeaveTime) VALUES (4, 1002, '2021-07-02', '2021-07-02 09:20:00', '2021-07-02 18:20:00');
INSERT INTO AttendanceInfo(ID, EmployeeID, AttendanceDate, SignTime, LeaveTime) VALUES (5, 1003, '2021-07-01', '2021-07-01 09:15:00', '2021-07-01 18:15:00');
注意,在实际插入数据时,你需要根据自己的表结构和具体需要进行调整和修改。
阅读全文