数据库SQL实战 —— 查找员工编号emp_no为10001其自入职以来的薪水salary涨幅值growth

版权声明:最终解释权归属Hern所有,恒! https://blog.csdn.net/qq_36761831/article/details/83211376

时间限制:1秒 空间限制:32768K 

题目描述

查找员工编号emp_no为10001其自入职以来的薪水salary涨幅值growth
CREATE TABLE `salaries` (
`emp_no` int(11) NOT NULL,
`salary` int(11) NOT NULL,
`from_date` date NOT NULL,
`to_date` date NOT NULL,
PRIMARY KEY (`emp_no`,`from_date`));

输入描述:

输出描述:

growth
28841

输入

输出

我的代码

运行时间:18ms    占用内存:3432k

SELECT (MAX(salary) - MIN(salary)) AS growth
FROM salaries
WHERE emp_no = 10001;

猜你喜欢

转载自blog.csdn.net/qq_36761831/article/details/83211376
今日推荐