Click here to Skip to main content
15,917,565 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Please any one help me those two questions

1. Use a CASE statement to show levels of employees according to the following criteria.
Order the results by management level.

(i) If the employee is not managed by anyone, they should have a Management Level of ‘Senior executive’.

(ii) If an employee manages other staff they should have a Management Level of ‘Middle Management’.

Hint : Use a subquery to find the middle managers

(iii) Remaining employees should have a Management Level of ‘Staff’

EMPNO ENAME MANAGEMENT_LEVEL
----- ---------- ----------------
7566 JONES Middle management
7698 BLAKE Middle management
7782 CLARK Middle management
7902 FORD Middle management
7788 SCOTT Middle management
7839 KING Senior executive
7369 SMITH Staff
7499 ALLEN Staff
7521 WARD Staff
7876 ADAMS Staff
7844 TURNER Staff
7654 MARTIN Staff
7900 JAMES Staff
7934 MILLER Staff


2. Repeat the query in Question 1 but reverse the sequence of the first two tests and observe the difference in the output for KING. Why does this occur?

EMPNO ENAME MANAGEMENT_LEVEL
----- ---------- -----------------
7698 BLAKE Middle management
7782 CLARK Middle management
7788 SCOTT Middle management
7902 FORD Middle management
7566 JONES Middle management
7839 KING Middle management
7654 MARTIN Staff
7499 ALLEN Staff
7521 WARD Staff
7369 SMITH Staff
7844 TURNER Staff
7876 ADAMS Staff
7934 MILLER Staff
7900 JAMES Staff
Posted
Comments
Ankit Kumar Gupta 23-Feb-12 23:17pm    
Hi, these points are unclear to me, So kindly elaborate.

1. What is the input data.
2. What query are you using to get the above output.
[no name] 24-Feb-12 0:56am    
How can you expect real help witout showing your code?

1 solution

We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.


Try it yourself, you may find it is not as difficult as you think!
 
Share this answer
 
Comments
[no name] 24-Feb-12 2:20am    
My 5+

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900