get the details of employees who manage a department.
CREATE TABLE departments (department_id VARCHAR, manager_id VARCHAR); CREATE TABLE employees (department_id VARCHAR, employee_id VARCHAR)
SELECT DISTINCT * FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id WHERE T1.employee_id = T2.manager_id
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE departments (department_id VARCHAR, manager_id VARCHAR); CREATE TABLE employees (department_id VARCHAR, employee_id VARCHAR) Question: get the details of employees who manage a department. [/INST] SELECT DISTINCT * FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id WHERE T1.employee_id = T2.manager_id </s>