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
What are the creation years of the departments?
assistant
SELECT creation FROM department;
human
Which secretaries were born in Alabama?
assistant
SELECT * FROM head WHERE born_state = 'Alabama';
human
What are the distinct creation years of the departments managed by a secretary born in state 'Alabama'?
assistant
SELECT DISTINCT T1.creation FROM department AS T1 JOIN management AS T2 ON T1.department_id = T2.department_id JOIN head AS T3 ON T2.head_id = T3.head_id WHERE T3.born_state = "Alabama" ;