human
Schema:
party (Party_ID, Party_Theme, Location, First_year, Last_year, Number_of_hosts)
host (Host_ID, Name, Nationality, Age)
party_host (Party_ID, Host_ID, Is_Main_in_Charge)
Please answer with SQL.
assistant
Sure, I understand.
human
What are the names of the hosts that held parties with more than 20 hosts?
assistant
SELECT 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 WHERE T3.Number_of_hosts > 20;
human
What are the names of the hosts that held parties with the least number of hosts?
assistant
SELECT 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 T3.Number_of_hosts asc LIMIT 1;
human
What is the location of the party with the oldest host?
assistant
SELECT T3.location 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 desc LIMIT 1 ;