
CREATE TABLE "School" (
	"School_id" TEXT, 
	"School_name" TEXT, 
	"Location" TEXT, 
	"Mascot" TEXT, 
	"Enrollment" INTEGER, 
	"IHSAA_Class" TEXT, 
	"IHSAA_Football_Class" TEXT, 
	"County" TEXT, 
	PRIMARY KEY ("School_id")
)


CREATE TABLE budget (
	"School_id" INTEGER, 
	"Year" INTEGER, 
	"Budgeted" INTEGER, 
	total_budget_percent_budgeted REAL, 
	"Invested" INTEGER, 
	total_budget_percent_invested REAL, 
	"Budget_invested_percent" TEXT, 
	PRIMARY KEY ("School_id", "Year"), 
	FOREIGN KEY("School_id") REFERENCES "School" ("School_id")
)


CREATE TABLE endowment (
	endowment_id INTEGER, 
	"School_id" INTEGER, 
	donator_name TEXT, 
	amount REAL, 
	PRIMARY KEY (endowment_id), 
	FOREIGN KEY("School_id") REFERENCES "School" ("School_id")
)

CREATE TABLE "School" (
	"School_id" TEXT, 
	"School_name" TEXT, 
	"Location" TEXT, 
	"Mascot" TEXT, 
	"Enrollment" INTEGER, 
	"IHSAA_Class" TEXT, 
	"IHSAA_Football_Class" TEXT, 
	"County" TEXT, 
	PRIMARY KEY ("School_id")
)

/*
2 rows from School table:
School_id	School_name	Location	Mascot	Enrollment	IHSAA_Class	IHSAA_Football_Class	County
1	Bremen	Bremen	Lions	495	AA	AA	50 Marshall
2	Culver Community	Culver	Cavaliers	287	A	A	50 Marshall
*/


CREATE TABLE budget (
	"School_id" INTEGER, 
	"Year" INTEGER, 
	"Budgeted" INTEGER, 
	total_budget_percent_budgeted REAL, 
	"Invested" INTEGER, 
	total_budget_percent_invested REAL, 
	"Budget_invested_percent" TEXT, 
	PRIMARY KEY ("School_id", "Year"), 
	FOREIGN KEY("School_id") REFERENCES "School" ("School_id")
)

/*
2 rows from budget table:
School_id	Year	Budgeted	total_budget_percent_budgeted	Invested	total_budget_percent_invested	Budget_invested_percent
2	1999	4979	2.0	2134	2.0	42.9
2	2000	3666	2.0	5840	2.0	159.3
*/


CREATE TABLE endowment (
	endowment_id INTEGER, 
	"School_id" INTEGER, 
	donator_name TEXT, 
	amount REAL, 
	PRIMARY KEY (endowment_id), 
	FOREIGN KEY("School_id") REFERENCES "School" ("School_id")
)

/*
2 rows from endowment table:
endowment_id	School_id	donator_name	amount
1	1	Monte Plata	9.51
2	2	San José de Ocoa	9.83
*/
What is the total budget amount for school "Glenn" in all years?
SELECT sum(T1.budgeted) FROM budget AS T1 JOIN school AS T2 ON T1.school_id  =  T2.school_id WHERE T2.school_name  =  'Glenn'
[{'sum(T1.budgeted)': 6803}]