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 is the location of the party with the most hosts?
assistant
SELECT LOCATION FROM party ORDER BY Number_of_hosts DESC LIMIT 1
human
What are the themes and locations of parties?
assistant
SELECT Party_Theme , LOCATION FROM party
human
Show the host names for parties with number of hosts greater than 20.
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
Show the locations of parties and the names of the party hosts in ascending order of the age of the host.
assistant
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
human
Show the themes of parties and the names of the party hosts.
assistant
SELECT T3.Party_Theme , 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
human
List the themes of parties in ascending order of number of hosts.
assistant
SELECT Party_Theme FROM party ORDER BY Number_of_hosts ASC ;