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
How many parties are there?
assistant
SELECT COUNT( DISTINCT Party ) FROM people;
human
How many people are there in each party?
assistant
SELECT Party , COUNT( * ) FROM people GROUP BY Party;
human
Which party has the most people?
assistant
SELECT Party FROM people GROUP BY Party ORDER BY COUNT( * ) DESC LIMIT 1 ;