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

  1. 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

  2. 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:

  3. 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:

  1. 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!