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
what river flows through the most states
assistant
SELECT river_name FROM river GROUP BY ( river_name ) ORDER BY COUNT ( DISTINCT traverse ) DESC LIMIT 1;
human
what states does the shortest river run through
assistant
SELECT traverse FROM river WHERE LENGTH = ( SELECT MIN ( LENGTH ) FROM river );
human
what states border states that the mississippi runs through
assistant
SELECT border FROM border_info WHERE state_name IN ( SELECT traverse FROM river WHERE river_name = 'mississippi' );
human
how many states does the missouri run through
assistant
SELECT COUNT ( traverse ) FROM river WHERE river_name = 'missouri';
human
how many major rivers cross ohio
assistant
SELECT COUNT ( river_name ) FROM river WHERE LENGTH > 750 AND traverse = 'ohio';
human
what states does the ohio run through
assistant
SELECT traverse FROM river WHERE river_name = "ohio" ;