Assignment 5
Assignment 5
select 'Mr.' ||ename|| '''s total salary is'||(sal + nvl (comm,0)) "TOTAL
EARNING " from emp;
4) Display the name and increased salary (20% increases) of each manager.
select ename , sal * 1.2 "Incresed Sal" from emp where job =
'MANAGER';
6) Display min and max salaries among all employees and rename the fields
accordingly.
select min(sal) "MINIMUM SALARY", max(sal) "MAXIMUM
SALARY" from emp;
7) Display details of all employees along with their dept name in the
ascending order of hiredate.
Select emp.*,dept.dname from emp,dept Where emp.deptno=dept.deptno
Order by hiredate;
8) Display min, max, average and total salaries of each dept in ascending
order of deptname.
select dname,min(sal),max(sal),avg(sal) from emp , dept where
emp.deptno=dept.deptno group by dname order by dname ;
10) Display emp name whose salary is higher than the average salary of
all the employees having 5 letters in their name.
select ename from emp where sal > (select avg(sal) from emp where
Length(ename) = 5);
select * from emp where deptno in (select deptno from dept where dname
='&danme' and dname in ('HRD', 'SALES'));
15) Display each employee’s name and their corresponding manager’s name.
select ename from emp where sal =(select max(sal) from emp);