fejxc
fejxc
全部文章
题解
归档
标签
去牛客网
登录
/
注册
fejxc的博客
全部文章
/ 题解
(共47篇)
题解 | #获取所有员工当前的manager#
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<>dept_ma...
Mysql
2021-09-20
1
256
题解 | #获取所有非manager的员工emp_no#
not exists 的使用 select employees.emp_no from employees where not EXISTS(select 1 from dept_manager where dept_manager.emp_no=employees.emp_no)
Mysql
2021-09-20
1
290
题解 | #查找薪水记录超过15次的员工号emp_no以及其对应的记录次数t#
考察group by 和 having 搭配使用 默认的情况下 where后的过滤条件优先与Having select emp_no,count(*) salary from salaries GROUP by emp_no having count(*)>15
Mysql
2021-09-20
1
276
题解 | #查找所有员工的last_name和first_name以及对应部门编号dept_no#
考察 left join 左连接 取左表全部内容,右表只取匹配到的内容,结果集没匹配上的B表数据值取NULL select employees.last_name,employees.first_name,dept_emp.dept_no from employees left join dept...
Mysql
2021-09-20
1
296
题解 | #查找所有已经分配部门的员工的last_name和first_name以及dept_no#
select employees.last_name,employees.first_name,dept_emp.dept_no from employees,dept_emp where employees.emp_no=dept_emp.emp_no
Mysql
2021-09-20
1
322
题解 | #查找当前薪水详情以及部门编号dept_no#
考查两表关联 select s.* ,m.dept_no FROM dept_manager m,salaries s where s.emp_no=m.emp_no order by s.emp_no
Mysql
2021-09-20
1
248
题解 | #查找入职员工时间排名倒数第三的员工所有信息#
考察limit offset 搭配使用 使用desc降序排序不能排序同一天有只有一个员工入职,可用distinc去重 select * from employees WHERE hire_date=( select DISTINCT hire_date from employees ...
Mysql
2021-09-20
1
269
首页
上一页
1
2
3
4
5
下一页
末页