db_id
stringclasses
69 values
schema
stringclasses
69 values
m_schema
stringclasses
69 values
question
stringlengths
24
325
sql
stringlengths
23
804
evidence
stringlengths
0
673
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
What are the precise locations of the cities with an area code of 787?
SELECT T2.latitude, T2.longitude FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.area_code = '787' GROUP BY T2.latitude, T2.longitude
precise location refers to latitude, longitude
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
In California, how many delivery receptacles are there in the community post office that has the highest number of delivery receptacles?
SELECT COUNT(*) FROM state AS T1 INNER JOIN zip_data AS T2 ON T1.abbreviation = T2.state WHERE T1.abbreviation = 'CA' AND T2.type LIKE '%Community Post Office%' AND T1.name = 'California' AND T2.state = 'CA'
in California refers to name = 'California' and state = 'CA'; 'Community Post Office' is the Type
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
In which county can you find the city with the highest number of females?
SELECT T4.county FROM zip_data AS T3 INNER JOIN country AS T4 ON T3.zip_code = T4.zip_code GROUP BY T4.county ORDER BY T3.female_population DESC LIMIT 1
highest number of females refers to Max(female_population)
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
What are the names of the states whose postal point is not affiliated with any organization?
SELECT DISTINCT T2.name FROM zip_data AS T1 INNER JOIN state AS T2 ON T1.state = T2.abbreviation WHERE T1.division IS NULL
postal point is not affiliated with any organization refers to division is null
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
What is the difference in the most populated city of Allentown-Bethlehem-Easton, PA-NJ in 2020 against its population in 2010?
SELECT T1.population_2020 - T1.population_2010 AS result_data FROM zip_data AS T1 INNER JOIN CBSA AS T2 ON T1.CBSA = T2.CBSA WHERE T2.CBSA_name = 'Allentown-Bethlehem-Easton, PA-NJ' ORDER BY T1.population_2020 DESC LIMIT 1
"Allentown-Bethlehem-Easton, PA-NJ" is the CBSA_name; most populated city refers to Max(population_2020); difference = Subtract (population_2020, population_2011)
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
List all the zip codes in the county of New Castle in Delaware.
SELECT DISTINCT T2.zip_code FROM state AS T1 INNER JOIN country AS T2 ON T1.abbreviation = T2.state WHERE T2.county = 'NEW CASTLE' AND T1.name = 'Delaware'
"NEW CASTLE" is the county; 'Delaware' is the name of state
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
How many representatives are there in the state with the highest monthly benefit payments for retired workers?
SELECT COUNT(T3.cognress_rep_id) FROM zip_data AS T1 INNER JOIN state AS T2 ON T1.state = T2.abbreviation INNER JOIN congress AS T3 ON T2.abbreviation = T3.abbreviation ORDER BY T1.monthly_benefits_retired_workers DESC LIMIT 1
state with highest monthly benefits payment for retired workers refers to Max(monthly_benefits_retired_workers)
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
In the state where Lisa Murkowski is the representative, how many cities have zero employees?
SELECT COUNT(T3.city) FROM congress AS T1 INNER JOIN state AS T2 ON T1.abbreviation = T2.abbreviation INNER JOIN zip_data AS T3 ON T2.abbreviation = T3.state WHERE T1.first_name = 'Murkowski' AND T1.last_name = 'Lisa' AND T3.employees = 0
zero employee refers to employees = 0
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
What are the top 3 states with the highest Asian population? List the full names of all the representatives in the said states.
SELECT t.state, T1.first_name, T1.last_name FROM zip_data AS T INNER JOIN congress AS T1 ON t.state = T1.abbreviation GROUP BY t.state ORDER BY SUM(t.asian_population) DESC LIMIT 3
city with highest asian population refers to Max(Sum(asian_population)); full name refers to first_name, last_name
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Which state is Outagamie County in? Give the full name of the state.
SELECT DISTINCT T2.name FROM country AS T1 INNER JOIN state AS T2 ON T1.state = T2.abbreviation WHERE T1.county = 'OUTAGAMIE'
"OUTAGAMIE" is the county
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
What party does the area with the zip code 91701 belong to?
SELECT T1.party FROM congress AS T1 INNER JOIN state AS T2 ON T1.abbreviation = T2.abbreviation INNER JOIN zip_data AS T3 ON T2.abbreviation = T3.state WHERE T3.zip_code = 91701 GROUP BY T1.party
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
How many males are there in New Haven County's residential areas?
SELECT SUM(T1.male_population) FROM zip_data AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code WHERE T2.county = 'NEW HAVEN'
"NEW HAVEN" is the county; male refers to male_population
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Show the alias for the county at coordinate (18.090875, -66.867756).
SELECT T2.alias FROM zip_data AS T1 INNER JOIN alias AS T2 ON T1.zip_code = T2.zip_code WHERE T1.latitude = 18.090875 AND T1.longitude = -66.867756
coordinates refers to latitude, longitude; latitude = '18.090875; longitude = '-66.867756'
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
For the city with the most elders, what's its area code?
SELECT T2.area_code FROM zip_data AS T1 INNER JOIN area_code AS T2 ON T1.zip_code = T2.zip_code GROUP BY T2.area_code ORDER BY T1.over_65 DESC LIMIT 1
city with most elders refers to Max(over_65)
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
For the county represented by Thompson Bennie G, how many bad aliases does it have?
SELECT COUNT(DISTINCT T2.bad_alias) FROM zip_congress AS T1 INNER JOIN avoid AS T2 ON T1.zip_code = T2.zip_code INNER JOIN congress AS T3 ON T1.district = T3.cognress_rep_id WHERE T3.first_name = 'Thompson' AND T3.last_name = 'Bennie G'
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Give the location coordinates of the city with area code 636.
SELECT T2.latitude, T2.longitude FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.area_code = 636
location coordinate refers to (latitude, longitude)
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Show the zip code of the county represented by Buchanan Vernon.
SELECT T2.zip_code FROM congress AS T1 INNER JOIN zip_congress AS T2 ON T1.cognress_rep_id = T2.district WHERE T1.first_name = 'Buchanan' AND T1.last_name = 'Vernon'
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Which state is area code 878 in? Give the name of the state.
SELECT T2.state FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.area_code = 878
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
How many counties are there in Virginia State?
SELECT COUNT(T2.county) FROM state AS T1 INNER JOIN country AS T2 ON T1.abbreviation = T2.state WHERE T1.name = 'Virginia'
"Virginia" is the state
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Give the name and the position of the cbsa officer from the area with the zip code 45503.
SELECT T1.CBSA_name, T2.latitude, T2.longitude FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T2.zip_code = 45503 GROUP BY T1.CBSA_name, T2.latitude, T2.longitude
position refers to latitude, longitude
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Tell the name of the county which is represented by Hartzler Vicky.
SELECT T1.county FROM country AS T1 INNER JOIN zip_congress AS T2 ON T1.zip_code = T2.zip_code INNER JOIN congress AS T3 ON T2.district = T3.cognress_rep_id WHERE T3.first_name = 'Hartzler' AND T3.last_name = 'Vicky' GROUP BY T1.county
name of county refers to county
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Calculate the average male median age of all the residential areas in Windham county.
SELECT SUM(T2.male_median_age) / COUNT(T2.median_age) FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.county = 'WINDHAM'
average male median age refers to Divide (Sum(male_median_age), Count(county)); 'WINDHAM' is the county
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
For the county where DeSantis Ron is from, what is the average female median age?
SELECT SUM(T4.female_median_age) / COUNT(T1.county) FROM country AS T1 INNER JOIN zip_congress AS T2 ON T1.zip_code = T2.zip_code INNER JOIN congress AS T3 ON T2.district = T3.cognress_rep_id INNER JOIN zip_data AS T4 ON T1.zip_code = T4.zip_code WHERE T3.first_name = 'DeSantis' AND T3.last_name = 'Ron'
average female median age refers to Divide (Sum(female_median_age), Count(county))
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
What is the area code of Bishopville, SC?
SELECT T1.area_code FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.city = 'Bishopville' AND T2.state = 'SC'
"Bishopville" is the city; 'SC' is the state
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Name the bad alias of Geneva, AL.
SELECT T1.bad_alias FROM avoid AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.city = 'Geneva' AND T2.state = 'AL'
"Geneva" is the city; 'AL' is the state
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Which city and state has the bad alias of Lawrenceville?
SELECT T2.city, T2.state FROM avoid AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.bad_alias = 'Lawrenceville' GROUP BY T2.city, T2.state
"Lawrenceville" is the bad_alias
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Name both the alias and the bad alias of zip code 38015.
SELECT T1.alias, T2.bad_alias FROM alias AS T1 INNER JOIN avoid AS T2 ON T1.zip_code = T2.zip_code WHERE T1.zip_code = 38015
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
What is the zip code of the district represented by Steven A King?
SELECT T2.zip_code FROM congress AS T1 INNER JOIN zip_congress AS T2 ON T1.cognress_rep_id = T2.district WHERE T1.first_name = 'King' AND T1.last_name = 'Steven A'
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
What is the CBSA name and type in York, ME?
SELECT T1.CBSA_name, T1.CBSA_type FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T2.city = 'York' AND T2.state = 'ME'
"York" is the city; 'ME' is the state; type refers to CBSA_type
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
List 10 cities with a median age over 40. Include their zip codes and area codes.
SELECT T2.city, T2.zip_code, T1.area_code FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.median_age >= 40 LIMIT 10
median age over 40 refers to median_age > 40
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Name the county that has the bad alias of Druid Hills.
SELECT T2.county FROM avoid AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code WHERE T1.bad_alias = 'Druid Hills'
"Druid Hills" is the bad_alias
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
What is the area code of Phillips county in Montana?
SELECT DISTINCT T1.area_code FROM area_code AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code INNER JOIN state AS T3 ON T2.state = T3.abbreviation WHERE T2.county = 'PHILLIPS' AND T3.name = 'Montana'
"PHILLIPS" is the county; 'Montana' is the name of state
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Which district has the largest land area in Wisconsin? Write the full name of the congress representative and include the postal codes.
SELECT T2.zip_code, T1.first_name, T1.last_name FROM congress AS T1 INNER JOIN zip_congress AS T2 ON T1.cognress_rep_id = T2.district WHERE T1.state = 'Wisconsin' ORDER BY T1.land_area DESC LIMIT 1
"Wisconsin" is the state; largest land area refers to Max(land_area); full name refers to first_name, last_name; postal code refers to zip_code
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
How many states are in the central time zone? Write their full names.
SELECT SUM(CASE WHEN T1.time_zone = 'Central' THEN 1 ELSE 0 END) AS count FROM zip_data AS T1 INNER JOIN state AS T2 ON T2.abbreviation = T1.state WHERE T1.time_zone = 'Central'
central time zone refers to time_zone = 'Central'
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Name 10 cities with their states that are under the Lexington-Fayette, KY office of the Canada Border Services Agency.
SELECT DISTINCT T2.city, T2.state FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T1.CBSA_name = 'Lexington-Fayette, KY' LIMIT 10
"Lexington-Fayette, KY" is the CBSA_name
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
What is the percentage ratio between Democrats and Republicans in Indiana? List the zip codes belonging to Democrats.
SELECT CAST(COUNT(CASE WHEN T2.party = 'Democrat' THEN 1 ELSE NULL END) AS REAL) / COUNT(CASE WHEN T2.party = 'Republican' THEN 1 ELSE NULL END)FROM zip_congress AS T1 INNER JOIN congress AS T2 ON T2.cognress_rep_id = T1.district
"Democrats" and "Republicans" refers to party = 'Democrat" and party = 'Republican'; percentage ratio = Multiply (Divide (Count(party = 'Democrat"), Count(party = 'Republican')), 100)
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Calculate the ratio between the number of representatives in Alabama and the number of representatives in Illinois.
SELECT CAST(COUNT(CASE WHEN state = 'Alabama' THEN cognress_rep_id ELSE NULL END) AS REAL) / COUNT(CASE WHEN state = 'Illinois' THEN cognress_rep_id ELSE NULL END) FROM congress
"Alabama" and "Illinois" are both state; Ratio = Divide (Count(state = 'Alabama'), Count(state = 'Illinois'))
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Calculate the average of 2020's population in each zip code.
SELECT CAST(SUM(population_2020) AS REAL) / COUNT(zip_code) FROM zip_data
average of 2020 population in each zip code refers to Divide (Sum(population_2020), Count(zip_code))
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
State the male population for all zip code which were under the Berlin, NH CBSA.
SELECT T2.male_population FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T1.CBSA_name = 'Berlin, NH' GROUP BY T2.male_population
"Berlin, NH" is the CBSA_name
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Which CBSAs have more than 10 zip codes?
SELECT T1.CBSA_name FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA GROUP BY T1.CBSA HAVING COUNT(T2.zip_code) > 10
has more than 10 zip codes refers to CBSA where count(CBSA) > 10
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
List all the bad alias for zip codes in Puerto Rico.
SELECT T1.bad_alias FROM avoid AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.state = 'PR'
"Puerto Rico" refers to state = 'PR'
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
What is the longitude and latitude for the district represented by Grayson Alan?
SELECT T1.latitude, T1.longitude FROM zip_data AS T1 INNER JOIN zip_congress AS T2 ON T1.zip_code = T2.zip_code INNER JOIN congress AS T3 ON T2.district = T3.cognress_rep_id WHERE T3.first_name = 'Grayson' AND T3.last_name = 'Alan'
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
What is the state for area code of 787?
SELECT DISTINCT T2.state FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.area_code = 787
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
List all representatives of districts which have more than 30 000 population in 2020.
SELECT T3.first_name, T3.last_name FROM zip_data AS T1 INNER JOIN zip_congress AS T2 ON T1.zip_code = T2.zip_code INNER JOIN congress AS T3 ON T2.district = T3.cognress_rep_id WHERE T1.population_2020 > 30000 GROUP BY T3.first_name, T3.last_name
more than 30000 population in 2020 refers to population_2020 > 30000; representative refers to first_name, last_name
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Which zip code in Massachusetts that have more than 1 area code?
SELECT T1.zip_code FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.state = 'MA' GROUP BY T1.zip_code HAVING COUNT(T1.area_code) > 1
"Massachusetts" is the state; zip code more than 1 area code refers to Count (zip_code) > 1
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
State the county for Arecibo City.
SELECT DISTINCT T1.county FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.city = 'Arecibo'
"Arecibo" is the city
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
How many zip codes are under Barre, VT?
SELECT COUNT(T2.zip_code) FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T1.CBSA_name = 'Barre, VT'
"Barre, VT" is the CBSA_name
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Among the zip code under Saint Croix county, which zip code has the biggest land area?
SELECT T1.zip_code FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.county = 'SAINT CROIX' ORDER BY T2.land_area DESC LIMIT 1
biggest land area refers to Max(land_area); "SAINT CROIX" is the county
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Calculate the difference between the 2020 population and the 2010 population for the districts represented by Griffin Tim.
SELECT T1.population_2020 - T1.population_2010 FROM zip_data AS T1 INNER JOIN zip_congress AS T2 ON T1.zip_code = T2.zip_code INNER JOIN congress AS T3 ON T2.district = T3.cognress_rep_id WHERE T3.first_name = 'Griffin' AND T3.last_name = 'Tim'
difference = Subtract (population_2020, population_2010)
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Based on the population in 2020, calculate the percentage for the population of Asian in the zip code where the CBSA was Atmore, AL.
SELECT CAST(T2.asian_population AS REAL) * 100 / T2.population_2010 FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T1.CBSA_name = 'Atmore, AL'
"Atmore, AL" is CBSA_name; percentage = Divide(asian_population, population_2020) * 100
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Among the cities with an area code 939, which city has the highest Asian population?
SELECT T2.city FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.area_code = 939 ORDER BY T2.asian_population DESC LIMIT 1
highest asian population refers to Max(asian_population)
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Give the name of the country and state of the city with elevation of 1039.
SELECT DISTINCT T1.name, T2.state FROM state AS T1 INNER JOIN country AS T2 ON T1.abbreviation = T2.state INNER JOIN zip_data AS T3 ON T2.zip_code = T3.zip_code WHERE T3.elevation = 1039
elevation of 1039 refers to elevation = 1039
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Provide the alias and elevation of the city with zip code 1028.
SELECT T1.alias, T2.elevation FROM alias AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.zip_code = 1028
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
What is the area code of the city with the largest land area?
SELECT T1.area_code FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.land_area = ( SELECT MAX(land_area) FROM zip_data )
largest land area refers to Max(land_area)
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Give the area code of the city with the white population ranging between 1700 to 2000.
SELECT T1.area_code FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.white_population BETWEEN 1700 AND 2000
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
What is the Asian population in the city with the alias Leeds?
SELECT SUM(T2.asian_population) FROM alias AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.alias = 'Leeds'
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
List down the area code and country of the city named Savoy.
SELECT T1.area_code, T2.county FROM area_code AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code INNER JOIN zip_data AS T3 ON T1.zip_code = T3.zip_code WHERE T3.city = 'Savoy'
Savoy is the city;
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
What are the alias of the cities with 0 population in 2010?
SELECT DISTINCT T1.alias FROM alias AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.population_2010 = 0
with 0 population in 2010 refers to population_2010 = 0;
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Among the cities with area code 608, how many cities implement daylight savings?
SELECT COUNT(T2.city) FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.area_code = 608 AND T2.daylight_savings = 'Yes'
implement daylight savings refers to daylight_savings = 'Yes';
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Provide the average elevation of the cities with alias Amherst.
SELECT AVG(T2.elevation) FROM alias AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.alias = 'Amherst'
AVG(elevation) where alias = 'Amherst';
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
What is the country and state of the city named Dalton?
SELECT T2.county FROM state AS T1 INNER JOIN country AS T2 ON T1.abbreviation = T2.state INNER JOIN zip_data AS T3 ON T2.zip_code = T3.zip_code WHERE T3.city = 'Dalton' GROUP BY T2.county
Dalton is the city;
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Give at least five alias of cities with a postal point of post office.
SELECT T1.alias FROM alias AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.type = 'Post Office' LIMIT 5
postal point of post office refers to type = 'Post Office';
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
What is the difference in the number of cities with P.O. box only and cities with Post Office among the cities with area code 787?
SELECT COUNT(CASE WHEN T2.type = 'P.O. Box Only' THEN 1 ELSE NULL END) - COUNT(CASE WHEN T2.type = 'Post Office' THEN 1 ELSE NULL END) AS DIFFERENCE FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.area_code = 787
SUBTRACT(COUNT(type = 'P.O. Box Only'), COUNT(type = 'Post Office')) where area_code = 787;
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Among the cities belonging to the country named Arroyo, calculate the percentage of increase in the population in these cities from 2010 to 2020.
SELECT CAST((SUM(T2.population_2020) - SUM(T2.population_2010)) AS REAL) * 100 / SUM(T2.population_2010) FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.city = 'Arroyo'
DIVIDE(SUBTRACT(SUM(population_2020)), SUM(population_2010)), SUM(population_2010) as percentage where county = 'ARROYO';
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Among the postal points in Texas, provide the zip codes and cities of postal points which have total beneficiaries of above 10000.
SELECT T2.zip_code, T2.city FROM state AS T1 INNER JOIN zip_data AS T2 ON T1.abbreviation = T2.state WHERE T1.name = 'Texas' AND T2.total_beneficiaries > 10000
Texas is the name of the state, in which name = 'Texas'; total beneficiaries of above 10000 refer to total_beneficiaries > 10000;
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Among the postal points in the District of Columbia, how many of them have an area with above 20000 black population?
SELECT COUNT(T1.zip_code) FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.county = 'DISTRICT OF COLUMBIA' AND T2.black_population > 20000
District of Columbia refers to county = 'DISTRICT OF COLUMBIA'; postal points refer to zip_code; area with above 20000 black population refers to black_population > 20000;
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Provide the city where zip code 19019 is located and the alias of that city.
SELECT T2.city, T1.alias FROM alias AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.zip_code = 19019
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
List the bad alias of the postal point located in Camuy.
SELECT T1.bad_alias FROM avoid AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.city = 'Camuy'
postal points refer to zip_code; Camuy is the city;
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Provide the zip code, city, and congress representative's full names of the area which has highest population in 2020.
SELECT T1.zip_code, T1.city, T3.first_name, T3.last_name FROM zip_data AS T1 INNER JOIN zip_congress AS T2 ON T1.zip_code = T2.zip_code INNER JOIN congress AS T3 ON T2.district = T3.cognress_rep_id GROUP BY T2.district ORDER BY T1.population_2020 DESC LIMIT 1
representative's full names refer to first_name, last_name; area which has highest population in 2020 refers to MAX(population_2020);
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Among the daylight savings areas in the Midwest region, how many postal points are there in Illinois?
SELECT COUNT(T2.zip_code) FROM state AS T1 INNER JOIN zip_data AS T2 ON T1.abbreviation = T2.state WHERE T1.name = 'Illinois' AND T2.daylight_savings = 'Yes' AND T2.region = 'Midwest'
postal points refer to zip_code; the daylight savings areas refer to daylight_savings = 'Yes'; Illinois is the name of the state, in which name = 'Illinois';
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Provide the countries and the zip codes in the Virgin Islands.
SELECT T2.county, T2.zip_code FROM state AS T1 INNER JOIN country AS T2 ON T1.abbreviation = T2.state WHERE T1.name = 'Virgin Islands'
the Virgin Islands refer to state where name = 'Virgin Islands';
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Provide the zip codes and the alias of Greeneville.
SELECT T2.zip_code, T1.alias FROM alias AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.city = 'Greeneville'
Greeneville is the city;
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Compare the numbers of postal points under Smith Adrian and Heck Joe.
SELECT CASE WHEN COUNT(CASE WHEN T1.first_name = 'Smith' AND T1.last_name = 'Adrian' THEN T2.zip_code ELSE NULL END) > COUNT(CASE WHEN T1.first_name = 'Heck' AND T1.last_name = 'Joe' THEN T2.zip_code ELSE NULL END) THEN 'Smith Adrian>Heck Joe' ELSE 'Smith Adrian<=Heck Joe' END AS COMPARE FROM congress AS T1 INNER JOIN ...
COUNT(zip_code where first_name = 'Smith' and last_name = 'Adrian') > COUNT(zip_code where first_name = 'Heck' and last_name = 'Joe');
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Provide the zip codes and CBSA officers of the postal point in Oxford.
SELECT T2.zip_code, T1.CBSA_name FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T2.city = 'Oxford'
CBSA officers refer to CBSA_name; postal point refers to zip_code; Oxford is the city;
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Provide the zip codes and their affiliated organization for the postal point under Kingsport-Bristol, TN-VA.
SELECT T2.zip_code, T2.organization FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T1.CBSA_name = 'Kingsport-Bristol, TN-VA'
postal point under Kingsport-Bristol, TN-VA refers to zip_code where CBSA_name = 'Kingsport-Bristol, TN-VA'; affiliated organization refers to organization from CBSA;
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Provide the zip codes and the congress representatives' names of the postal points which are affiliated with Readers Digest.
SELECT T1.zip_code, T3.first_name, T3.last_name FROM zip_data AS T1 INNER JOIN zip_congress AS T2 ON T1.zip_code = T2.zip_code INNER JOIN congress AS T3 ON T2.district = T3.cognress_rep_id WHERE T1.organization = 'Readers Digest'
representative's full names refer to first_name, last_name; postal points affiliated with Readers Digest refer to zip_code where organization = 'Readers Digest';
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Among the postal points in California, calculate the percentage of them in post office types.
SELECT CAST(COUNT(CASE WHEN T2.type = 'Post Office' THEN T2.zip_code ELSE NULL END) AS REAL) * 100 / COUNT(T2.zip_code) FROM state AS T1 INNER JOIN zip_data AS T2 ON T1.abbreviation = T2.state WHERE T1.name = 'California'
DIVIDE(COUNT(zip_code where type = 'Post Office'), COUNT(zip_code)) as percentage where name = 'California';
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
What are the zip code for the Senate house?
SELECT T2.zip_code FROM congress AS T1 INNER JOIN zip_congress AS T2 ON T1.cognress_rep_id = T2.district WHERE T1.House = 'House of Repsentatives' GROUP BY T2.zip_code
House of Repsentatives can stand for senate house
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Which city has the most bad aliases?
SELECT T2.city FROM avoid AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code GROUP BY T1.bad_alias ORDER BY COUNT(T1.zip_code) DESC LIMIT 1
the most bad aliases refer to MAX(COUNT(bad_alias));
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
List all the counties in Georgia.
SELECT T2.county FROM state AS T1 INNER JOIN country AS T2 ON T1.abbreviation = T2.state WHERE T1.name = 'Georgia' GROUP BY T2.county
Georgia is the name of the state, in which name = 'Georgia';
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
List all the locations of postal points with the area code "410".
SELECT T2.latitude, T2.longitude FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.area_code = 410
latitude and longitude coordinates can be used to identify the location; postal points refer to zip_code;
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
What is the name of the CBSA of the city with the highest average house value?
SELECT DISTINCT T1.CBSA_name FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T2.avg_house_value = ( SELECT MAX(avg_house_value) FROM zip_data ) LIMIT 1
the highest average house value refers to avg_house_value;
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
What are the bad aliases of the postal points from East Setauket?
SELECT T1.bad_alias FROM avoid AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.city = 'East Setauket'
East Setauket is the city;
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
What was the population of Wilcox County in 2010?
SELECT SUM(T2.population_2010) FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.county = 'WILCOX'
population of Wilcox County in 2010 refers to SUM(population_2010) where county = 'WILCOX';
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
What is the code of the area with the largest Asian population?
SELECT T1.zip_code FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code GROUP BY T2.asian_population ORDER BY T2.asian_population DESC LIMIT 1
the code of the area refers to area_code; area with the largest Asian population refers to MAX(asian_population);
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
List all the cities with micro CBSA.
SELECT T2.city FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T1.CBSA_type = 'Micro'
micro CBSA refers to CBSA_type = 'Micro';
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
What is the name of the state with the most counties?
SELECT T1.name FROM state AS T1 INNER JOIN country AS T2 ON T1.abbreviation = T2.state GROUP BY T2.state ORDER BY COUNT(T2.county) DESC LIMIT 1
the most counties refer to MAX(COUNT(county));
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
What is the number of households in the "FL-10" district?
SELECT SUM(CASE WHEN T2.district = 'FL-10' THEN 1 ELSE 0 END) FROM zip_data AS T1 INNER JOIN zip_congress AS T2 ON T1.zip_code = T2.zip_code
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
What is the average household income in the city known as "Danzig"?
SELECT T2.avg_income_per_household FROM avoid AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.bad_alias = 'Danzig'
average household income refers to avg_income_per_household; city known as "Danzig" refers to bad_alias = 'Danzig';
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
What are the states with an above-average female population?
SELECT DISTINCT T2.state FROM state AS T1 INNER JOIN zip_data AS T2 ON T1.abbreviation = T2.state WHERE T2.female_population > ( SELECT AVG(female_population) FROM zip_data )
above-average female population refers to female_population > DIVIDE(SUM(female_population), COUNT(state));
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
What percentage of households are in "Coroyell" out of its state?
SELECT CAST(SUM(CASE WHEN T1.county = 'CORYELL' THEN T2.households ELSE 0 END) AS REAL) * 100 / SUM(T2.households) FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code
DIVIDE(SUM(households where county = 'CORYELL'), SUM(households)) as percentage;
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
What is the name and the position of the CBSA officer in the city of Cabo Rojo?
SELECT T1.CBSA_name, T1.CBSA_type FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T2.city = 'Cabo Rojo' GROUP BY T1.CBSA_name, T1.CBSA_type
name of the CBSA officer refers to CBSA_name; position of the CBSA officer refers to CBSA_type;
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Indicate the country name of the city Las Marias.
SELECT T1.county FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.city = 'Las Marias'
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
How many cities does congressman Pierluisi Pedro represent?
SELECT COUNT(DISTINCT T1.city) FROM zip_data AS T1 INNER JOIN zip_congress AS T2 ON T1.zip_code = T2.zip_code INNER JOIN congress AS T3 ON T2.district = T3.cognress_rep_id WHERE T3.first_name = 'Pierluisi' AND T3.last_name = 'Pedro'
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Provide the names of bad aliases in the city of Aguadilla.
SELECT T1.bad_alias FROM avoid AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.city = 'Aguadilla'
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Indicate the name of the congressman represent in Guanica.
SELECT T3.first_name, T3.last_name FROM zip_data AS T1 INNER JOIN zip_congress AS T2 ON T1.zip_code = T2.zip_code INNER JOIN congress AS T3 ON T2.district = T3.cognress_rep_id WHERE T1.city = 'Guanica'
name of congressman implies full name which refers to first_name, last_name; Guanica is the city;
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Which state has the most bad aliases?
SELECT T2.state FROM avoid AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code GROUP BY T2.state ORDER BY COUNT(T1.bad_alias) DESC LIMIT 1
the most bad aliases refer to MAX(COUNT(bad_alias));
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
What is the difference in the number of bad alias between Aguada city and Aguadilla city?
SELECT COUNT(CASE WHEN T2.city = 'Aguada' THEN T1.bad_alias ELSE NULL END) - COUNT(CASE WHEN T2.city = 'Aguadilla' THEN T1.bad_alias ELSE NULL END) AS DIFFERENCE FROM avoid AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code
SUBTRACT(COUNT(bad_alias where city = 'Aguada'), COUNT(bad_alias where city = 'Aguadilla'));
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Which state has greater than 50 CBSA officers of metro type?
SELECT T2.state FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T1.CBSA_type = 'Metro' GROUP BY T2.state HAVING COUNT(T1.CBSA_type) > 50
greater than 50 CBSA officers of metro type refers to COUNT(CBSA_type = 'Metro') > 50;
address
CREATE TABLE CBSA ( CBSA INTEGER primary key, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT primary key, name TEXT ); CREATE TABLE congress ( cognress_rep_id TEXT primary key, first_name TEXT, last_name ...
【DB_ID】 address 【Schema】 # Table: main.CBSA [ (CBSA:INTEGER, Primary Key, Examples: [10300, 10380, 10420]), (CBSA_name:TEXT, Examples: [Adrian, MI]), (CBSA_type:TEXT, Examples: [Micro, Metro]) ] # Table: main.alias [ (zip_code:INTEGER, Primary Key, Examples: [501, 544, 601]), (alias:TEXT, Examples: [Holtsville, Adjunta...
Provide the population of Arecibo in 2020.
SELECT SUM(T2.population_2020) FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.county = 'ARECIBO'
population of Arecibo in 2020 refers to SUM(population_2020) where county = 'ARECIBO';