高级资深攻城狮
高级资深攻城狮
全部文章
分类
题解(90)
归档
标签
去牛客网
登录
/
注册
高级资深攻城狮的博客
全部文章
(共82篇)
题解 | #统计出当前各个title类型对应的员工当前薪水对应的平均工资#
select last_name,first_name,dept_name from employees e LEFT JOIN dept_emp d on e.emp_no=d.emp_no LEFT join departments dp on d.dept_no=dp.dept_no三个表进...
Mysql
2021-09-18
0
223
题解 | #统计出当前各个title类型对应的员工当前薪水对应的平均工资#
通过测试,代码如下select salaries.emp_no,salaries.salary,employees.last_name,employees.first_name from salaries,employees where salary in (select max(salary...
Mysql
2021-09-17
0
280
题解 | #统计出当前各个title类型对应的员工当前薪水对应的平均工资#
select emp_no,salary from (select emp_no,salary from salaries order by salary DESC limit 2) as a ORDER by salary LIMIT 1这道题的关键是起别名,我的解题思路为:先查出结果降序排...
Mysql
2021-09-16
0
157
题解 | #统计出当前各个title类型对应的员工当前薪水对应的平均工资#
select title,AVG(salary)as 'avg' from titles, salaries where titles.emp_no = salaries.emp_no group by(title) order by 'avg' ASC需要善用函数,理清思路
Mysql
2021-09-16
0
154
题解 | #查找薪水记录超过15次的员工号emp_no以及其对应的记录次数t#
select dept_emp.dept_no, dept_emp.emp_no, MAX(salaries.salary)from dept_emp,salarieswhere dept_emp.emp_no=salaries.emp_no group ...
Sqlite
2021-09-16
1
284
题解 | #查找薪水记录超过15次的员工号emp_no以及其对应的记录次数t#
select dept_emp.emp_no,dept_manager.emp_no from dept_emp,dept_manager where (dept_emp.dept_no= dept_manager.dept_no) and dept_emp.emp_no not in (selec...
Sqlite
2021-09-16
1
189
题解 | #查找薪水记录超过15次的员工号emp_no以及其对应的记录次数t#
SELECT emp_no,count(emp_no) as t FROM salaries GROUP by emp_no having t >15 先使用select查出领导的emp_no,再使用not in select出不在领导范围内的emp_no
Sqlite
2021-09-16
0
225
题解 | #查找薪水记录超过15次的员工号emp_no以及其对应的记录次数t#
SELECT emp_no,count(emp_no) as t FROM salaries GROUP by emp_no having t >15 查询出现15次的员工,先按“emp_no”来分组,然后使用count函数来统计次数
Sqlite
2021-09-16
1
199
题解 | #查找最晚入职员工的所有信息#
selectemployees.last_name,employees.first_name,dept_emp.dept_nofrom employees left join dept_emp on employees.emp_no=dept_emp.emp_no本题使用了left join连接,...
2021-09-13
1
209
题解 | #查找最晚入职员工的所有信息#
selectemployees.last_name,employees.first_name,dept_emp.dept_nofrom employees,dept_emp where employees.emp_no=dept_emp.emp_no;以上为解题答案。
2021-09-13
1
225
首页
上一页
1
2
3
4
5
6
7
8
9
下一页
末页