human
Schema:
state (state_name, population, area, country_name, capital, density)
city (city_name, population, country_name, state_name)
border_info (state_name, border)
highlow (state_name, highest_elevation, lowest_point, highest_point, lowest_elevation)
lake (lake_name, area, country_name, state_name)
mountain (mountain_name, mountain_altitude, country_name, state_name)
river (river_name, length, country_name, traverse)
Please answer with SQL.
assistant
Sure, I understand.
human
which states have a river
assistant
SELECT traverse FROM river;
human
how many states do not have rivers
assistant
SELECT COUNT ( DISTINCT state_name ) FROM state WHERE state_name NOT IN ( SELECT traverse FROM river );
human
give me the longest river that passes through the us
assistant
SELECT river_name FROM river WHERE LENGTH = ( SELECT MAX ( LENGTH ) FROM river );
human
how many rivers are there in us
assistant
SELECT COUNT ( river_name ) FROM river;
human
name all the rivers in illinois
assistant
SELECT river_name FROM river WHERE traverse = 'illinois';
human
give me the number of rivers in idaho
assistant
SELECT COUNT( river_name ) FROM river WHERE traverse = "idaho" ;