
CREATE TABLE host (
	"Host_ID" INTEGER, 
	"Name" TEXT, 
	"Nationality" TEXT, 
	"Age" TEXT, 
	PRIMARY KEY ("Host_ID")
)


CREATE TABLE party (
	"Party_ID" INTEGER, 
	"Party_Theme" TEXT, 
	"Location" TEXT, 
	"First_year" TEXT, 
	"Last_year" TEXT, 
	"Number_of_hosts" INTEGER, 
	PRIMARY KEY ("Party_ID")
)


CREATE TABLE party_host (
	"Party_ID" INTEGER, 
	"Host_ID" INTEGER, 
	"Is_Main_in_Charge" BOOLEAN, 
	PRIMARY KEY ("Party_ID", "Host_ID"), 
	FOREIGN KEY("Party_ID") REFERENCES party ("Party_ID"), 
	FOREIGN KEY("Host_ID") REFERENCES host ("Host_ID")
)

CREATE TABLE host (
	"Host_ID" INTEGER, 
	"Name" TEXT, 
	"Nationality" TEXT, 
	"Age" TEXT, 
	PRIMARY KEY ("Host_ID")
)

/*
2 rows from host table:
Host_ID	Name	Nationality	Age
1	Austin Daye	United States	43
2	Lloyd Daniels	United States	37
*/


CREATE TABLE party (
	"Party_ID" INTEGER, 
	"Party_Theme" TEXT, 
	"Location" TEXT, 
	"First_year" TEXT, 
	"Last_year" TEXT, 
	"Number_of_hosts" INTEGER, 
	PRIMARY KEY ("Party_ID")
)

/*
2 rows from party table:
Party_ID	Party_Theme	Location	First_year	Last_year	Number_of_hosts
1	Spring	Hemkade 48 Zaandam	2000	2001	5
2	Club Q-BASE	Hemkade 48 Zaandam	2002	2002	23
*/


CREATE TABLE party_host (
	"Party_ID" INTEGER, 
	"Host_ID" INTEGER, 
	"Is_Main_in_Charge" BOOLEAN, 
	PRIMARY KEY ("Party_ID", "Host_ID"), 
	FOREIGN KEY("Party_ID") REFERENCES party ("Party_ID"), 
	FOREIGN KEY("Host_ID") REFERENCES host ("Host_ID")
)

/*
2 rows from party_host table:
Party_ID	Host_ID	Is_Main_in_Charge
1	1	True
8	7	True
*/
Show the locations of parties and the names of the party hosts in ascending order of the age of the host.
SELECT T3.Location ,  T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID  =  T2.Host_ID JOIN party AS T3 ON T1.Party_ID  =  T3.Party_ID ORDER BY T2.Age
[{'Location': 'Various locations', 'Name': 'Carlos Delfino'}, {'Location': 'Heineken Music Hall Amsterdam', 'Name': 'Kornel David'}, {'Location': 'Heineken Music Hall Amsterdam', 'Name': 'Lloyd Daniels'}, {'Location': 'Hemkade 48 Zaandam', 'Name': 'Austin Daye'}, {'Location': 'Hemkade 48 Zaandam', 'Name': 'Ed Davis'}, {'Location': 'Heineken Music Hall Amsterdam', 'Name': 'Derrick Dial'}]