DBMS Assignment 4
DBMS Assignment 4
6) select E.*
from Employees E
where E.salary = (select max(salary) from Employees M where
M.department_id=E.department_id);
9) select E.*
from Employees E
where E.salary = (select max(salary) from Employees M where
M.department_id=E.department_id);
For eg.
select empno , Ename,sal ,rank() over (order by sal) from emp ;
Dense rank ()
It is an aggregate function which works on similar lines of rank () how ever it calculates the
value of rank in an ordered way and assigns consecutive ranks.
For Eg.
For Eg.
select empno , Ename,sal ,lead(sal,1,0)over(order by sal) from emp ;
Lag ()
It is an analytical function which is used to access data from the previous row to perform
computations