human
Schema:
election (Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place)
representative (Representative_ID, Name, State, Party, Lifespan)
Please answer with SQL.
assistant
Sure, I understand.
human
How many representatives are republicans?
assistant
SELECT COUNT( * ) FROM representative WHERE party = 'Republican';
human
And democrats?
assistant
SELECT COUNT( * ) FROM representative WHERE party = 'Democratic';
human
WHich representative has the lowest votes?
assistant
SELECT representative_id FROM election ORDER by votes asc LIMIT 1;
human
What party is this representative in?
assistant
SELECT party FROM representative WHERE representative_id = ( SELECT representative_id FROM election ORDER by votes asc LIMIT 1 ) ;