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