human
Schema:
people (People_ID, District, Name, Party, Age)
debate (Debate_ID, Date, Venue, Num_of_Audience)
debate_people (Debate_ID, Affirmative, Negative, If_Affirmative_Win)
Please answer with SQL.
assistant
Sure, I understand.
human
Can you show me the names of the people who were on the affirmative side of debates with an audience bigger than 200?
assistant
SELECT T3.Name FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID = T2.Debate_ID JOIN people AS T3 ON T1.Affirmative = T3.People_ID WHERE T2.Num_of_Audience > 200;
human
Of those three, who is the oldest?
assistant
SELECT T3.Name FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID = T2.Debate_ID JOIN people AS T3 ON T1.Affirmative = T3.People_ID WHERE T2.Num_of_Audience > 200 ORDER by T3.age desc LIMIT 1;
human
What party affiliation does James Humphrey hold?
assistant
SELECT party FROM people WHERE name = 'James Humphrey';
human
What district does James Humphrey represent?
assistant
SELECT district FROM people WHERE name = "James Humphrey" ;