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成神之路。
共有 0 条评论