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
Show me a list of party themes
assistant
SELECT party_theme FROM party;
human
Can you show me the corresponding party id and host id to each theme?
assistant
SELECT T1.party_id , T1.host_id , T3.party_theme 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
Can you add host names to that table?
assistant
SELECT T2.name , T1.party_id , T1.host_id , T3.party_theme 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 ;