Question: Log in to Oracle SQL Developer/Oracle Live SQL and answer the following questions. For the EMPLOYEE table, use the rank () function to rank the
-
Log in to Oracle SQL Developer/Oracle Live SQL and answer the following questions. For the EMPLOYEE table, use the rank() function to rank the employees by salary like this: (3 points
-
FNAME LNAME SALARY_RANK
-----------------------------------------------------------------------
James Borg 1
Jennifer Wallace 2
Franklin Wong 3
Ramesh Narayan 4
John Smith 5
Ahmad Jabbar 6
Alicia Zelaya 6
Joyce English 6
Insert your answer between the two horizontal lines:
- Repeat the previous question by ranking the employees within each department like this: (2 points)
FNAME LNAME DNO SALARY_RANK
-----------------------------------------------------------------------------------------
James Borg 1 1
Jennifer Wallace 4 1
Ahmad Jabbar 4 2
Alicia Zelaya 4 2
Franklin Wong 5 1
Ramesh Narayan 5 2
John Smith 5 3
Joyce English 5 4
Insert your answer between the two horizontal lines:
- Create the following table, where EMP_ID is the primary key, and then answer the questions that follow: (2 points)
EMP_NAME EMP_ID SALES($)
-----------------------------------------------------
Mike 230823567 1500
Peter 440876567 2500
Peter 921126821 950
Angelo 810015710 2500
Robert 672899012 1950
3.1 Using the rank() function, produce a table showing the employee id, name, and sales rank like this: (2 points)
EMP_ID EMP_NAME SALES_RANK
--------------------------------------------------------------------
440876567 Peter 1
810015710 Angelo 1
672899012 Robert 3
230823567 Mike 4
921126821 Peter 5
Insert your answer between the two horizontal lines:
3.2 Using dense_rank() function, remove the gap between Angelo & Robert and rank the employees like this: (1 point)
EMP_ID EMP_NAME SALES_RANK
------------------------------------------------------------
440876567 Peter 1
810015710 Angelo 1
672899012 Robert 2
230823567 Mike 3
921126821 Peter 4
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
