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
Show the 3 counties with the smallest population.
assistant
SELECT County_name FROM county ORDER BY Population ASC LIMIT 3
human
Return the maximum and minimum population among all counties.
assistant
SELECT max(Population) , min(Population) FROM county
human
Show the name of the county with the biggest population.
assistant
SELECT County_name FROM county ORDER BY Population DESC LIMIT 1
human
Show the county name and population of all counties.
assistant
SELECT County_name , Population FROM county
human
Return the names of all counties sorted by county name in descending alphabetical order.
assistant
SELECT County_name FROM county ORDER BY County_name DESC
human
Sort the names of all counties in ascending order of population.
assistant
SELECT County_name FROM county ORDER BY Population ASC ;