Auto commit
This commit is contained in:
parent
077f0330f5
commit
5d16a365de
@ -376,6 +376,21 @@ CALL get_employee_details(1);
|
||||
|
||||
创建一个存储过程 `get_department_max_salary`,接受部门ID作为参数,返回该部门的最高工资。
|
||||
|
||||
```sql
|
||||
DELIMITER $$
|
||||
DROP PROCEDURE IF EXISTS get_department_max_salary;
|
||||
CREATE PROCEDURE get_department_max_salary(IN id INT)
|
||||
BEGIN
|
||||
SELECT MAX(e.salary)
|
||||
FROM employee e
|
||||
WHERE e.dept_id = id;
|
||||
END $$
|
||||
DELIMITER ;
|
||||
CALL get_department_max_salary(1);
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### 练习题 14: 查询职位最低工资
|
||||
|
||||
创建一个存储过程 `get_job_min_salary`,接受职位ID作为参数,返回该职位的最低工资。
|
||||
|
Loading…
x
Reference in New Issue
Block a user