
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
*/
List the name, born state and age of the heads of departments ordered by age.
SELECT name ,  born_state ,  age FROM head ORDER BY age
[{'name': 'Pádraig Harrington', 'born_state': 'Connecticut', 'age': 43.0}, {'name': 'Stewart Cink', 'born_state': 'Florida', 'age': 50.0}, {'name': 'Dudley Hart', 'born_state': 'California', 'age': 52.0}, {'name': 'Jeff Maggert', 'born_state': 'Delaware', 'age': 53.0}, {'name': 'Nick Faldo', 'born_state': 'California', 'age': 56.0}, {'name': 'Tiger Woods', 'born_state': 'Alabama', 'age': 67.0}, {'name': 'Franklin Langham', 'born_state': 'Connecticut', 'age': 67.0}, {'name': 'Sergio García', 'born_state': 'California', 'age': 68.0}, {'name': 'K. J. Choi', 'born_state': 'Alabama', 'age': 69.0}, {'name': 'Billy Mayfair', 'born_state': 'California', 'age': 69.0}]