Monday 16 January 2017

Questions on group by clause

  1. Display the deptno which is having the maximum salary and maximum salary more than 1500 earned by the employee and job description not as a clerk and sort by descending order
  2. Display the deptno which is having the maximum salary and maximum salary more than 1500 earned by the employee and job description not as a clerk and sort by descending order
  3. List the number of employee in each department, except 30, sorted high to low. Only include department with 3 or more employee.
  4. Sql query to find second highest salary of employee
  5. Display the number of employees who has annual salary more than 10000 department-wise
  6. Display the max salary for each of the job excluding all the employee whose having commission.
  7. Find the total salary department number wise where more than two employees exits?
  8. Display job wise and department wise least salary only if the least salary is less than 3000 in department 10,30?
  9. list all the employees except those who are working in Dept 30 and 20?
  10. Display the department number which are having more than 200 as their commission along with employees whose name having 'A' is one of character.
  11. Display department number and total salary whose average salary is greater than 500 for each department.
  12. Display Job wise salary of the employees b/w 2000 & 5000 excluding dept no 30 .
  13. display job wise employee names which consist of 5 characters and job designation should be neither salesman nor analyst
  14. Display the department number along with the number of employees and also employee name?
  15. Display department wise maximum and minimum salary of all salesman.
  16. Write a query to display number of employees having Commission in Dept 30?
  17. Display number of employee, total salary paid to employee work in each department?
  18. Display job wise with a no of employees whose salary is greater than 2000.
  19. Display maximum salary, minimum salary, average salary of each department
  20. Display number of employees department wise who are having sal greater than 2000 & working as manager.
  21. display department wise, number of manager.
  22. Display minimum salary for each of the job whose name starts wit s
  23. display the Department names along with the number of employees in it
  24. Display job wise highest hire date if the hire date is greater than 02 Apr 81 from the employee table
  25. Display the department number which are having less than 2 employees in them
  26. Display the department number which is having clerk in it & having salary more than 1500.
  27. Write the query to get the department and department wise total(sum) salary, display it in descending order according to salary.
  28. Write the query to get the department and department wise total(sum) salary, display it in descending order according to salary.
  29. Write the query to get the department and department wise total(sum) salary, display it in descending order according to salary.
  30. Display branch wise students wherein each branch number of students should not exceed more that 180 and average percentage of each branch should be at least more than 55.
  31. Display branch wise students wherein each branch number of students should not exceed more that 180 and average percentage of each branch should be at least more than 55.
  32. List job with average salary between 1000 and 2000.
  33. Write the query to get the department and department wise total salary from employee details table
  34. Display the number of employees department-wise, whose job has character R in it
  35. Display hiredate wise the employee working as clerk in department 20 &30 having salary more than 1000
  36. Department wise average salary from employee table order by salary ascending ?
  37. Display the department numbers along with employee names having salary greater than or equal to 1500?
  38. list all the salesman in Dept number 20 and having salary greater than 950?
  39. Display the deptno. Which is having more than 1 reporting manager.
  40. Display year wise joining date along with department number and job.
  41. Display each employee of annual salary and excluding ename start with 's'
  42. Display student. Name who are having more than 60 percent?
  43. Display job wise total salary.
  44. display jobwise max salary except Analyst,president?
  45. Write the query to get the department, total number of departments, total salary with respect to department from employee table?
  46. Display total salary to distribute job wise in the year 81.
  47. Display the number of employees jobwise and are having reporting manager
  48. Display job wise hiredate in descending order for those who receive commission.
  49. display min salary for each of the job for employee name whose name starting with A.
  50. Display Department wise number of salesman
  51. Display the Department numbers which are havung more than 2 employees in them
  52. Display the Dept numbers along with the number of employees and reporting managers in it
  53. Display all the minimum salary for each of the job including all the employees whole name ends with 'S'
  54. Display the department number in which employees names having a string man,and having salary more than 1000
  55. Display the deptno which is having more then 3 salesman in it.
  56. Display the deptno which is having more then 3 salesman in it.
  57. Display the deptno which is having more then 3 salesman in it.
  58. Display deptno, job,employee name and having a salary greater than 2000 and having the total salary in each dept and excluding deptno 20 and sort it by descending order
  59. Display deptno, job,employee name and having a salary greater than 2000 and having the total salary in each dept and excluding deptno 20 and sort it by descending order
  60. Query to find Max Salary from each MGR.
  61. Write the query to get department and department wise total salary display it in ascending order according to salary
  62. Write a query to display the number of managers department-wise
  63. Display job wise total salary who is working as clerk or manager having SALARY more than 1500 without commission
  64. Display the department , no of employee in a department , total salary with respect to a department from employee table order by total salary descending ?
  65. Write a query to display department wise number of manager?
  66. 3.list all the employees who's name is having at least 2 A's in it?
  67. Display job,deptno. Having more employees in a year 81.
  68. Display month wise joining date along with reporting manager and salesman.
  69. Display job wise least salary along with there MGR Name.
  70. display deptno,along with their job designation consist of a string 'ER'
  71. Display student name who are having more than 4 letters in the sname?
  72. Display the minimum salary of the employees for each department with having 5 characters in employee name and the third alphabet is ‘A’.
  73. display min salary of employees whose job in salesman,clerk?
  74. Write down the query to fetch department name assign to more than one employee ?
  75. List the no of employee in each department where the number is more than 3.
  76. Display the number of employees department wise then jobwise and salary more than 1000
  77. Display the deptno for those who have MGR 7839 and name end with s.
  78. display department wise,having more than 2 salesman.
  79. Display the Department number which are having less than 5000 as their departmental total salary
  80. Display the minimum Salary for each of the job excluding all the employees whose name ends with K
  81. Display the highest hire date for each job excluding all the employees whose name ends with 'N'.
  82. Display job-wise highest salary only if the highest salary is more than 2000
  83. Display dept no which are contains more then 2 emp in them
  84. Display dept no which are contains more then 2 emp in them
  85. Display dept no which are contains more then 2 emp in them
  86. Display employee name job wise whose having commission greater than 250 and having a reporting manager whose number starts with 76
  87. Display employee name job wise whose having commission greater than 250 and having a reporting manager whose number starts with 76
  88. find number of employees whose hiredate is between 01-jan-80 to 31-dec-82
  89. Write the query to get the department and department wise total salary display it in descending from employee detail table
  90. Write a query to display number of employees department-wise whose job end with T
  91. Display job wise highest salary only is the highest salary is more than 2000 excluding deptno 20 sort the data based on highest salary in ascending order.
  92. Display no of employee in each job and display all the employees whose reporting manager has end with '8' no in it .
  93. Display the department number which is having more than 1 salesman in it?
  94. list all the employees who are not earning salary by the range 1250 and 4000?
  95. Display jobwise lowest salary of 1000excluding dept 10.sort the data based on their lowest salary in the ascending order.
  96. Display job wise and employee name whose having reporting manager and having salary range from 1000 to 2500.
  97. Display Department numbers which are having salary more than 2000 except manager.
  98. display job wise whose joining date is oldest and newest and whose getting some commission
  99. display department wise number of 'MANAGERs'?
  100. Display the branch wise percentages of the students scored more than 85 and the branch would be having less than 200 students.
  101. display deptwise number of salesman except dept 20?
  102. Display all the department where department has 3 employee?
  103. Display department no and max salary for each department.
  104. Display number of employees whose name starts with S or A jobwise and are having more than or equal to 3 employees
  105. Display deptno who has man string in there job having deptno 30.
  106. display department wise ,for those department having sal less than 5000.
  107. Display Department wise number of president
  108. Display the Department numbers which are having more thab 5000 as their departmental total salry
  109. Display Dept wise number of employees who get a commission of more than 500
  110. Display the department numbers which are having lesser than 5000 as the department total salary
  111.  
  112.