SQL语句创建部门表department(deplD,depName,depL eader)和员工信息表emplo-yee(empID,empName,depID,jobID,salary,hireDate)
时间: 2024-05-26 10:10:44 浏览: 201
可以的,以下是创建部门表和员工信息表的 SQL 语句:
创建部门表 department:
CREATE TABLE department (
deptID INT PRIMARY KEY,
deptName VARCHAR(50) NOT NULL,
deptLeader VARCHAR(50) NOT NULL
);
创建员工信息表 employee:
CREATE TABLE employee (
empID INT PRIMARY KEY,
empName VARCHAR(50) NOT NULL,
deptID INT NOT NULL,
jobID INT NOT NULL,
salary FLOAT NOT NULL,
hireDate DATE NOT NULL,
FOREIGN KEY (deptID) REFERENCES department(deptID)
);
阅读全文