EMPLOYEE(EMPNO,EMPNAME,JOB,DEPTNO,SALARY,COMM)
DEPTT(DEPTNO,DPTNAME,LOCATION)
SALGRADE(MINSAL,MAXSAL,GRADE)
1)Display all different job types
2)List names and jobs of all clerks in department 12
3)Show EMONAME and total remuneration of all employees
4)Calculate and show minimum salary for each different job.
5)Find all departments which have more than 5 empoyees
6)Find the employees who earn the lowest salary in their department.
Loading

Sanjeeb LenkaPosted Aug 17, 2013, 12:45 AM
select distinct job from employee
select Empname,job from Employee where Deptno=12 and job='clerk'
select Empname,(salary+isnull(comm,0)) as total_remuneration from employee
select job,min(salary) salary from employee group by job
SELECT D.DptName FROM
DEPTT D WHERE (SELECT COUNT(*)
FROM Employee E
WHERE E.Deptno = D.Deptno) > 5
select e.empname,d.deptno, e.salary
from employee e
inner join
(select deptno,min(salary) salary from employee group by deptno)d
on e.deptno = d.deptno and e.salary= d.salary
Nilesh SanyalPosted Aug 17, 2013, 5:44 AM