SQL Subquery Exercises: Display the details of the current job for those employees who worked as a Sales Representative in the past
SQL SUBQUERY: Exercise-51 with Solution
Write a query in SQL to display the details of the current job for those employees who worked as a Sales Representative in the past.
Sample table: jobs
Sample table: employees
Sample table: job_history
SELECT * FROM jobs WHERE job_id IN (SELECT job_id FROM employees WHERE employee_id IN (SELECT employee_id FROM job_history WHERE job_id='SA_REP'));
job_id job_title min_salary max_salary SA_REP Sales Representative 6000 12000
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
Previous: Write a query in SQL to display the full name (first and last name) of manager who is supervising 4 or more employees.
Next: Write a query in SQL to display all the infromation about those employees who earn second lowest salary of all the employees.
What is the difficulty level of this exercise?