SQL Subquery Exercises: Display the city of the employee whose ID 134 and works there
SQL SUBQUERY: Exercise-47 with Solution
Write a query in SQL to display the city of the employee whose ID 134 and works there.
Sample table: locations
Sample table: departments
Sample table: employees
SELECT city FROM locations WHERE location_id = (SELECT location_id FROM departments WHERE department_id = (SELECT department_id FROM employees WHERE employee_id=134));
city South San Francisco
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
Previous: Write a query in SQL to display the first and last name, salary and department ID for those employees whose department is located in the city London.
Next: Write a query in SQL to display the the details of those departments which max salary is 7000 or above for those employees who already done one or more jobs.
What is the difficulty level of this exercise?