MYSQL多表查询面试题三

1.显示所有员工的姓名,部门号和部门名称
SELECT e.last_name,e.department_id,dep.department_name
FROM employees e LEFT JOIN departments dep
ON e.department_id =dep.department_id;

2.查询90号部门员工的job_id和90号部门的location_id
DESC locations; #查看表的组成

DESC departments;

SELECT e.job_id,d.location_id
FROM employees e JOIN departments d
ON e.department_id = d.department_id
WHERE d.department_id=90;

3.选择所有有奖金的员工的last_name,department_name

MYSQL多表查询面试题三最先出现在Python成神之路

版权声明:
作者:Alex
链接:https://www.techfm.club/p/27571.html
来源:TechFM
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>