Last answered:

17 May 2023

Posted on:

11 Apr 2023

0

Salaries extraction

How can we extract a list of employees name with salaries >150000 instead of just showing the emp_no? 

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

12 Apr 2023

0

Hi Nicholas!
Thanks for reaching out.


You will need the employees table in order to use the first_name column in the result set. Please, use the following code:

SELECT 
    e.first_name, s.salary
FROM
    salaries s
        JOIN
    employees e ON s.emp_no = e.emp_no
WHERE
    salary > 150000


Hope this helps.
Best,
Tsvetelin

Posted on:

13 Apr 2023

0

Thank you! another question. about the e.first_name what does the 'e' stand for, is it like a key to access the employee table like the s.salary? if so where can find it? 

Instructor
Posted on:

17 May 2023

0

Hi Nicholas!


Thanks for your reply and please excuse us for missing to reply earlier to your question. 


Yes, exactly. It's an alias we've assigned after typing employees e (so is s for salaries after having salaries s).

Please feel free to refer to the following video from the course as a reference. Thank you.

https://learn.365datascience.com/courses/sql/using-aliases-as/


Kind regards,

Martin

Submit an answer