db_id stringlengths 4 31 | SQL stringlengths 18 1.45k | input_sequence stringlengths 148 11k | question stringlengths 16 325 |
|---|---|---|---|
storm_record | select name , dates_active , number_deaths from storm where number_deaths >= 1 | Question: list name, dates active, and number of deaths for all storms with at least 1 death. | Tables: storm -> Storm_ID, Name, Dates_active, Max_speed, Damage_millions_USD, Number_Deaths. region -> Region_id, Region_code, Region_name. affected_region -> Region_id, Storm_ID, Number_city_affected. | Joins: affected_reg... | list name, dates active, and number of deaths for all storms with at least 1 death. |
storm_record | select name , dates_active , number_deaths from storm where number_deaths >= 1 | Question: what are the names, dates active, and number of deaths for storms that had 1 or more death? | Tables: storm -> Storm_ID, Name, Dates_active, Max_speed, Damage_millions_USD, Number_Deaths. region -> Region_id, Region_code, Region_name. affected_region -> Region_id, Storm_ID, Number_city_affected. | Joins: affe... | what are the names, dates active, and number of deaths for storms that had 1 or more death? |
storm_record | select avg(damage_millions_usd) , max(damage_millions_usd) from storm where max_speed > 1000 | Question: show the average and maximum damage for all storms with max speed higher than 1000. | Tables: storm -> Storm_ID, Name, Dates_active, Max_speed, Damage_millions_USD, Number_Deaths. region -> Region_id, Region_code, Region_name. affected_region -> Region_id, Storm_ID, Number_city_affected. | Joins: affected_reg... | show the average and maximum damage for all storms with max speed higher than 1000. |
storm_record | select avg(damage_millions_usd) , max(damage_millions_usd) from storm where max_speed > 1000 | Question: what is the average and maximum damage in millions for storms that had a max speed over 1000? | Tables: storm -> Storm_ID, Name, Dates_active, Max_speed, Damage_millions_USD, Number_Deaths. region -> Region_id, Region_code, Region_name. affected_region -> Region_id, Storm_ID, Number_city_affected. | Joins: af... | what is the average and maximum damage in millions for storms that had a max speed over 1000? |
storm_record | select sum(number_deaths) , sum(damage_millions_usd) from storm where max_speed > (select avg(max_speed) from storm) | Question: what is the total number of deaths and damage for all storms with a max speed greater than the average? | Tables: storm -> Storm_ID, Name, Dates_active, Max_speed, Damage_millions_USD, Number_Deaths. region -> Region_id, Region_code, Region_name. affected_region -> Region_id, Storm_ID, Number_city_affected. |... | what is the total number of deaths and damage for all storms with a max speed greater than the average? |
storm_record | select sum(number_deaths) , sum(damage_millions_usd) from storm where max_speed > (select avg(max_speed) from storm) | Question: return the total number of deaths and total damange in millions for storms that had a max speed greater than the average. | Tables: storm -> Storm_ID, Name, Dates_active, Max_speed, Damage_millions_USD, Number_Deaths. region -> Region_id, Region_code, Region_name. affected_region -> Region_id, Storm_ID, Numbe... | return the total number of deaths and total damange in millions for storms that had a max speed greater than the average. |
storm_record | select name , damage_millions_usd from storm order by max_speed desc | Question: list name and damage for all storms in a descending order of max speed. | Tables: storm -> Storm_ID, Name, Dates_active, Max_speed, Damage_millions_USD, Number_Deaths. region -> Region_id, Region_code, Region_name. affected_region -> Region_id, Storm_ID, Number_city_affected. | Joins: affected_region.Storm_ID... | list name and damage for all storms in a descending order of max speed. |
storm_record | select name , damage_millions_usd from storm order by max_speed desc | Question: what are the names and damage in millions for storms, ordered by their max speeds descending? | Tables: storm -> Storm_ID, Name, Dates_active, Max_speed, Damage_millions_USD, Number_Deaths. region -> Region_id, Region_code, Region_name. affected_region -> Region_id, Storm_ID, Number_city_affected. | Joins: af... | what are the names and damage in millions for storms, ordered by their max speeds descending? |
storm_record | select count(distinct region_id) from affected_region | Question: how many regions are affected? | Tables: storm -> Storm_ID, Name, Dates_active, Max_speed, Damage_millions_USD, Number_Deaths. region -> Region_id, Region_code, Region_name. affected_region -> Region_id, Storm_ID, Number_city_affected. | Joins: affected_region.Storm_ID = storm.Storm_ID, affected_region.Region... | how many regions are affected? |
storm_record | select count(distinct region_id) from affected_region | Question: count the number of different affected regions. | Tables: storm -> Storm_ID, Name, Dates_active, Max_speed, Damage_millions_USD, Number_Deaths. region -> Region_id, Region_code, Region_name. affected_region -> Region_id, Storm_ID, Number_city_affected. | Joins: affected_region.Storm_ID = storm.Storm_ID, affec... | count the number of different affected regions. |
storm_record | select region_name from region where region_id not in (select region_id from affected_region) | Question: show the name for regions not affected. | Tables: storm -> Storm_ID, Name, Dates_active, Max_speed, Damage_millions_USD, Number_Deaths. region -> Region_id, Region_code, Region_name. affected_region -> Region_id, Storm_ID, Number_city_affected. | Joins: affected_region.Storm_ID = storm.Storm_ID, affected_regi... | show the name for regions not affected. |
storm_record | select region_name from region where region_id not in (select region_id from affected_region) | Question: what are the names of regions that were not affected? | Tables: storm -> Storm_ID, Name, Dates_active, Max_speed, Damage_millions_USD, Number_Deaths. region -> Region_id, Region_code, Region_name. affected_region -> Region_id, Storm_ID, Number_city_affected. | Joins: affected_region.Storm_ID = storm.Storm_ID,... | what are the names of regions that were not affected? |
storm_record | select t1.region_name , count(*) from region as t1 join affected_region as t2 on t1.region_id = t2.region_id group by t1.region_id | Question: show the name for regions and the number of storms for each region. | Tables: storm -> Storm_ID, Name, Dates_active, Max_speed, Damage_millions_USD, Number_Deaths. region -> Region_id, Region_code, Region_name. affected_region -> Region_id, Storm_ID, Number_city_affected. | Joins: affected_region.Storm_ID = s... | show the name for regions and the number of storms for each region. |
storm_record | select t1.region_name , count(*) from region as t1 join affected_region as t2 on t1.region_id = t2.region_id group by t1.region_id | Question: how many storms occured in each region? | Tables: storm -> Storm_ID, Name, Dates_active, Max_speed, Damage_millions_USD, Number_Deaths. region -> Region_id, Region_code, Region_name. affected_region -> Region_id, Storm_ID, Number_city_affected. | Joins: affected_region.Storm_ID = storm.Storm_ID, affected_regi... | how many storms occured in each region? |
storm_record | select t1.name , count(*) from storm as t1 join affected_region as t2 on t1.storm_id = t2.storm_id group by t1.storm_id | Question: list the name for storms and the number of affected regions for each storm. | Tables: storm -> Storm_ID, Name, Dates_active, Max_speed, Damage_millions_USD, Number_Deaths. region -> Region_id, Region_code, Region_name. affected_region -> Region_id, Storm_ID, Number_city_affected. | Joins: affected_region.Stor... | list the name for storms and the number of affected regions for each storm. |
storm_record | select t1.name , count(*) from storm as t1 join affected_region as t2 on t1.storm_id = t2.storm_id group by t1.storm_id | Question: how many regions were affected by each storm? | Tables: storm -> Storm_ID, Name, Dates_active, Max_speed, Damage_millions_USD, Number_Deaths. region -> Region_id, Region_code, Region_name. affected_region -> Region_id, Storm_ID, Number_city_affected. | Joins: affected_region.Storm_ID = storm.Storm_ID, affecte... | how many regions were affected by each storm? |
storm_record | select t1.name , t1.max_speed from storm as t1 join affected_region as t2 on t1.storm_id = t2.storm_id group by t1.storm_id order by count(*) desc limit 1 | Question: what is the storm name and max speed which affected the greatest number of regions? | Tables: storm -> Storm_ID, Name, Dates_active, Max_speed, Damage_millions_USD, Number_Deaths. region -> Region_id, Region_code, Region_name. affected_region -> Region_id, Storm_ID, Number_city_affected. | Joins: affected_reg... | what is the storm name and max speed which affected the greatest number of regions? |
storm_record | select t1.name , t1.max_speed from storm as t1 join affected_region as t2 on t1.storm_id = t2.storm_id group by t1.storm_id order by count(*) desc limit 1 | Question: return the name and max speed of the storm that affected the most regions. | Tables: storm -> Storm_ID, Name, Dates_active, Max_speed, Damage_millions_USD, Number_Deaths. region -> Region_id, Region_code, Region_name. affected_region -> Region_id, Storm_ID, Number_city_affected. | Joins: affected_region.Storm... | return the name and max speed of the storm that affected the most regions. |
storm_record | select name from storm where storm_id not in (select storm_id from affected_region) | Question: show the name of storms which don't have affected region in record. | Tables: storm -> Storm_ID, Name, Dates_active, Max_speed, Damage_millions_USD, Number_Deaths. region -> Region_id, Region_code, Region_name. affected_region -> Region_id, Storm_ID, Number_city_affected. | Joins: affected_region.Storm_ID = s... | show the name of storms which don't have affected region in record. |
storm_record | select name from storm where storm_id not in (select storm_id from affected_region) | Question: what are the names of storms that did not affect any regions? | Tables: storm -> Storm_ID, Name, Dates_active, Max_speed, Damage_millions_USD, Number_Deaths. region -> Region_id, Region_code, Region_name. affected_region -> Region_id, Storm_ID, Number_city_affected. | Joins: affected_region.Storm_ID = storm.S... | what are the names of storms that did not affect any regions? |
storm_record | select t1.name from storm as t1 join affected_region as t2 on t1.storm_id = t2.storm_id group by t1.storm_id having count(*) >= 2 intersect select t1.name from storm as t1 join affected_region as t2 on t1.storm_id = t2.storm_id group by t1.storm_id having sum(t2.number_city_affected) >= 10 | Question: show storm name with at least two regions and 10 cities affected. | Tables: storm -> Storm_ID, Name, Dates_active, Max_speed, Damage_millions_USD, Number_Deaths. region -> Region_id, Region_code, Region_name. affected_region -> Region_id, Storm_ID, Number_city_affected. | Joins: affected_region.Storm_ID = sto... | show storm name with at least two regions and 10 cities affected. |
storm_record | select t1.name from storm as t1 join affected_region as t2 on t1.storm_id = t2.storm_id group by t1.storm_id having count(*) >= 2 intersect select t1.name from storm as t1 join affected_region as t2 on t1.storm_id = t2.storm_id group by t1.storm_id having sum(t2.number_city_affected) >= 10 | Question: what are the names of storms that both affected two or more regions and affected a total of 10 or more cities? | Tables: storm -> Storm_ID, Name, Dates_active, Max_speed, Damage_millions_USD, Number_Deaths. region -> Region_id, Region_code, Region_name. affected_region -> Region_id, Storm_ID, Number_city_affe... | what are the names of storms that both affected two or more regions and affected a total of 10 or more cities? |
storm_record | select name from storm except select t1.name from storm as t1 join affected_region as t2 on t1.storm_id = t2.storm_id group by t1.storm_id having count(*) >= 2 | Question: show all storm names except for those with at least two affected regions. | Tables: storm -> Storm_ID, Name, Dates_active, Max_speed, Damage_millions_USD, Number_Deaths. region -> Region_id, Region_code, Region_name. affected_region -> Region_id, Storm_ID, Number_city_affected. | Joins: affected_region.Storm_... | show all storm names except for those with at least two affected regions. |
storm_record | select name from storm except select t1.name from storm as t1 join affected_region as t2 on t1.storm_id = t2.storm_id group by t1.storm_id having count(*) >= 2 | Question: what are the names of storms that did not affect two or more regions? | Tables: storm -> Storm_ID, Name, Dates_active, Max_speed, Damage_millions_USD, Number_Deaths. region -> Region_id, Region_code, Region_name. affected_region -> Region_id, Storm_ID, Number_city_affected. | Joins: affected_region.Storm_ID =... | what are the names of storms that did not affect two or more regions? |
storm_record | select t2.region_name from affected_region as t1 join region as t2 on t1.region_id = t2.region_id join storm as t3 on t1.storm_id = t3.storm_id where t3.number_deaths >= 10 | Question: what are the region names affected by the storm with a number of deaths of least 10? | Tables: storm -> Storm_ID, Name, Dates_active, Max_speed, Damage_millions_USD, Number_Deaths. region -> Region_id, Region_code, Region_name. affected_region -> Region_id, Storm_ID, Number_city_affected. | Joins: affected_re... | what are the region names affected by the storm with a number of deaths of least 10? |
storm_record | select t2.region_name from affected_region as t1 join region as t2 on t1.region_id = t2.region_id join storm as t3 on t1.storm_id = t3.storm_id where t3.number_deaths >= 10 | Question: return the names of the regions affected by storms that had a death count of at least 10. | Tables: storm -> Storm_ID, Name, Dates_active, Max_speed, Damage_millions_USD, Number_Deaths. region -> Region_id, Region_code, Region_name. affected_region -> Region_id, Storm_ID, Number_city_affected. | Joins: affect... | return the names of the regions affected by storms that had a death count of at least 10. |
storm_record | select t3.name from affected_region as t1 join region as t2 on t1.region_id = t2.region_id join storm as t3 on t1.storm_id = t3.storm_id where t2.region_name = 'denmark' | Question: show all storm names affecting region 'denmark'. | Tables: storm -> Storm_ID, Name, Dates_active, Max_speed, Damage_millions_USD, Number_Deaths. region -> Region_id, Region_code, Region_name. affected_region -> Region_id, Storm_ID, Number_city_affected. | Joins: affected_region.Storm_ID = storm.Storm_ID, affe... | show all storm names affecting region 'denmark'. |
storm_record | select t3.name from affected_region as t1 join region as t2 on t1.region_id = t2.region_id join storm as t3 on t1.storm_id = t3.storm_id where t2.region_name = 'denmark' | Question: what are the names of the storms that affected denmark? | Tables: storm -> Storm_ID, Name, Dates_active, Max_speed, Damage_millions_USD, Number_Deaths. region -> Region_id, Region_code, Region_name. affected_region -> Region_id, Storm_ID, Number_city_affected. | Joins: affected_region.Storm_ID = storm.Storm_I... | what are the names of the storms that affected denmark? |
storm_record | select t1.region_name from region as t1 join affected_region as t2 on t1.region_id = t2.region_id group by t1.region_id having count(*) >= 2 | Question: show the region name with at least two storms. | Tables: storm -> Storm_ID, Name, Dates_active, Max_speed, Damage_millions_USD, Number_Deaths. region -> Region_id, Region_code, Region_name. affected_region -> Region_id, Storm_ID, Number_city_affected. | Joins: affected_region.Storm_ID = storm.Storm_ID, affect... | show the region name with at least two storms. |
storm_record | select t1.region_name from region as t1 join affected_region as t2 on t1.region_id = t2.region_id group by t1.region_id having count(*) >= 2 | Question: what are the names of regions with two or more storms? | Tables: storm -> Storm_ID, Name, Dates_active, Max_speed, Damage_millions_USD, Number_Deaths. region -> Region_id, Region_code, Region_name. affected_region -> Region_id, Storm_ID, Number_city_affected. | Joins: affected_region.Storm_ID = storm.Storm_ID... | what are the names of regions with two or more storms? |
storm_record | select t2.region_name from affected_region as t1 join region as t2 on t1.region_id = t2.region_id join storm as t3 on t1.storm_id = t3.storm_id order by t3.number_deaths desc limit 1 | Question: find the names of the regions which were affected by the storm that killed the greatest number of people. | Tables: storm -> Storm_ID, Name, Dates_active, Max_speed, Damage_millions_USD, Number_Deaths. region -> Region_id, Region_code, Region_name. affected_region -> Region_id, Storm_ID, Number_city_affected.... | find the names of the regions which were affected by the storm that killed the greatest number of people. |
storm_record | select t2.region_name from affected_region as t1 join region as t2 on t1.region_id = t2.region_id join storm as t3 on t1.storm_id = t3.storm_id order by t3.number_deaths desc limit 1 | Question: what are the names of regions that were affected by the storm in which the most people died? | Tables: storm -> Storm_ID, Name, Dates_active, Max_speed, Damage_millions_USD, Number_Deaths. region -> Region_id, Region_code, Region_name. affected_region -> Region_id, Storm_ID, Number_city_affected. | Joins: aff... | what are the names of regions that were affected by the storm in which the most people died? |
storm_record | select t3.name from affected_region as t1 join region as t2 on t1.region_id = t2.region_id join storm as t3 on t1.storm_id = t3.storm_id where t2.region_name = 'afghanistan' intersect select t3.name from affected_region as t1 join region as t2 on t1.region_id = t2.region_id join storm as t3 on t1.storm_id = t... | Question: find the name of the storm that affected both afghanistan and albania regions. | Tables: storm -> Storm_ID, Name, Dates_active, Max_speed, Damage_millions_USD, Number_Deaths. region -> Region_id, Region_code, Region_name. affected_region -> Region_id, Storm_ID, Number_city_affected. | Joins: affected_region.S... | find the name of the storm that affected both afghanistan and albania regions. |
storm_record | select t3.name from affected_region as t1 join region as t2 on t1.region_id = t2.region_id join storm as t3 on t1.storm_id = t3.storm_id where t2.region_name = 'afghanistan' intersect select t3.name from affected_region as t1 join region as t2 on t1.region_id = t2.region_id join storm as t3 on t1.storm_id = t... | Question: what are the names of the storms that affected both the regions of afghanistan and albania? | Tables: storm -> Storm_ID, Name, Dates_active, Max_speed, Damage_millions_USD, Number_Deaths. region -> Region_id, Region_code, Region_name. affected_region -> Region_id, Storm_ID, Number_city_affected. | Joins: affe... | what are the names of the storms that affected both the regions of afghanistan and albania? |
election | select count(*) from county | Question: how many counties are there in total? | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, Party, First_Elected, Committee. |... | how many counties are there in total? |
election | select count(*) from county | Question: count the total number of counties. | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, Party, First_Elected, Committee. | J... | count the total number of counties. |
election | select county_name , population from county | Question: show the county name and population of all counties. | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, Party, First_Electe... | show the county name and population of all counties. |
election | select county_name , population from county | Question: what are the name and population of each county? | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, Party, First_Elected, C... | what are the name and population of each county? |
election | select avg(population) from county | Question: show the average population of all counties. | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, Party, First_Elected, Commi... | show the average population of all counties. |
election | select avg(population) from county | Question: on average how large is the population of the counties? | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, Party, First_Ele... | on average how large is the population of the counties? |
election | select max(population) , min(population) from county | Question: return the maximum and minimum population among all counties. | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, Party, Fir... | return the maximum and minimum population among all counties. |
election | select max(population) , min(population) from county | Question: what are the maximum and minimum population of the counties? | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, Party, Firs... | what are the maximum and minimum population of the counties? |
election | select distinct district from election | Question: show all the distinct districts for elections. | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, Party, First_Elected, Com... | show all the distinct districts for elections. |
election | select distinct district from election | Question: what are the distinct districts for elections? | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, Party, First_Elected, Com... | what are the distinct districts for elections? |
election | select zip_code from county where county_name = 'howard' | Question: show the zip code of the county with name 'howard'. | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, Party, First_Elected... | show the zip code of the county with name 'howard'. |
election | select zip_code from county where county_name = 'howard' | Question: what is the zip code the county named 'howard' is located in? | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, Party, Fir... | what is the zip code the county named 'howard' is located in? |
election | select delegate from election where district = 1 | Question: show the delegate from district 1 in election. | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, Party, First_Elected, Com... | show the delegate from district 1 in election. |
election | select delegate from election where district = 1 | Question: who is the delegate of district 1 in the elections? | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, Party, First_Elected... | who is the delegate of district 1 in the elections? |
election | select delegate , committee from election | Question: show the delegate and committee information of elections. | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, Party, First_E... | show the delegate and committee information of elections. |
election | select delegate , committee from election | Question: what are the delegate and committee information for each election record? | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate... | what are the delegate and committee information for each election record? |
election | select count(distinct governor) from party | Question: how many distinct governors are there? | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, Party, First_Elected, Committee. ... | how many distinct governors are there? |
election | select count(distinct governor) from party | Question: count the number of distinct governors. | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, Party, First_Elected, Committee.... | count the number of distinct governors. |
election | select lieutenant_governor , comptroller from party where party = 'democratic' | Question: show the lieutenant governor and comptroller from the democratic party. | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, ... | show the lieutenant governor and comptroller from the democratic party. |
election | select lieutenant_governor , comptroller from party where party = 'democratic' | Question: who are the lieutenant governor and comptroller from the democratic party? | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegat... | who are the lieutenant governor and comptroller from the democratic party? |
election | select distinct year from party where governor = 'eliot spitzer' | Question: in which distinct years was the governor 'eliot spitzer'? | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, Party, First_E... | in which distinct years was the governor 'eliot spitzer'? |
election | select distinct year from party where governor = 'eliot spitzer' | Question: find the distinct years when the governor was named 'eliot spitzer'. | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, Par... | find the distinct years when the governor was named 'eliot spitzer'. |
election | select * from election | Question: show all the information about election. | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, Party, First_Elected, Committee... | show all the information about election. |
election | select * from election | Question: return all the information for each election record. | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, Party, First_Electe... | return all the information for each election record. |
election | select t2.delegate , t1.county_name from county as t1 join election as t2 on t1.county_id = t2.district | Question: show the delegates and the names of county they belong to. | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, Party, First_... | show the delegates and the names of county they belong to. |
election | select t2.delegate , t1.county_name from county as t1 join election as t2 on t1.county_id = t2.district | Question: what are the delegate and name of the county they belong to, for each county? | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Dele... | what are the delegate and name of the county they belong to, for each county? |
election | select t2.delegate from county as t1 join election as t2 on t1.county_id = t2.district where t1.population < 100000 | Question: which delegates are from counties with population smaller than 100000? | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, P... | which delegates are from counties with population smaller than 100000? |
election | select t2.delegate from county as t1 join election as t2 on t1.county_id = t2.district where t1.population < 100000 | Question: find the delegates who are from counties with population below 100000. | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, P... | find the delegates who are from counties with population below 100000. |
election | select count(distinct t2.delegate) from county as t1 join election as t2 on t1.county_id = t2.district where t1.population > 50000 | Question: how many distinct delegates are from counties with population larger than 50000? | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, D... | how many distinct delegates are from counties with population larger than 50000? |
election | select count(distinct t2.delegate) from county as t1 join election as t2 on t1.county_id = t2.district where t1.population > 50000 | Question: count the number of distinct delegates who are from counties with population above 50000. | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, Di... | count the number of distinct delegates who are from counties with population above 50000. |
election | select t1.county_name from county as t1 join election as t2 on t1.county_id = t2.district where t2.committee = 'appropriations' | Question: what are the names of the county that the delegates on 'appropriations' committee belong to? | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented,... | what are the names of the county that the delegates on 'appropriations' committee belong to? |
election | select t1.county_name from county as t1 join election as t2 on t1.county_id = t2.district where t2.committee = 'appropriations' | Question: which county do the delegates on 'appropriations' committee belong to? give me the county names. | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represen... | which county do the delegates on 'appropriations' committee belong to? give me the county names. |
election | select t1.delegate , t2.party from election as t1 join party as t2 on t1.party = t2.party_id | Question: show the delegates and the names of the party they belong to. | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, Party, Fir... | show the delegates and the names of the party they belong to. |
election | select t1.delegate , t2.party from election as t1 join party as t2 on t1.party = t2.party_id | Question: for each delegate, find the names of the party they are part of. | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, Party, ... | for each delegate, find the names of the party they are part of. |
election | select t2.governor from election as t1 join party as t2 on t1.party = t2.party_id where t1.district = 1 | Question: who were the governors of the parties associated with delegates from district 1? | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, D... | who were the governors of the parties associated with delegates from district 1? |
election | select t2.governor from election as t1 join party as t2 on t1.party = t2.party_id where t1.district = 1 | Question: find the parties associated with the delegates from district 1. who served as governors of the parties? | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_R... | find the parties associated with the delegates from district 1. who served as governors of the parties? |
election | select t2.comptroller from election as t1 join party as t2 on t1.party = t2.party_id where t1.district = 1 or t1.district = 2 | Question: who were the comptrollers of the parties associated with the delegates from district 1 or district 2? | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Rep... | who were the comptrollers of the parties associated with the delegates from district 1 or district 2? |
election | select t2.comptroller from election as t1 join party as t2 on t1.party = t2.party_id where t1.district = 1 or t1.district = 2 | Question: find the parties associated with the delegates from district 1 or 2. who served as comptrollers of the parties? | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Co... | find the parties associated with the delegates from district 1 or 2. who served as comptrollers of the parties? |
election | select t1.committee from election as t1 join party as t2 on t1.party = t2.party_id where t2.party = 'democratic' | Question: return all the committees that have delegates from democratic party. | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, Par... | return all the committees that have delegates from democratic party. |
election | select t1.committee from election as t1 join party as t2 on t1.party = t2.party_id where t2.party = 'democratic' | Question: which committees have delegates from the democratic party? | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, Party, First_... | which committees have delegates from the democratic party? |
election | select t1.county_name , count(*) from county as t1 join election as t2 on t1.county_id = t2.district group by t1.county_id | Question: show the name of each county along with the corresponding number of delegates from that county. | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represent... | show the name of each county along with the corresponding number of delegates from that county. |
election | select t1.county_name , count(*) from county as t1 join election as t2 on t1.county_id = t2.district group by t1.county_id | Question: for each county, find the name of the county and the number of delegates from that county. | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, D... | for each county, find the name of the county and the number of delegates from that county. |
election | select t2.party , count(*) from election as t1 join party as t2 on t1.party = t2.party_id group by t1.party | Question: show the name of each party and the corresponding number of delegates from that party. | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, Distr... | show the name of each party and the corresponding number of delegates from that party. |
election | select t2.party , count(*) from election as t1 join party as t2 on t1.party = t2.party_id group by t1.party | Question: for each party, return the name of the party and the number of delegates from that party. | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, Di... | for each party, return the name of the party and the number of delegates from that party. |
election | select county_name from county order by population asc | Question: return the names of all counties sorted by population in ascending order. | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate... | return the names of all counties sorted by population in ascending order. |
election | select county_name from county order by population asc | Question: sort the names of all counties in ascending order of population. | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, Party, ... | sort the names of all counties in ascending order of population. |
election | select county_name from county order by county_name desc | Question: return the names of all counties sorted by county name in descending alphabetical order. | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, Dis... | return the names of all counties sorted by county name in descending alphabetical order. |
election | select county_name from county order by county_name desc | Question: sort the names of all counties in descending alphabetical order. | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, Party, ... | sort the names of all counties in descending alphabetical order. |
election | select county_name from county order by population desc limit 1 | Question: show the name of the county with the biggest population. | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, Party, First_El... | show the name of the county with the biggest population. |
election | select county_name from county order by population desc limit 1 | Question: which county has the largest population? give me the name of the county. | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate,... | which county has the largest population? give me the name of the county. |
election | select county_name from county order by population asc limit 3 | Question: show the 3 counties with the smallest population. | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, Party, First_Elected, ... | show the 3 counties with the smallest population. |
election | select county_name from county order by population asc limit 3 | Question: what are the 3 counties that have the smallest population? give me the county names. | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, Distric... | what are the 3 counties that have the smallest population? give me the county names. |
election | select t1.county_name from county as t1 join election as t2 on t1.county_id = t2.district group by t1.county_id having count(*) >= 2 | Question: show the names of counties that have at least two delegates. | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, Party, Firs... | show the names of counties that have at least two delegates. |
election | select t1.county_name from county as t1 join election as t2 on t1.county_id = t2.district group by t1.county_id having count(*) >= 2 | Question: which counties have two or more delegates? give me the county names. | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, Par... | which counties have two or more delegates? give me the county names. |
election | select party from party group by party having count(*) >= 2 | Question: show the name of the party that has at least two records. | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, Party, First_E... | show the name of the party that has at least two records. |
election | select party from party group by party having count(*) >= 2 | Question: which party has two or more records? | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, Party, First_Elected, Committee. | ... | which party has two or more records? |
election | select t2.party from election as t1 join party as t2 on t1.party = t2.party_id group by t1.party order by count(*) desc limit 1 | Question: show the name of the party that has the most delegates. | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, Party, First_Ele... | show the name of the party that has the most delegates. |
election | select t2.party from election as t1 join party as t2 on t1.party = t2.party_id group by t1.party order by count(*) desc limit 1 | Question: which party has the largest number of delegates? | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, Party, First_Elected, C... | which party has the largest number of delegates? |
election | select governor from party group by governor order by count(*) desc limit 1 | Question: show the people that have been governor the most times. | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, Party, First_Ele... | show the people that have been governor the most times. |
election | select governor from party group by governor order by count(*) desc limit 1 | Question: which people severed as governor most frequently? | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, Party, First_Elected, ... | which people severed as governor most frequently? |
election | select comptroller , count(*) from party group by comptroller order by count(*) desc limit 1 | Question: show the people that have been comptroller the most times and the corresponding number of times. | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represen... | show the people that have been comptroller the most times and the corresponding number of times. |
election | select comptroller , count(*) from party group by comptroller order by count(*) desc limit 1 | Question: which people severed as comptroller most frequently? give me the name of the person and the frequency count. | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Count... | which people severed as comptroller most frequently? give me the name of the person and the frequency count. |
election | select party from party where party_id not in (select party from election) | Question: what are the names of parties that do not have delegates in election? | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, Pa... | what are the names of parties that do not have delegates in election? |
election | select party from party where party_id not in (select party from election) | Question: which parties did not have any delegates in elections? | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, District, Delegate, Party, First_Elec... | which parties did not have any delegates in elections? |
election | select t2.party from election as t1 join party as t2 on t1.party = t2.party_id where t1.committee = 'appropriations' intersect select t2.party from election as t1 join party as t2 on t1.party = t2.party_id where t1.committee = 'economic matters' | Question: what are the names of parties that have both delegates on 'appropriations' committee and | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties_Represented, Dis... | what are the names of parties that have both delegates on 'appropriations' committee and |
election | select t2.party from election as t1 join party as t2 on t1.party = t2.party_id where t1.committee = 'appropriations' intersect select t2.party from election as t1 join party as t2 on t1.party = t2.party_id where t1.committee = 'economic matters' | Question: which parties have delegates in both the 'appropriations' committee and the 'economic matters' committee? | Tables: county -> County_Id, County_name, Population, Zip_code. party -> Party_ID, Year, Party, Governor, Lieutenant_Governor, Comptroller, Attorney_General, US_Senate. election -> Election_ID, Counties... | which parties have delegates in both the 'appropriations' committee and the 'economic matters' committee? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.