You are on page 1of 3

ASSIGNMENT #4

-------------
PERFORM THE FOLLOWING QUERIES:

1. HOW MANY JOBS DO WE HAVE AND HOW MANY EMPLOYEES TO PERFORM THOSE JOBS.

2. LIST HIREDATE IN DESCENDING ORDER.

3. LIST HIREDATE IN ASCENDINO ORDER.

4. LIST ENAME JOB HIREDATE, WHILE HIREDATE IN DESCENDING ORDER -

5. LIST DEPARTMENT NUMBER, JOB, ENAME. SORT BY DEPARTMENT NUMBER AND SALARY AND
WHILE SALARIES DESCENDING ORDER.

6. FIND ALL DEPARTMENT NAMES WITH THEIR DEPARTMENT NUMBERS WHILE NUMBERS
GREATER THEN 20.

7. FIND THOSE EMPLOYEES WHOSE COMMISSION IS GREATER THEN THEIR SALARIES.

8. FIND THOSE EMPLOYEES WHOSE COMMISSION IS LESS THEN THEIR SALARIES.

9. FND ALL EMPLOYEES THOSE SALARIES ARE BETWEEN 500 AND 1500.

10. FIND ALL EMPLOYEES WHOSE SALARIES ARE BETWEEN 1500 AND 2500.

11. FIND ALL EMPLOYEES WHOSE SALARIES ARE BETWEEN 2600 AND 5000.

12. FIND ALL EMPLOYEES WHOSE SALARIES ARE LESS THEN 2000.

13. FIND ALL EMPLOYEES WHOSE SALARIES ARE GREATER THEN 2000.

14. FIND THOSE EMPLOYEES WHOSE MGR IS 7902, 7566, 7788.

15. TO FIND THOSE EMPLOYEES WHOSE MGR IS BETWEEN 7788 AND 7092.

16. LIST ALL EMPLOYEES WHOSE NAME START WITH �S�.

17. LIST ALL EMPLOYEES WHOSE NAME START WITH 'A'.

18. LIST ALL EMPLOYEES HAVING FIRST NAME AS 'SCOTT�.

19. LIST ALL EMPLOYEES HAVING FIRST NAME AS �SMITH' OR 'KING'.

20. LIST ALL EMPLOYEES HAVING FIRST LETTER IN THEIR NAME 'W' OR 'K� AND THEY
DON�T BELONG TO DEPARTMENT NUMBER 10.20 AND 40.

21. LIST ALL EMPLOYEES WHOSE NAME BEGIN WITH 'SCOTT� AND END WITH MARTIN.

22. LIST ALL EMPLOYEES WHOSE NAME START VVITH 'M' AND BELONG TO DEPARTMENT
NUMBER 30.

23. LIST OF THOSE EMPLOYEES, HAVING ONLY4 CHARACTERS LONG NAME.

24. LIST OF THOSE EMPLOYEES HAVING ONLY 5 CHARACTERS LONG NAME AND JOB AS A
MANAGER.

25. LIST OF THOSE EMPLOYEES, HAVING ONLY 4 CHARACTER LONG NAME AND JOB AS A
'SALESMAN�.

26. LIST ALL EMPLOYEES WHOSE NAME STARTED WITH CHARACTER 'B' AND THEIR JOBS ARE
MANAGER.

27. LIST ALL EMPLOYEES WHO DOES NOT HAVE A MANAGER (WHOSE MANAOER IS NULL).

28. FIND THOSE EMPLOYEES WHOSE JOB DO NOT START WITH A'.

29. FIND THOSE EMPLOYEES WHOSE JOB DO NOT START WITH 'C'.

30. LIST OF THOSE EMPLOYEES WHOSE MGR IS NOT NULL.

31. LIST OF THOSE EMPLOYEES WHOSE JOBS ARE 'MANAGER OR CLERK' OF DEPARTMENT
NUMBER 10.

32. LIST OF THOSE EMPLOYEES WHOSE JOBS ARE 'ANALYST' AND 'SALESMAN' OF
DEPARTMENT 30.

33. FIND ALL CLERKS WHO EARN SALARIES BETWEEN 1000 AND 2000.

34. FIND ALL MANAGERS WHO EARN SALARIES BETWEEN 2500 AND 3000.

35. FIND ALL EMPLOYEES WHO ARE EITHER CLERK OR 'MANAGER' AND ALL EMPLOYEES WHO
EARN SALARIES IN THE RANGE OF 1000 AND 2000.

36. FIND ALL EMPLOYEES WHO ARE EITHER MANAGER AND/OR ALL EMPLOYEES WHO EARN
SALARIES BETWEEN 2000 AND 3000.

37. FND ALL EMPLOYEES WHOSE SALARIES ARE EQUAL TO 1500 AND JOBS ARE MANAGER OR
SALESMEN.

38. FIND ALL MANAGERS AND SALESMEN THEIR SALARIES OVER 1500.

39. FIND ALL CLERKS AND SALESMEN THEIR SALARIES UNDER 2000.

40. FIND THE AVERAGE SALARIES OF DIFFERENT JOBS.

41. FIND THE AVERAGE SALARIES OF ALL EMPLOYEES.

42. FIND THE AVERACE SALARIES OF ALL JOBS EXCLUDING MANAGER.

43. FIND THE AVERAGE SALARY OF ANALYST.

44. FIND THE AVERAGE SALARY OF SALESMEN

45. FIND THE AVERACE SALARY OF EACH JOB WITHIN DEPARTMENT.

46. FIND THE AVERAGE SALARIES OF ALL MANAGERS AND SALESMEN.

47. FIND HOW MUCH PAID TO EACH JOB.

48. FIND THE AVERAGE SALARIES OF EACH DEPARTMENT.

49. FIND AVERAGE AND SUM OF ALL THE SALARIES OF EACH JOB EXCLUDING CLERKS.

50. FIND AVERAGE AND SUM OF THE SALARIES OF EACH JOB EXCLUDING SALESMEN', CLERK'
AND 'MANAGER'.