programming-examples/sql/JoinHRDatabase/22. Write a query in SQL to display the department name, full name (first and last name) of manager, and their city.sql

6 lines
363 B
MySQL
Raw Normal View History

2019-11-18 14:05:53 +01:00
/*22. Write a query in SQL to display the department name, full name (first and last name) of manager, and their city.*/
SELECT department_name, first_name || ' ' || last_name AS name_of_manager, city
FROM departments D
JOIN employees E
ON (D.manager_id=E.employee_id)
JOIN locations L USING (location_id);