programming-examples/sql/SubqueriesHRDatabase/Write a query in SQL to display the department name and Id for all departments where they located, that Id is equal to the Id for the location.sql
2019-11-18 14:05:53 +01:00

12 lines
434 B
SQL

/*Write a query in SQL to display the department name and Id for all departments where they located, that Id is equal to the
Id for the location where department number 30 is located.
*/
SELECT department_name, department_id
FROM departments
WHERE location_id =
(
SELECT location_id
FROM departments
WHERE department_id = 30);