不穿胖次的羊
不穿胖次的羊
全部文章
分类
归档
标签
去牛客网
登录
/
注册
不穿胖次的羊的博客
全部文章
(共33篇)
题解 | #获取所有非manager员工当前的薪水情况#
select c.dept_no,a.emp_no,d.salary from employees a left join dept_emp b on a.emp_no = b.emp_no left join dept_manager c on b.dept_no = c.dept_no...
2024-01-16
0
152
题解 | #对所有员工的薪水按照salary降序进行1-N#
select emp_no,salary,dense_rank() over(order by salary desc) t_rank from salaries 按要求窗口函数排一下就行
2024-01-16
0
134
题解 | #统计各个部门的工资记录数#
select a.dept_no,a.dept_name,count(1) as 'sum' from departments a left join dept_emp b on a.dept_no = b.dept_no left join salaries c on b.emp_no = ...
2024-01-14
0
162
题解 | #查找在职员工自入职以来的薪水涨幅情况#
select d.emp_no,(d.salary-c.salary) growth from (#1.首先查询出每个员工刚入职的薪水 select a.emp_no,salary from salaries a join employees b on a.emp_no = b.emp_no a...
2024-01-14
0
192
题解 | #查找所有员工的last_name#
select last_name,first_name,dept_name from employees a left join dept_emp b on a.emp_no = b.emp_no left join departments c on b.dept_no = c.dept_no...
2024-01-14
0
170
题解 | #获取当前薪水第二多的员工的emp_no#
select a.emp_no,salary,last_name,first_name from salaries a left join employees b on a.emp_no = b.emp_no where salary = ( select max(salary) from ...
2024-01-14
0
159
题解 | #获取当前薪水第二多的员工的emp_no以及#
select emp_no,salary from ( select *,dense_rank() over(order by salary desc) rk from salaries ) a where rk = 2 没什么好说的,可以扩展一下题目,比如:emp_no salary1...
2024-01-13
0
108
题解 | #统计出当前各个title类型对应的员工当前薪水#
select a.title title,avg(salary) from titles a left join salaries b on a.emp_no = b.emp_no group by a.title order by avg(salary) 吐槽一下,展示表格给的字段名称,然后才...
2024-01-13
0
125
题解 | #查找employees表emp_no与last#
select * from employees where emp_no %2 !=0 and last_name != 'Mary' order by hire_date desc 没什么说的,按要求筛选就行
2024-01-11
0
144
题解 | #获取每个部门中当前员工薪水最高的相关信息#
select dept_no,emp_no,salary from ( select a.dept_no,a.emp_no,b.salary,dense_rank() over(partition by dept_no order by salary desc) dnrk from dept_em...
2024-01-11
0
196
首页
上一页
1
2
3
4
下一页
末页