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
how many rivers are there in us
assistant
SELECT COUNT ( river_name ) FROM river;
human
how many rivers are in idaho
assistant
SELECT COUNT ( river_name ) FROM river WHERE traverse = 'idaho';
human
what is the length of the colorado river in texas
assistant
SELECT LENGTH FROM river WHERE river_name = 'colorado' AND traverse = 'texas';
human
what state contains the highest point of those the colorado river traverses
assistant
SELECT state_name FROM highlow WHERE highest_elevation = ( SELECT MAX ( highest_elevation ) FROM highlow WHERE state_name IN ( SELECT traverse FROM river WHERE river_name = 'colorado' ) );
human
how many rivers run through the states bordering colorado
assistant
SELECT COUNT ( river_name ) FROM river WHERE traverse IN ( SELECT border FROM border_info WHERE state_name = 'colorado' );
human
how many rivers are called colorado
assistant
SELECT COUNT( river_name ) FROM river WHERE river_name = "colorado" ;