Examples

  1. Display the dept information from department table
  2. Display the details of all employees
  3. Display the name and job for all employees
  4. Display name and salary for all employees
  5. Display employee number and total salary for each employee
  6. Display employee name and annual salary for all employees
  7. Display the names of all employees who are working in department number 10
  8. Display the names of all employees working as clerks and drawing a salary more than 3000
  9. Display employee number and names for employees who earn commission
  10. Display names of employees who do not earn any commission
  11. Display the names of employees who are working as clerk, salesman or analyst and drawing a salary more than 3000
  12. Display the names of employees who are working in the company for the past 5 years
  13. Display the list of employees who have joined the company before 30th June 90 or after 31st Dec 90
  14. Display current date
  15. Display the list of users in your database (using log table)
  16. Display the names of all tables from the current user
  17. Display the name of the current user
  18. Display the names of employees working in department number 10 or 20 or 40 or employees working as clerks, salesman or analyst
  19. Display the names of employees whose name starts with alphabet S
  20. Display employee name from employees whose name ends with alphabet S
  21. Display the names of employees whose names have second alphabet A in their names
  22. Display the names of employees whose name is exactly five characters in length
  23. Display the names of employees who are not working as managers
  24. Display the names of employees who are not working as SALESMAN or CLERK or ANALYST
  25. Display all rows from emp table. The system should wait after every screen full of information
  26. Display the total number of employees working in the company
  27. Display the total salary and total commission to all employees
  28. Display the maximum salary from emp table
  29. Display the minimum salary from emp table
  30. Display the average salary from emp table
  31. Display the maximum salary being paid to CLERK
  32. Display the maximum salary being paid in dept no 20
  33. Display the minimum salary being paid to any SALESMAN
  34. Display the average salary drawn by managers
  35. Display the total salary drawn by analyst working in dept no 40
  36. Display the names of employees in order of salary i.e. the name of the employee earning lowest salary should appear first
  37. Display the names of employees in descending order of salary
  38. Display the details from emp table in order of emp name
  39. Display empnno,ename,deptno and sal. Sort the output first based on name and within name by deptno and witdhin deptno by sal;
  40.   Display the name of employees along with their annual salary (sal*12).The name of the employee earning highest annual salary should appear first?
  41.  Display name,salary,Hra,pf,da,TotalSalary for each employee.The output should be in the order of total salary ,hra 15% of salary ,DA 10% of salary .pf 5% salary Total Salary will be (salary+hra+da)-pf?
  42. Display Department numbers and total number of employees working in each Department?
  43. Display the various jobs and total number of employees working in each job group?
  44. Display department numbers and Total Salary for each Department?
  45. Display department numbers and Maximum Salary from each Department?
  46. Display various jobs and Total Salary for each job?
  47. Display each job along with min of salary being paid in each job group?
  48. Display the department Number with more than three employees in each department?
  49. Display various jobs along with total salary for each of the job where total salary is greater than 40000?
  50. Display the various jobs along with total number of employees in each job. The output should contain only those jobs with more than three employees?
  51. Display the name of employees who earn Highest Salary?
  52. Display the employee Number and name for employee working as clerk and earning highest salary among the clerks?
  53. Display the names of salesman who earns a salary more than the Highest Salary of the clerk?
  54. Display the names of clerks who earn a salary more than the lowest Salary of any salesman?
  55. Display the names of employees who earn a salary more than that of jones or that of salary greater than that of Scott?
  56. Display the names of employees who earn highest salary in their respective Departments?
  57. Display the names of employees who earn Highest salaries in their respective job Groups?
  58. Display employee names who are working in accounting department?
  59. Display the employee names who are working in Chicago?
  60. Display the job groups having Total Salary greater than the maximum salary for Managers?
  61. Display the names of employees from department number 10 with salary greater than that of ANY employee working in other departments?
  62. Display the names of employees from department number 10 with salary greater than that of ALL employee working in other departments?
  63. Display the names of employees in Upper Case?
  64. Display the names of employees in Lower Case?
  65. Display the names of employees in Proper case?
  66. Find the length of your name using Appropriate Function?
  67. Display the length of all the employee names?
  68. Display the name of employee Concatenate with Employee Number?
  69. Use appropriate function and extract 3 characters starting from 2 characters from the following string ‘Oracle’ i.e., the output should be ac?
  70. find the first occurrence of character ‘a’ from the following string Computer Maintenance Corporation?
  71. replace every occurrence of alphabet A with B in the string .Aliens (Use Translate function)?
  72. Display the information from the employee table. Where ever job Manager is found it should be displayed as Boss?
  73. Display empno,ename,deptno from tvsemp table. Instead of display department numbers display the related department name (Use decode function)?
  74. Display your Age in Days?
  75. Display your Age in Months?
  76. Display current date as 15th August Friday Nineteen Ninety Seven?
  77. Display the following output for each row from tvsemp table?
  78. Scott has joined the company on 13th August nineteen ninety?
  79. Find the nearest Saturday after Current date?
  80. Display the current time?
  81. Display the date three months before the Current date?
  82. Display the common jobs from department number 10 and 20?
  83. Display the jobs found in department 10 and 20 Eliminate duplicate jobs?
  84. Display the jobs which are unique to department 10?
  85. Display the details of those employees who do not have any person working under him?
  86. Display the details of those employees who are in sales department and grade is 3?
  87. Display those who are not managers?
  88. Display those employees whose name contains not less than 4 characters?
  89. Display those department whose name start with “S” while location name ends with “K”?
  90. Display those employees whose manager name is Jones?
  91. Display those employees whose salary is more than 3000 after giving 20% increment?
  92. Display all employees with their department names?
  93. Display ename who are working in sales department?
  94. Display employee name,dept name,salary,and commission for those sal in between 2000 to 5000 while location is Chicago?
  95. Display those employees whose salary is greater than his manager’s salary?
  96. Display those employees who are working in the same dept where his manager is work?
  97. Display those employees who are not working under any Manager?
  98. Display the grade and employees name for the deptno 10 or 30 but grade is not 4 while joined the company before 31-DEC-82?
  99. Update the salary of each employee by 10% increment who are not eligible for commission?
  100. delete those employees who joined the company before 31-Dec-82 while their department Location is New York or Chicago?
  101. Display employee name, job, deptname, loc for all who are working as manager?
  102. Display those employees whose manager name is jones and also display their manager name?
  103. Display name and salary of ford if his salary is equal to hisal of his grade?
  104. Display employee name, job,deptname,his manager name ,his grade and make an under department wise?
  105. List out all the employee names, job,salary,grade and deptname for everyone in a company except ‘CLERK’ . Sort on salary display the highest salary?
  106. Display employee name,job abd his manager .Display also employees who are without managers?
  107. Display Top 5 employee of a Company?
  108. Display the names of those employees who are getting the highest salary?
  109. Display those employees whose salary is equal to average of maximum and minimum?
  110. Select count of employees in each department where count >3?
  111. Display dname where atleast three are working and display only deptname?
  112. Display name of those managers name whose salary is more than average salary of Company?
  113. Display those managers name whose salary is more than average salary salary of his employees?
  114. Display employee name,sal,comm and netpay for those employees whose netpay is greater than or equal to any other employee salary of the company?
  115. Display those employees whose salary is less than his manager but more than salary of other managers?
  116. Display all employees names with total sal of company with each employee name?
  117. find the last 5(least) employees of company?
  118. find out the number of employees whose salary is greater than their manager’s salary?
  119. Display the manager who are not working under president but they are working under any other manager?
  120. Delete those department where no employee working?

down load here 120 sql queries for practice

Advertisements