sqlyog创建用于企业管理的员工管理数据库,数据库名为YGGL,包含员工的信息、部门信息及员工的薪水信息。数据库 YGGL包含以下3个表: (1) Employees:员工信息表; (2) Departments:部门信息表; (3) Salary:员工
时间: 2024-10-20 21:03:15 浏览: 32
Sure, SQLyog是一款强大的MySQL图形界面工具,它可以帮助企业管理和维护像YGGL这样的数据库。针对您的需求,我们可以创建这三个基本表格:
1. **Employees** 表格结构可能如下:
```sql
CREATE TABLE Employees (
EmpID INT PRIMARY KEY,
FirstName VARCHAR(50),
LastName VARCHAR(50),
DepartmentID INT,
HireDate DATE,
FOREIGN KEY (DepartmentID) REFERENCES Departments(DepartmentID)
);
```
2. **Departments** 表格结构:
```sql
CREATE TABLE Departments (
DepartmentID INT PRIMARY KEY,
DepartmentName VARCHAR(100),
ManagerID INT,
FOREIGN KEY (ManagerID) REFERENCES Employees(EmpID)
);
```
3. **Salary** 表格结构(假设薪水按月计算):
```sql
CREATE TABLE Salary (
EmpID INT,
Month DATE,
Salary DECIMAL(10, 2),
FOREIGN KEY (EmpID) REFERENCES Employees(EmpID),
PRIMARY KEY (EmpID, Month)
);
```
阅读全文