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
List the dates of debates with number of audience bigger than 150
assistant
SELECT Date FROM debate WHERE Num_of_Audience > 150
human
List the names of people that have not been on the affirmative side of debates.
assistant
SELECT Name FROM people WHERE People_id NOT IN (SELECT Affirmative FROM debate_people)
human
Show the names of people aged either 35 or 36.
assistant
SELECT Name FROM people WHERE Age = 35 OR Age = 36
human
Show different parties of people along with the number of people in each party.
assistant
SELECT Party , COUNT(*) FROM people GROUP BY Party
human
Show the party that has the most people.
assistant
SELECT Party FROM people GROUP BY Party ORDER BY COUNT(*) DESC LIMIT 1
human
What is the party of the youngest people?
assistant
SELECT Party FROM people ORDER BY Age ASC LIMIT 1 ;