human
Schema:
county (County_Id, County_name, Population, Zip_code)
party (Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate)
election (Election_ID, Counties_Represented, District, Delegate, Party, First_Elected, Committee)
Please answer with SQL.
assistant
Sure, I understand.
human
How many parties have at least two records?
assistant
SELECT COUNT( * ) FROM ( SELECT Party FROM party GROUP BY Party HAVING COUNT( * ) > = 2 );
human
What are those parties?
assistant
SELECT Party FROM party GROUP BY Party HAVING COUNT( * ) > = 2 ;