Last answered:

18 Apr 2022

Posted on:

03 Apr 2022

1

10 Highest Paid Employees or 10 Highest Paid Contracts?

In section 9, on the LIMIT video, a boss asks us for the '10 highest paid employees'. Which the video uses the following query:

SELECT 
    *
FROM
    salaries
ORDER BY salary DESC
LIMIT 10;

With the results of:
     (emp_no)       (salary)          (from_date)           (to_date)

'43624', '158220', '2002-03-22', '9999-01-01'
'43624', '157821', '2001-03-22', '2002-03-22'
'47978', '155709', '2002-07-14', '9999-01-01'
'109334', '155377', '2000-02-12', '2001-02-11'
'109334', '155190', '2002-02-11', '9999-01-01'
'109334', '154888', '2001-02-11', '2002-02-11'
'109334', '154885', '1999-02-12', '2000-02-12'
'80823', '154459', '2002-02-22', '9999-01-01'
'43624', '153458', '2000-03-22', '2001-03-22'
'43624', '153166', '1999-03-23', '2000-03-22'

From my interpretation of the data this is not the 10 highest paid employees but rather the 10 highest paid contracts. As there are only 4 unique emp_no contained in these 10 results.

Am I correctly interpreting these results as being the top 10 paid contracts or am I missing something and these are the top 10 paid employees?

1 answers ( 0 marked as helpful)
Instructor
Posted on:

18 Apr 2022

1

Hi Dossier!
Thanks for reaching out.
Yes, this the result of the top 10 paid contracts.

Hope this helps.
Best,
Tsvetelin

Submit an answer