
CREATE TABLE department (
	"Department_ID" INTEGER, 
	"Name" TEXT, 
	"Creation" TEXT, 
	"Ranking" INTEGER, 
	"Budget_in_Billions" REAL, 
	"Num_Employees" REAL, 
	PRIMARY KEY ("Department_ID")
)


CREATE TABLE head (
	"head_ID" INTEGER, 
	name TEXT, 
	born_state TEXT, 
	age REAL, 
	PRIMARY KEY ("head_ID")
)


CREATE TABLE management (
	"department_ID" INTEGER, 
	"head_ID" INTEGER, 
	temporary_acting TEXT, 
	PRIMARY KEY ("department_ID", "head_ID"), 
	FOREIGN KEY("head_ID") REFERENCES head ("head_ID"), 
	FOREIGN KEY("department_ID") REFERENCES department ("Department_ID")
)

CREATE TABLE department (
	"Department_ID" INTEGER, 
	"Name" TEXT, 
	"Creation" TEXT, 
	"Ranking" INTEGER, 
	"Budget_in_Billions" REAL, 
	"Num_Employees" REAL, 
	PRIMARY KEY ("Department_ID")
)

/*
2 rows from department table:
Department_ID	Name	Creation	Ranking	Budget_in_Billions	Num_Employees
1	State	1789	1	9.96	30266.0
2	Treasury	1789	2	11.1	115897.0
*/


CREATE TABLE head (
	"head_ID" INTEGER, 
	name TEXT, 
	born_state TEXT, 
	age REAL, 
	PRIMARY KEY ("head_ID")
)

/*
2 rows from head table:
head_ID	name	born_state	age
1	Tiger Woods	Alabama	67.0
2	Sergio García	California	68.0
*/


CREATE TABLE management (
	"department_ID" INTEGER, 
	"head_ID" INTEGER, 
	temporary_acting TEXT, 
	PRIMARY KEY ("department_ID", "head_ID"), 
	FOREIGN KEY("head_ID") REFERENCES head ("head_ID"), 
	FOREIGN KEY("department_ID") REFERENCES department ("Department_ID")
)

/*
2 rows from management table:
department_ID	head_ID	temporary_acting
2	5	Yes
15	4	Yes
*/
What are the distinct creation years of the departments managed by a secretary born in state 'Alabama'?
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'
[{'Creation': '1903'}]