human
Schema:
department (Department_ID, Name, Creation, Ranking, Budget_in_Billions, Num_Employees)
head (head_ID, name, born_state, age)
management (department_ID, head_ID, temporary_acting)
Please answer with SQL.
assistant
Sure, I understand.
human
Show the names and number of employees of each department.
assistant
SELECT name , num_employees FROM department;
human
Who are the department heads whose temporary acting value is 'Yes'?
assistant
SELECT * FROM management WHERE temporary_acting = 'Yes';
human
Show the name and number of employees for the departments managed by heads whose temporary acting value is 'Yes'.
assistant
SELECT T1.name , T1.num_employees FROM department AS T1 JOIN management AS T2 ON T1.department_id = T2.department_id WHERE T2.temporary_acting = "Yes" ;