Salaries extraction
How can we extract a list of employees name with salaries >150000 instead of just showing the emp_no?
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
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?
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