题目描述
查找所有员工入职时候的薪水情况,给出emp_no以及salary, 并按照emp_no进行逆序CREATE TABLE `employees` (`emp_no` int(11) NOT NULL,`birth_date` date NOT NULL,`first_name` varchar(14) NOT NULL,...
问题描述
查找薪水变动超过15次的员工号emp_no以及其对应的变动次数t
CREATE TABLE `salaries` (
`emp_no` int(11) NOT NULL,
`salary` int(11) NOT NULL,
`from_date` date NOT NULL,
`to_...
题目
解答
自写代码:
select d.dept_no, d.emp_no, s.salary
from dept_emp as d
inner join salaries as s
on d.emp_no=s.emp_no
where d.to_date='9999-01-01’
and s.to_date=...
[leetcode] 176.second highest salary 第二高薪水
write a sql query to get the second highest salary from the employee table.
+----+--------+
| id | salary |
+----+--------+
| 1 | 10...
[leetcode] 177.nth highest salary 第n高薪水
write a sql query to get the nth highest salary from the employee table.
+----+--------+
| id | salary |
+----+--------+
| 1 |...
[leetcode] 185.department top three salaries 系里前三高薪水
the employee table holds all employees. every employee has an id, and there is also a column for the department id.
+----+----...
[leetcode] 184.department highest salary 系里最高薪水
the employee table holds all employees. every employee has an id, a salary, and there is also a column for the department id.
+----+-------+--...