Chinastark/bird_dataset huggingface dataset:
Database: address
Question: In the state where Lisa Murkowski is the representative, how many cities have zero employees?
Evidence: zero employee refers to employees = 0
SQL: SELECT COUNT(T3.city) FROM congress AS T1 INNER JOIN state AS T2 ON T1.abbreviation = T2.abbreviation INNER JOIN zip_data AS T3 ON T2.abbreviation = T3.state WHERE T1.first_name = 'Murkowski' AND T1.last_name = 'Lisa' AND T3.employees = 0
Database: address
Question: What are the top 3 states with the highest Asian population? List the full names of all the representatives in the said states.
Evidence: city with highest asian population refers to Max(Sum(asian_population)); full name refers to first_name, last_name
SQL: SELECT t.state, T1.first_name, T1.last_name FROM zip_data AS T INNER JOIN congress AS T1 ON t.state = T1.abbreviation GROUP BY t.state ORDER BY SUM(t.asian_population) DESC LIMIT 3
Database: address
Question: Which state is Outagamie County in? Give the full name of the state.
Evidence: "OUTAGAMIE" is the county
SQL: SELECT DISTINCT T2.name FROM country AS T1 INNER JOIN state AS T2 ON T1.state = T2.abbreviation WHERE T1.county = 'OUTAGAMIE'
Database: address
Question: What party does the area with the zip code 91701 belong to?
SQL: SELECT T1.party FROM congress AS T1 INNER JOIN state AS T2 ON T1.abbreviation = T2.abbreviation INNER JOIN zip_data AS T3 ON T2.abbreviation = T3.state WHERE T3.zip_code = 91701 GROUP BY T1.party
Database: address
Question: How many males are there in New Haven County's residential areas?
Evidence: "NEW HAVEN" is the county; male refers to male_population
SQL: SELECT SUM(T1.male_population) FROM zip_data AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code WHERE T2.county = 'NEW HAVEN'
Database: address
Question: Show the alias for the county at coordinate (18.090875, -66.867756).
Evidence: coordinates refers to latitude, longitude; latitude = '18.090875; longitude = '-66.867756'
SQL: SELECT T2.alias FROM zip_data AS T1 INNER JOIN alias AS T2 ON T1.zip_code = T2.zip_code WHERE T1.latitude = 18.090875 AND T1.longitude = -66.867756
Database: address
Question: For the city with the most elders, what's its area code?
Evidence: city with most elders refers to Max(over_65)
SQL: SELECT T2.area_code FROM zip_data AS T1 INNER JOIN area_code AS T2 ON T1.zip_code = T2.zip_code GROUP BY T2.area_code ORDER BY T1.over_65 DESC LIMIT 1
Database: address
Question: For the county represented by Thompson Bennie G, how many bad aliases does it have?
SQL: SELECT COUNT(DISTINCT T2.bad_alias) FROM zip_congress AS T1 INNER JOIN avoid AS T2 ON T1.zip_code = T2.zip_code INNER JOIN congress AS T3 ON T1.district = T3.cognress_rep_id WHERE T3.first_name = 'Thompson' AND T3.last_name = 'Bennie G'
Database: address
Question: Give the location coordinates of the city with area code 636.
Evidence: location coordinate refers to (latitude, longitude)
SQL: SELECT T2.latitude, T2.longitude FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.area_code = 636
Database: address
Question: Show the zip code of the county represented by Buchanan Vernon.
SQL: SELECT T2.zip_code FROM congress AS T1 INNER JOIN zip_congress AS T2 ON T1.cognress_rep_id = T2.district WHERE T1.first_name = 'Buchanan' AND T1.last_name = 'Vernon'
Database: address
Question: Which state is area code 878 in? Give the name of the state.
SQL: SELECT T2.state FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.area_code = 878
Database: address
Question: How many counties are there in Virginia State?
Evidence: "Virginia" is the state
SQL: SELECT COUNT(T2.county) FROM state AS T1 INNER JOIN country AS T2 ON T1.abbreviation = T2.state WHERE T1.name = 'Virginia'
Database: address
Question: Give the name and the position of the cbsa officer from the area with the zip code 45503.
Evidence: position refers to latitude, longitude
SQL: SELECT T1.CBSA_name, T2.latitude, T2.longitude FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T2.zip_code = 45503 GROUP BY T1.CBSA_name, T2.latitude, T2.longitude
Database: address
Question: Tell the name of the county which is represented by Hartzler Vicky.
Evidence: name of county refers to county
SQL: SELECT T1.county FROM country AS T1 INNER JOIN zip_congress AS T2 ON T1.zip_code = T2.zip_code INNER JOIN congress AS T3 ON T2.district = T3.cognress_rep_id WHERE T3.first_name = 'Hartzler' AND T3.last_name = 'Vicky' GROUP BY T1.county
Database: address
Question: Calculate the average male median age of all the residential areas in Windham county.
Evidence: average male median age refers to Divide (Sum(male_median_age), Count(county)); 'WINDHAM' is the county
SQL: SELECT SUM(T2.male_median_age) / COUNT(T2.median_age) FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.county = 'WINDHAM'
Database: address
Question: For the county where DeSantis Ron is from, what is the average female median age?
Evidence: average female median age refers to Divide (Sum(female_median_age), Count(county))
SQL: SELECT SUM(T4.female_median_age) / COUNT(T1.county) FROM country AS T1 INNER JOIN zip_congress AS T2 ON T1.zip_code = T2.zip_code INNER JOIN congress AS T3 ON T2.district = T3.cognress_rep_id INNER JOIN zip_data AS T4 ON T1.zip_code = T4.zip_code WHERE T3.first_name = 'DeSantis' AND T3.last_name = 'Ron'
Database: address
Question: What is the area code of Bishopville, SC?
Evidence: "Bishopville" is the city; 'SC' is the state
SQL: SELECT T1.area_code FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.city = 'Bishopville' AND T2.state = 'SC'
Database: address
Question: Name the bad alias of Geneva, AL.
Evidence: "Geneva" is the city; 'AL' is the state
SQL: SELECT T1.bad_alias FROM avoid AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.city = 'Geneva' AND T2.state = 'AL'
Database: address
Question: Which city and state has the bad alias of Lawrenceville?
Evidence: "Lawrenceville" is the bad_alias
SQL: SELECT T2.city, T2.state FROM avoid AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.bad_alias = 'Lawrenceville' GROUP BY T2.city, T2.state
Database: address
Question: Name both the alias and the bad alias of zip code 38015.
SQL: 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
Database: address
Question: What is the zip code of the district represented by Steven A King?
SQL: 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'
Database: address
Question: What is the CBSA name and type in York, ME?
Evidence: "York" is the city; 'ME' is the state; type refers to CBSA_type
SQL: 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'
Database: address
Question: List 10 cities with a median age over 40. Include their zip codes and area codes.
Evidence: median age over 40 refers to median_age > 40
SQL: 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
Database: address
Question: Name the county that has the bad alias of Druid Hills.
Evidence: "Druid Hills" is the bad_alias
SQL: 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'
Database: address
Question: What is the area code of Phillips county in Montana?
Evidence: "PHILLIPS" is the county; 'Montana' is the name of state
SQL: 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'
Database: address
Question: Which district has the largest land area in Wisconsin? Write the full name of the congress representative and include the postal codes.
Evidence: "Wisconsin" is the state; largest land area refers to Max(land_area); full name refers to first_name, last_name; postal code refers to zip_code
SQL: 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
Database: address
Question: How many states are in the central time zone? Write their full names.
Evidence: central time zone refers to time_zone = 'Central'
SQL: 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'
Database: address
Question: Name 10 cities with their states that are under the Lexington-Fayette, KY office of the Canada Border Services Agency.
Evidence: "Lexington-Fayette, KY" is the CBSA_name
SQL: 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
Database: address
Question: What is the percentage ratio between Democrats and Republicans in Indiana? List the zip codes belonging to Democrats.
Evidence: "Democrats" and "Republicans" refers to party = 'Democrat" and party = 'Republican'; percentage ratio = Multiply (Divide (Count(party = 'Democrat"), Count(party = 'Republican')), 100)
SQL: 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
Database: address
Question: Calculate the ratio between the number of representatives in Alabama and the number of representatives in Illinois.
Evidence: "Alabama" and "Illinois" are both state; Ratio = Divide (Count(state = 'Alabama'), Count(state = 'Illinois'))
SQL: 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
Database: address
Question: Calculate the average of 2020's population in each zip code.
Evidence: average of 2020 population in each zip code refers to Divide (Sum(population_2020), Count(zip_code))
SQL: SELECT CAST(SUM(population_2020) AS REAL) / COUNT(zip_code) FROM zip_data
Database: address
Question: State the male population for all zip code which were under the Berlin, NH CBSA.
Evidence: "Berlin, NH" is the CBSA_name
SQL: 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
Database: address
Question: Which CBSAs have more than 10 zip codes?
Evidence: has more than 10 zip codes refers to CBSA where count(CBSA) > 10
SQL: 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
Database: address
Question: List all the bad alias for zip codes in Puerto Rico.
Evidence: "Puerto Rico" refers to state = 'PR'
SQL: 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'
Database: address
Question: What is the longitude and latitude for the district represented by Grayson Alan?
SQL: 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'
Database: address
Question: What is the state for area code of 787?
SQL: 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
Database: address
Question: List all representatives of districts which have more than 30 000 population in 2020.
Evidence: more than 30000 population in 2020 refers to population_2020 > 30000; representative refers to first_name, last_name
SQL: 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
Database: address
Question: Which zip code in Massachusetts that have more than 1 area code?
Evidence: "Massachusetts" is the state; zip code more than 1 area code refers to Count (zip_code) > 1
SQL: 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
Database: address
Question: State the county for Arecibo City.
Evidence: "Arecibo" is the city
SQL: 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'
Database: address
Question: How many zip codes are under Barre, VT?
Evidence: "Barre, VT" is the CBSA_name
SQL: 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'
Database: address
Question: Among the zip code under Saint Croix county, which zip code has the biggest land area?
Evidence: biggest land area refers to Max(land_area); "SAINT CROIX" is the county
SQL: 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
Database: address
Question: Calculate the difference between the 2020 population and the 2010 population for the districts represented by Griffin Tim.
Evidence: difference = Subtract (population_2020, population_2010)
SQL: 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'
Database: address
Question: Based on the population in 2020, calculate the percentage for the population of Asian in the zip code where the CBSA was Atmore, AL.
Evidence: "Atmore, AL" is CBSA_name; percentage = Divide(asian_population, population_2020) * 100
SQL: 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'
Database: address
Question: Among the cities with an area code 939, which city has the highest Asian population?
Evidence: highest asian population refers to Max(asian_population)
SQL: 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
Database: address
Question: Give the name of the country and state of the city with elevation of 1039.
Evidence: elevation of 1039 refers to elevation = 1039
SQL: 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
Database: address
Question: Provide the alias and elevation of the city with zip code 1028.
SQL: 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
Database: address
Question: What is the area code of the city with the largest land area?
Evidence: largest land area refers to Max(land_area)
SQL: 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 )
Database: address
Question: Give the area code of the city with the white population ranging between 1700 to 2000.
SQL: 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
Database: address
Question: What is the Asian population in the city with the alias Leeds?
SQL: 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'
Database: address
Question: List down the area code and country of the city named Savoy.
Evidence: Savoy is the city;
SQL: 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'
Database: address
Question: What are the alias of the cities with 0 population in 2010?
Evidence: with 0 population in 2010 refers to population_2010 = 0;
SQL: 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
Database: address
Question: Among the cities with area code 608, how many cities implement daylight savings?
Evidence: implement daylight savings refers to daylight_savings = 'Yes';
SQL: 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'
Database: address
Question: Provide the average elevation of the cities with alias Amherst.
Evidence: AVG(elevation) where alias = 'Amherst';
SQL: 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'
Database: address
Question: What is the country and state of the city named Dalton?
Evidence: Dalton is the city;
SQL: 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
Database: address
Question: Give at least five alias of cities with a postal point of post office.
Evidence: postal point of post office refers to type = 'Post Office';
SQL: 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
Database: address
Question: 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?
Evidence: SUBTRACT(COUNT(type = 'P.O. Box Only'), COUNT(type = 'Post Office')) where area_code = 787;
SQL: 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
Database: address
Question: Among the cities belonging to the country named Arroyo, calculate the percentage of increase in the population in these cities from 2010 to 2020.
Evidence: DIVIDE(SUBTRACT(SUM(population_2020)), SUM(population_2010)), SUM(population_2010) as percentage where county = 'ARROYO';
SQL: 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'
Database: address
Question: Among the postal points in Texas, provide the zip codes and cities of postal points which have total beneficiaries of above 10000.
Evidence: Texas is the name of the state, in which name = 'Texas'; total beneficiaries of above 10000 refer to total_beneficiaries > 10000;
SQL: 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
Database: address
Question: Among the postal points in the District of Columbia, how many of them have an area with above 20000 black population?
Evidence: District of Columbia refers to county = 'DISTRICT OF COLUMBIA'; postal points refer to zip_code; area with above 20000 black population refers to black_population > 20000;
SQL: 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
Database: address
Question: Provide the city where zip code 19019 is located and the alias of that city.
SQL: 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
Database: address
Question: List the bad alias of the postal point located in Camuy.
Evidence: postal points refer to zip_code; Camuy is the city;
SQL: 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'
Database: address
Question: Provide the zip code, city, and congress representative's full names of the area which has highest population in 2020.
Evidence: representative's full names refer to first_name, last_name; area which has highest population in 2020 refers to MAX(population_2020);
SQL: 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
Database: address
Question: Among the daylight savings areas in the Midwest region, how many postal points are there in Illinois?
Evidence: postal points refer to zip_code; the daylight savings areas refer to daylight_savings = 'Yes'; Illinois is the name of the state, in which name = 'Illinois';
SQL: 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'
Database: address
Question: Provide the countries and the zip codes in the Virgin Islands.
Evidence: the Virgin Islands refer to state where name = 'Virgin Islands';
SQL: 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'
Database: address
Question: Provide the zip codes and the alias of Greeneville.
Evidence: Greeneville is the city;
SQL: 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'
Database: address
Question: Compare the numbers of postal points under Smith Adrian and Heck Joe.
Evidence: COUNT(zip_code where first_name = 'Smith' and last_name = 'Adrian') > COUNT(zip_code where first_name = 'Heck' and last_name = 'Joe');
SQL: 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
Database: address
Question: Provide the zip codes and CBSA officers of the postal point in Oxford.
Evidence: CBSA officers refer to CBSA_name; postal point refers to zip_code; Oxford is the city;
SQL: 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'
Database: address
Question: Provide the zip codes and their affiliated organization for the postal point under Kingsport-Bristol, TN-VA.
Evidence: postal point under Kingsport-Bristol, TN-VA refers to zip_code where CBSA_name = 'Kingsport-Bristol, TN-VA'; affiliated organization refers to organization from CBSA;
SQL: 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'
Database: address
Question: Provide the zip codes and the congress representatives' names of the postal points which are affiliated with Readers Digest.
Evidence: representative's full names refer to first_name, last_name; postal points affiliated with Readers Digest refer to zip_code where organization = 'Readers Digest';
SQL: 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'
Database: address
Question: Among the postal points in California, calculate the percentage of them in post office types.
Evidence: DIVIDE(COUNT(zip_code where type = 'Post Office'), COUNT(zip_code)) as percentage where name = 'California';
SQL: 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'