problem
stringlengths
121
422
db_id
stringclasses
69 values
solution
stringlengths
23
804
Write SQL query to solve given problem: Please list the names of all the counties with at least one residential area that implements daylight saving.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
SELECT DISTINCT T2.county FROM zip_data AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code WHERE T1.daylight_savings = 'Yes'
Write SQL query to solve given problem: Please list the zip_codes of all the residential areas in Huntingdon county with over 30 employees.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
SELECT DISTINCT T1.zip_code FROM zip_data AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code WHERE T2.county = 'HUNTINGDON' AND T1.employees > 30
Write SQL query to solve given problem: Please list the Asian populations of all the residential areas with the bad alias "URB San Joaquin".. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
SELECT SUM(T1.asian_population) FROM zip_data AS T1 INNER JOIN avoid AS T2 ON T1.zip_code = T2.zip_code WHERE T2.bad_alias = 'URB San Joaquin'
Write SQL query to solve given problem: Among the residential areas with the bad alias "Internal Revenue Service", how many of them are in the Eastern time zone?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
SELECT COUNT(T1.zip_code) FROM zip_data AS T1 INNER JOIN avoid AS T2 ON T1.zip_code = T2.zip_code WHERE T2.bad_alias = 'Internal Revenue Service' AND T1.time_zone = 'Eastern'
Write SQL query to solve given problem: What is the bad alias of the residential area with the highest average house value?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
SELECT T2.bad_alias FROM zip_data AS T1 INNER JOIN avoid AS T2 ON T1.zip_code = T2.zip_code WHERE T1.avg_house_value = ( SELECT MAX(avg_house_value) FROM zip_data ) LIMIT 1
Write SQL query to solve given problem: Please list the bad alias of all the residential areas with a median female age of over 32.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
SELECT DISTINCT T2.bad_alias FROM zip_data AS T1 INNER JOIN avoid AS T2 ON T1.zip_code = T2.zip_code WHERE T1.female_median_age > 32
Write SQL query to solve given problem: What is the highest gender ratio of the residential areas in Arecibo county?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
SELECT CAST(T1.male_population AS REAL) / T1.female_population FROM zip_data AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code WHERE T2.county = 'ARECIBO' AND T1.female_population <> 0 ORDER BY 1 DESC LIMIT 1
Write SQL query to solve given problem: What is the average median female age of all the residential areas in the Arecibo county?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
SELECT SUM(T1.female_median_age) / COUNT(T1.zip_code) FROM zip_data AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code WHERE T2.county = 'ARECIBO'
Write SQL query to solve given problem: What is the area code of the city with the female median age over 32 years old?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
SELECT T1.area_code FROM area_code AS T1 INNER JOIN ZIP_Data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.female_median_age > 32 GROUP BY T1.area_code
Write SQL query to solve given problem: What is the alias of the city called Hartford?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
SELECT DISTINCT T2.alias FROM zip_data AS T1 INNER JOIN alias AS T2 ON T1.zip_code = T2.zip_code WHERE T1.city = 'Hartford'
Write SQL query to solve given problem: How many counties are there in Alabama?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
SELECT COUNT(T2.county) FROM state AS T1 INNER JOIN country AS T2 ON T1.abbreviation = T2.state WHERE T1.name = 'Alabama'
Write SQL query to solve given problem: How many post offices are there in New York?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
SELECT COUNT(DISTINCT T2.zip_code) FROM state AS T1 INNER JOIN zip_data AS T2 ON T1.abbreviation = T2.state WHERE T1.abbreviation = 'NY' AND T2.type = 'Post Office'
Write SQL query to solve given problem: What are the precise locations of the cities with an area code of 787?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
SELECT T2.latitude, T2.longitude FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.area_code = '787' GROUP BY T2.latitude, T2.longitude
Write SQL query to solve given problem: In California, how many delivery receptacles are there in the community post office that has the highest number of delivery receptacles?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
SELECT COUNT(*) FROM state AS T1 INNER JOIN zip_data AS T2 ON T1.abbreviation = T2.state WHERE T1.abbreviation = 'CA' AND T2.type LIKE '%Community Post Office%' AND T1.name = 'California' AND T2.state = 'CA'
Write SQL query to solve given problem: In which county can you find the city with the highest number of females?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
SELECT T4.county FROM zip_data AS T3 INNER JOIN country AS T4 ON T3.zip_code = T4.zip_code GROUP BY T4.county ORDER BY T3.female_population DESC LIMIT 1
Write SQL query to solve given problem: What are the names of the states whose postal point is not affiliated with any organization?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
SELECT DISTINCT T2.name FROM zip_data AS T1 INNER JOIN state AS T2 ON T1.state = T2.abbreviation WHERE T1.division IS NULL
Write SQL query to solve given problem: What is the difference in the most populated city of Allentown-Bethlehem-Easton, PA-NJ in 2020 against its population in 2010?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
SELECT T1.population_2020 - T1.population_2010 AS result_data FROM zip_data AS T1 INNER JOIN CBSA AS T2 ON T1.CBSA = T2.CBSA WHERE T2.CBSA_name = 'Allentown-Bethlehem-Easton, PA-NJ' ORDER BY T1.population_2020 DESC LIMIT 1
Write SQL query to solve given problem: List all the zip codes in the county of New Castle in Delaware.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
SELECT DISTINCT T2.zip_code FROM state AS T1 INNER JOIN country AS T2 ON T1.abbreviation = T2.state WHERE T2.county = 'NEW CASTLE' AND T1.name = 'Delaware'
Write SQL query to solve given problem: How many representatives are there in the state with the highest monthly benefit payments for retired workers?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
SELECT COUNT(T3.cognress_rep_id) FROM zip_data AS T1 INNER JOIN state AS T2 ON T1.state = T2.abbreviation INNER JOIN congress AS T3 ON T2.abbreviation = T3.abbreviation ORDER BY T1.monthly_benefits_retired_workers DESC LIMIT 1
Write SQL query to solve given problem: In the state where Lisa Murkowski is the representative, how many cities have zero employees?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: What are the top 3 states with the highest Asian population? List the full names of all the representatives in the said states.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: Which state is Outagamie County in? Give the full name of the state.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
SELECT DISTINCT T2.name FROM country AS T1 INNER JOIN state AS T2 ON T1.state = T2.abbreviation WHERE T1.county = 'OUTAGAMIE'
Write SQL query to solve given problem: What party does the area with the zip code 91701 belong to?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: How many males are there in New Haven County's residential areas?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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'
Write SQL query to solve given problem: Show the alias for the county at coordinate (18.090875, -66.867756).. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: For the city with the most elders, what's its area code?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: For the county represented by Thompson Bennie G, how many bad aliases does it have?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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'
Write SQL query to solve given problem: Give the location coordinates of the city with area code 636.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: Show the zip code of the county represented by Buchanan Vernon.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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'
Write SQL query to solve given problem: Which state is area code 878 in? Give the name of the state.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: How many counties are there in Virginia State?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
SELECT COUNT(T2.county) FROM state AS T1 INNER JOIN country AS T2 ON T1.abbreviation = T2.state WHERE T1.name = 'Virginia'
Write SQL query to solve given problem: Give the name and the position of the cbsa officer from the area with the zip code 45503.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: Tell the name of the county which is represented by Hartzler Vicky.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: Calculate the average male median age of all the residential areas in Windham county.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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'
Write SQL query to solve given problem: For the county where DeSantis Ron is from, what is the average female median age?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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'
Write SQL query to solve given problem: What is the area code of Bishopville, SC?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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'
Write SQL query to solve given problem: Name the bad alias of Geneva, AL.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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'
Write SQL query to solve given problem: Which city and state has the bad alias of Lawrenceville?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: Name both the alias and the bad alias of zip code 38015.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: What is the zip code of the district represented by Steven A King?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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'
Write SQL query to solve given problem: What is the CBSA name and type in York, ME?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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'
Write SQL query to solve given problem: List 10 cities with a median age over 40. Include their zip codes and area codes.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: Name the county that has the bad alias of Druid Hills.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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'
Write SQL query to solve given problem: What is the area code of Phillips county in Montana?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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'
Write SQL query to solve given problem: Which district has the largest land area in Wisconsin? Write the full name of the congress representative and include the postal codes.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: How many states are in the central time zone? Write their full names.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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'
Write SQL query to solve given problem: Name 10 cities with their states that are under the Lexington-Fayette, KY office of the Canada Border Services Agency.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: What is the percentage ratio between Democrats and Republicans in Indiana? List the zip codes belonging to Democrats.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: Calculate the ratio between the number of representatives in Alabama and the number of representatives in Illinois.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: Calculate the average of 2020's population in each zip code.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
SELECT CAST(SUM(population_2020) AS REAL) / COUNT(zip_code) FROM zip_data
Write SQL query to solve given problem: State the male population for all zip code which were under the Berlin, NH CBSA.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: Which CBSAs have more than 10 zip codes?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: List all the bad alias for zip codes in Puerto Rico.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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'
Write SQL query to solve given problem: What is the longitude and latitude for the district represented by Grayson Alan?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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'
Write SQL query to solve given problem: What is the state for area code of 787?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: List all representatives of districts which have more than 30 000 population in 2020.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: Which zip code in Massachusetts that have more than 1 area code?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: State the county for Arecibo City.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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'
Write SQL query to solve given problem: How many zip codes are under Barre, VT?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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'
Write SQL query to solve given problem: Among the zip code under Saint Croix county, which zip code has the biggest land area?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: Calculate the difference between the 2020 population and the 2010 population for the districts represented by Griffin Tim.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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'
Write SQL query to solve given problem: Based on the population in 2020, calculate the percentage for the population of Asian in the zip code where the CBSA was Atmore, AL.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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'
Write SQL query to solve given problem: Among the cities with an area code 939, which city has the highest Asian population?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: Give the name of the country and state of the city with elevation of 1039.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: Provide the alias and elevation of the city with zip code 1028.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: What is the area code of the city with the largest land area?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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 )
Write SQL query to solve given problem: Give the area code of the city with the white population ranging between 1700 to 2000.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: What is the Asian population in the city with the alias Leeds?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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'
Write SQL query to solve given problem: List down the area code and country of the city named Savoy.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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'
Write SQL query to solve given problem: What are the alias of the cities with 0 population in 2010?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: Among the cities with area code 608, how many cities implement daylight savings?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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'
Write SQL query to solve given problem: Provide the average elevation of the cities with alias Amherst.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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'
Write SQL query to solve given problem: What is the country and state of the city named Dalton?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: Give at least five alias of cities with a postal point of post office.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: 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?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: Among the cities belonging to the country named Arroyo, calculate the percentage of increase in the population in these cities from 2010 to 2020.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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'
Write SQL query to solve given problem: Among the postal points in Texas, provide the zip codes and cities of postal points which have total beneficiaries of above 10000.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: Among the postal points in the District of Columbia, how many of them have an area with above 20000 black population?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: Provide the city where zip code 19019 is located and the alias of that city.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: List the bad alias of the postal point located in Camuy.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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'
Write SQL query to solve given problem: Provide the zip code, city, and congress representative's full names of the area which has highest population in 2020.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: Among the daylight savings areas in the Midwest region, how many postal points are there in Illinois?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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'
Write SQL query to solve given problem: Provide the countries and the zip codes in the Virgin Islands.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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'
Write SQL query to solve given problem: Provide the zip codes and the alias of Greeneville.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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'
Write SQL query to solve given problem: Compare the numbers of postal points under Smith Adrian and Heck Joe.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: Provide the zip codes and CBSA officers of the postal point in Oxford.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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'
Write SQL query to solve given problem: Provide the zip codes and their affiliated organization for the postal point under Kingsport-Bristol, TN-VA.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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'
Write SQL query to solve given problem: Provide the zip codes and the congress representatives' names of the postal points which are affiliated with Readers Digest.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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'
Write SQL query to solve given problem: Among the postal points in California, calculate the percentage of them in post office types.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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'
Write SQL query to solve given problem: What are the zip code for the Senate house?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: Which city has the most bad aliases?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: List all the counties in Georgia.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: List all the locations of postal points with the area code "410".. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: What is the name of the CBSA of the city with the highest average house value?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: What are the bad aliases of the postal points from East Setauket?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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'
Write SQL query to solve given problem: What was the population of Wilcox County in 2010?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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'
Write SQL query to solve given problem: What is the code of the area with the largest Asian population?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: List all the cities with micro CBSA.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
SELECT T2.city FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T1.CBSA_type = 'Micro'
Write SQL query to solve given problem: What is the name of the state with the most counties?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: What is the number of households in the "FL-10" district?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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