context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
Calculate the average of 2020's population in each zip code.
SELECT CAST(SUM(population_2020) AS REAL) / COUNT(zip_code) FROM zip_data
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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 )
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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 zip_congress AS T2 ON T1.cognress_rep_id = T2.district
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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 )
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
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'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
Indicate the name of the country with a population greater than 10000 in 2010.
SELECT DISTINCT T1.county FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.population_2010 > 10000
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
Name the country with the largest number of households in a residential area.
SELECT T1.county FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code GROUP BY T1.county ORDER BY T2.households DESC LIMIT 1
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
Calculate the percentage of households in residential areas of countries over 10000.
SELECT CAST(COUNT(CASE WHEN T2.households > 10000 THEN T1.zip_code ELSE NULL END) AS REAL) * 100 / COUNT(T1.zip_code) FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
Among the types of postal points in Saint Croix, what percentage of postal points is the post office?
SELECT CAST(COUNT(CASE WHEN T2.type = 'Post Office' THEN T1.zip_code ELSE NULL END) AS REAL) * 100 / COUNT(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'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
Among the area code 787, list the country of the cities with a postal point type of unique postal office.
SELECT DISTINCT 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 T1.area_code = '787' AND T3.type = 'Unique Post Office'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
What is the elevation of the city with the alias East Longmeadow?
SELECT T2.elevation FROM alias AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.alias = 'East Longmeadow'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
In cities that do not implement daylight savings, what is the total number of cities?
SELECT COUNT(T1.area_code) FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.daylight_savings = 'No'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
Give the country and area code of the city with zip code 1116.
SELECT T2.county, T1.area_code FROM area_code AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code WHERE T1.zip_code = 1116
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
Among the cities with alias St Thomas, provide the type of postal point for each city.
SELECT DISTINCT T2.type FROM alias AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.alias = 'St Thomas'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
List down the names of the cities belonging to Noble, Oklahoma.
SELECT T3.city 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 T1.name = 'Oklahoma' AND T2.county = 'NOBLE'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
Among the listed cities, provide the area code of the city with the largest water 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.water_area = ( SELECT MAX(water_area) FROM zip_data )
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
Provide the alias of the city with the highest population in year 2020.
SELECT T1.alias FROM alias AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.population_2020 = ( SELECT MAX(population_2020) FROM zip_data )
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
What is the elevation of the city belonging to Hampden, Massachusetts?
SELECT T3.elevation 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 T1.name = 'Massachusetts' AND T2.county = 'HAMPDEN' GROUP BY T3.elevation
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
List the area code of the city with the highest Hispanic population.
SELECT T1.area_code FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.hispanic_population = ( SELECT MAX(hispanic_population) FROM zip_data )
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
Give the alias of the cities with an Asian population of 7.
SELECT T1.alias FROM alias AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.asian_population = 7
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
What is the average of the white population in the cities with area code 920?
SELECT AVG(T2.white_population) FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.area_code = 920
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
Among the cities with alias Ponce, what is the percentage of cities with a country level FIPS code of less than 20?
SELECT CAST(COUNT(CASE WHEN T2.county_fips < 20 THEN T2.zip_code ELSE NULL END) AS REAL) * 100 / COUNT(T2.zip_code) FROM alias AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.alias = 'Ponce'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
List down the country of the cities with a population greater than 97% of the average population of all countries in 2020.
SELECT T1.county FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.population_2020 > 0.97 * ( SELECT AVG(population_2020) FROM zip_data )
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
Count the number of postal points in the district represented by Kirkpatrick Ann.
SELECT COUNT(T2.zip_code) FROM congress AS T1 INNER JOIN zip_congress AS T2 ON T1.cognress_rep_id = T2.district WHERE T1.first_name = 'Kirkpatrick' AND T1.last_name = 'Ann'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
Provide the zip codes and coordinates of the postal points under Allentown-Bethlehem-Easton, PA-NJ.
SELECT T2.zip_code, T2.latitude, T2.longitude FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T1.CBSA_name = 'Allentown-Bethlehem-Easton, PA-NJ'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
Provide the zip codes, cities, and locations of the postal points that have Shared Reshipper as a bad alias.
SELECT T1.zip_code, T2.city, T2.latitude, T2.longitude FROM avoid AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.bad_alias = 'Shared Reshipper'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
Who are the congress representatives of the postal points in Garfield?
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 = 'Garfield'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
Count the number of postal points under New York-Newark-Jersey City, NY-NJ-PA.
SELECT COUNT(T2.zip_code) FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T1.CBSA_name = 'New York-Newark-Jersey City, NY-NJ-PA'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
How many postal points are there under the congress representative in Puerto Rico?
SELECT COUNT(T2.zip_code) FROM congress AS T1 INNER JOIN zip_congress AS T2 ON T1.cognress_rep_id = T2.district WHERE T1.state = 'Puerto Rico'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
Describe the number of postal points and the countries in West Virginia.
SELECT COUNT(DISTINCT T2.zip_code), COUNT(DISTINCT T2.county) FROM state AS T1 INNER JOIN country AS T2 ON T1.abbreviation = T2.state WHERE T1.name = 'West Virginia'
bird
CREATE TABLE address (CBSA integer, CBSA_name text, CBSA_type text, abbreviation text, name text, cognress_rep_id text, first_name text, last_name text, CID text, party text, state text, abbreviation text, House text, District integer, land_area real, zip_code integer, city text, state text, multi_county text, type text, organization text, time_zone text, daylight_savings text, latitude real, longitude real, elevation integer, state_fips integer, county_fips integer, region text, division text, population_2020 integer, population_2010 integer, households integer, avg_house_value integer, avg_income_per_household integer, persons_per_household real, white_population integer, black_population integer, hispanic_population integer, asian_population integer, american_indian_population integer, hawaiian_population integer, other_population integer, male_population integer, female_population integer, median_age real, male_median_age real, female_median_age real, residential_mailboxes integer, business_mailboxes integer, total_delivery_receptacles integer, businesses integer, 1st_quarter_payroll integer, annual_payroll integer, employees integer, water_area real, land_area real, single_family_delivery_units integer, multi_family_delivery_units integer, total_beneficiaries integer, retired_workers integer, disabled_workers integer, parents_and_widowed integer, spouses integer, children integer, over_65 integer, monthly_benefits_all integer, monthly_benefits_retired_workers integer, monthly_benefits_widowed integer, CBSA integer, zip_code integer, alias text, zip_code integer, area_code integer, zip_code integer, bad_alias text, zip_code integer, county text, state text, zip_code integer, district text)
Provide the zip codes and area codes of the postal points with the community post office type at the elevation above 6000.
SELECT T1.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.type = 'Community Post Office ' AND T2.elevation > 6000
bird