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 major cities are in texas
assistant
SELECT COUNT ( city_name ) FROM city WHERE population > 150000 AND state_name = 'texas';
human
how many cities are in texas
assistant
SELECT COUNT ( city_name ) FROM city WHERE state_name = 'texas';
human
how many people live in the capital of texas
assistant
SELECT population FROM city WHERE city_name = ( SELECT capital FROM state WHERE state_name = 'texas' );
human
what are the capitals of states that border texas
assistant
SELECT t2.capital FROM state AS t2 JOIN border_info AS t1 ON t2.state_name = t1.border WHERE t1.state_name = 'texas';
human
what is the capital of the state that borders the state that borders texas
assistant
SELECT capital FROM state WHERE state_name IN ( SELECT border FROM border_info WHERE state_name IN ( SELECT border FROM border_info WHERE state_name = 'texas' ) );
human
what is the capital of the state texas
assistant
SELECT capital FROM state WHERE state_name = "texas" ;