首页 小组 文章 相册 留言本 用户 搜索 我的社区 在线学堂 商城 购物车 支付钱包

c 多表查询

2024-04-10 15:17:25
0
148

DESC employees;
DESC departments;
DESC locations;

SELECT employee_id,last_name,department_name,city
FROM employees e, departments d,locations l
WHERE e.department_id=d.department_id
AND d.location_id=l.location_id;

SELECT * FROM job_grades;

SELECT e.last_name,e.salary,j.grade_level
FROM employees e,job_grades j
WHERE e.salary BETWEEN j.lowest_sal
AND j.highest_sal
ORDER BY salary;

SELECT e.last_name,e.salary,j.grade_level
FROM employees e,job_grades j
WHERE e.salary >= j.lowest_sal
AND e.salary<=j.highest_sal
ORDER BY salary;

SELECT * FROM employees;

SELECT e.employee_id,e.last_name,m.employee_id,m.last_name manager_name
FROM employees e,employees m
WHERE e.manager_id=m.employee_id;

评论
意见反馈