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

[打卡]张士晨 子查询

2024-05-14 15:13:07
0
174

select salary,employee_id ,last_name
from employees
where salary>(
select salary
from employees
where employee_id=149);

SELECT last_name ,job_id,salary
from employees
where job_id=(
SELECT job_id
from employees
where employee_id=141)
and salary>(
select salary
from employees
WHERE employee_id=143);

select last_name,job_id,salary
from employees
where salary =(
SELECT min(salary)
from employees);

select employee_id,manager_id,department_id
from employees
where manager_id =(
SELECT manager_id
from employees
WHERE employee_id=141)
and department_id =(
SELECT department_id
from employees
WHERE employee_id=141)
and employee_id!=141;

select employee_id,manager_id,department_id
from employees
where(manager_id,department_id)=(
SELECT department_id,manager_id
from employees
WHERE employee_id=141)
and employee_id<>141;

select MIN(salary),department_id
from employees
GROUP BY department_id
having MIN(salary)>(
SELECT MIN(salary)
from employees
where department_id=110);

select employee_id,last_name
from employees
where salary = (
select MIN(salary)
from employees
GROUP BY department_id
);

评论
意见反馈