SQL Queries 1.0
SQL Queries 1.0
1) Select Queries
1. Query the dept table.
2. Query the EMP table.
3. Select the employee in department 30.
4. List the names, numbers and department of all clerks.
5. Find the depart numbers and the name of employee of all dept with Deptno greater or
equal to 20.
6. Find the employees whose commission is greater than their salary.
7. Find the employees whose commission is greater than 60 percent of their salary.
8. Find the employee whose commission is greater than 50 percent of their salary.
9. List the name, job and salary of all employees in dept 20 who earn more than 2000.
10. Find all salesmen in dept 30 whose salary is greater than or equal to Rs. 1500.
11. Find all the employees whose job is either a president or manager.
12. Find all managers who are not in dept 30.
13. Find the details of all managers and clerks in dept 10.
14. Find the details of all manager (in any dept) and all clerks in dept 10
15. Find the details of all managers in dept 10 and all clerks in dept 20.
16. Find the details of all the manager in dept 10, all clerk in dept 20
17. Find all employees who are neither clerks nor manager but whose salary is greater than
or equal to Rs. 2000.
18. Find the employees who earns between Rs. 1200 and Rs.1400.
19. Find the employees who are clerks, analysts or salesman.
20. Find the employees who are not clerks, analyst or salesman.
21. Find the employees who do not receive a commission.
22. Find the employee whose commission is Rs. 0.
23. Find the different jobs of the employees receiving commission.
24. Find all employees who do not receive a commission or whose Commission is less than
Rs. 100.
25. The employees who not receiving commission are entailed to Rs. 250, Show the net
earnings of all employees. (find about nvl() )
26. Find all employees whose total earnings are greater than Rs. 2000.
27. Find all employees whose names begin with m.
28. Find all employees whose names end with m.
29. Find all employees whose names contain the letter m.
30. Find the employees whose names are 5 characters long and end with n.
Page 1 of 3
SQL Queries
31. Find the employees who have the letter r as the third letter in their name.
Page 2 of 3
SQL Queries
57. Display the employee details in the following manner. 'Miler joined on the twenty-third
of January of the year nineteen hundred and eighty Two'.
3) Ordering by Queries
58. Display the details of all employees, sorted on the names.
59. Display the name of all employees, based on their tenure, with the oldest employee
coming first.
60. Display the names, job and salary of all employees sorted on jobs and Salary.
61. Display the names, job and salary of all employees, sorted on jobs and within job, sorted
on the descending order of salary.
62. Display the names, job and salary of all employees, sorted on Descending order of job
and within job, sorted on the descending order of salary.
63. Display the name, month and year of all employees, sorted on the month of their hire
date irrespective of the year.
64. Display the name, month and year of joining of all employees, sorted on the month of
their hire date, and within that on the year, with the earliest year appearing first.
Page 3 of 3