Professional Documents
Culture Documents
Select all the employees whose hire date is in the year 1981
Query 1:
Query 2:
from emp
from emp
where empno in (select distinct mgr from emp where comm >= 0)
from emp e
join dept d
ON e.deptno = d.deptno
from emp
group by job
6. Return the employees who has earned the lowest salary for each designation
emp a join
from emp
group by job) b
on a.sal = b.minsal
JOINS
from emp e
join dept d
on e.deptno = d.deptno
group by job
8. Within each dept, select the employee grade – highest or lowest salary
Else 0
END) as "RANK"
from emp e
join job_grade j
on e.sal between lowest_sal and highest_sal) g) h
group by deptno
from emp e
join dept d
on e.deptno = d.deptno) as C
group by C.dname;