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
what is the average lifespan of the representatives
assistant
SELECT AVG ( lifespan ) FROM representative;
human
what parties have at least two representatives
assistant
SELECT Party FROM representative GROUP BY Party HAVING COUNT( * ) > = 2;
human
what parties have at least three representatives
assistant
SELECT Party FROM representative GROUP BY Party HAVING COUNT( * ) > = 3 ;