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.
SQL Query
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Sanjeeb LenkaRank #301 · 8.3K reputationPosted Aug 16, 2013, 8:45 PM EDT
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 Sanyal191 reputationPosted Aug 17, 2013, 1:44 AM EDT