db_id stringlengths 4 31 | SQL stringlengths 18 1.45k | input_sequence stringlengths 148 11k | question stringlengths 16 325 |
|---|---|---|---|
music_4 | select result , count(*) from music_festival group by result order by count(*) desc | Question: how many music festivals have had each kind of result, ordered descending by count? | Tables: artist -> Artist_ID, Artist, Age, Famous_Title, Famous_Release_date. volume -> Volume_ID, Volume_Issue, Issue_Date, Weeks_on_Top, Song, Artist_ID. music_festival -> ID, Music_Festival, Date_of_ceremony, Category, Vol... | how many music festivals have had each kind of result, ordered descending by count? |
music_4 | select issue_date from artist as t1 join volume as t2 on t1.artist_id = t2.artist_id where t1.age <= 23 | Question: what are the issue dates of volumes associated with the artist aged 23 or younger? | Tables: artist -> Artist_ID, Artist, Age, Famous_Title, Famous_Release_date. volume -> Volume_ID, Volume_Issue, Issue_Date, Weeks_on_Top, Song, Artist_ID. music_festival -> ID, Music_Festival, Date_of_ceremony, Category, Volu... | what are the issue dates of volumes associated with the artist aged 23 or younger? |
music_4 | select issue_date from artist as t1 join volume as t2 on t1.artist_id = t2.artist_id where t1.age <= 23 | Question: return the issue dates of volumes by artists who are at most 23 years old? | Tables: artist -> Artist_ID, Artist, Age, Famous_Title, Famous_Release_date. volume -> Volume_ID, Volume_Issue, Issue_Date, Weeks_on_Top, Song, Artist_ID. music_festival -> ID, Music_Festival, Date_of_ceremony, Category, Volume, Resu... | return the issue dates of volumes by artists who are at most 23 years old? |
roller_coaster | select count(*) from roller_coaster | Question: how many roller coasters are there? | Tables: roller_coaster -> Roller_Coaster_ID, Name, Park, Country_ID, Length, Height, Speed, Opened, Status. country -> Country_ID, Name, Population, Area, Languages. | Joins: roller_coaster.Country_ID = country.Country_ID, | how many roller coasters are there? |
roller_coaster | select name from roller_coaster order by length asc | Question: list the names of roller coasters by ascending order of length. | Tables: roller_coaster -> Roller_Coaster_ID, Name, Park, Country_ID, Length, Height, Speed, Opened, Status. country -> Country_ID, Name, Population, Area, Languages. | Joins: roller_coaster.Country_ID = country.Country_ID, | list the names of roller coasters by ascending order of length. |
roller_coaster | select length , height from roller_coaster | Question: what are the lengths and heights of roller coasters? | Tables: roller_coaster -> Roller_Coaster_ID, Name, Park, Country_ID, Length, Height, Speed, Opened, Status. country -> Country_ID, Name, Population, Area, Languages. | Joins: roller_coaster.Country_ID = country.Country_ID, | what are the lengths and heights of roller coasters? |
roller_coaster | select name from country where languages != 'german' | Question: list the names of countries whose language is not 'german'. | Tables: roller_coaster -> Roller_Coaster_ID, Name, Park, Country_ID, Length, Height, Speed, Opened, Status. country -> Country_ID, Name, Population, Area, Languages. | Joins: roller_coaster.Country_ID = country.Country_ID, | list the names of countries whose language is not 'german'. |
roller_coaster | select status from roller_coaster where length > 3300 or height > 100 | Question: show the statuses of roller coasters longer than 3300 or higher than 100. | Tables: roller_coaster -> Roller_Coaster_ID, Name, Park, Country_ID, Length, Height, Speed, Opened, Status. country -> Country_ID, Name, Population, Area, Languages. | Joins: roller_coaster.Country_ID = country.Country_ID, | show the statuses of roller coasters longer than 3300 or higher than 100. |
roller_coaster | select speed from roller_coaster order by length desc limit 1 | Question: what are the speeds of the longest roller coaster? | Tables: roller_coaster -> Roller_Coaster_ID, Name, Park, Country_ID, Length, Height, Speed, Opened, Status. country -> Country_ID, Name, Population, Area, Languages. | Joins: roller_coaster.Country_ID = country.Country_ID, | what are the speeds of the longest roller coaster? |
roller_coaster | select avg(speed) from roller_coaster | Question: what is the average speed of roller coasters? | Tables: roller_coaster -> Roller_Coaster_ID, Name, Park, Country_ID, Length, Height, Speed, Opened, Status. country -> Country_ID, Name, Population, Area, Languages. | Joins: roller_coaster.Country_ID = country.Country_ID, | what is the average speed of roller coasters? |
roller_coaster | select status , count(*) from roller_coaster group by status | Question: show the different statuses and the numbers of roller coasters for each status. | Tables: roller_coaster -> Roller_Coaster_ID, Name, Park, Country_ID, Length, Height, Speed, Opened, Status. country -> Country_ID, Name, Population, Area, Languages. | Joins: roller_coaster.Country_ID = country.Country_ID, | show the different statuses and the numbers of roller coasters for each status. |
roller_coaster | select status from roller_coaster group by status order by count(*) desc limit 1 | Question: please show the most common status of roller coasters. | Tables: roller_coaster -> Roller_Coaster_ID, Name, Park, Country_ID, Length, Height, Speed, Opened, Status. country -> Country_ID, Name, Population, Area, Languages. | Joins: roller_coaster.Country_ID = country.Country_ID, | please show the most common status of roller coasters. |
roller_coaster | select status from roller_coaster group by status having count(*) > 2 | Question: list the status shared by more than two roller coaster. | Tables: roller_coaster -> Roller_Coaster_ID, Name, Park, Country_ID, Length, Height, Speed, Opened, Status. country -> Country_ID, Name, Population, Area, Languages. | Joins: roller_coaster.Country_ID = country.Country_ID, | list the status shared by more than two roller coaster. |
roller_coaster | select park from roller_coaster order by speed desc limit 1 | Question: show the park of the roller coaster with the highest speed. | Tables: roller_coaster -> Roller_Coaster_ID, Name, Park, Country_ID, Length, Height, Speed, Opened, Status. country -> Country_ID, Name, Population, Area, Languages. | Joins: roller_coaster.Country_ID = country.Country_ID, | show the park of the roller coaster with the highest speed. |
roller_coaster | select t2.name , t1.name from country as t1 join roller_coaster as t2 on t1.country_id = t2.country_id | Question: show the names of roller coasters and names of country they are in. | Tables: roller_coaster -> Roller_Coaster_ID, Name, Park, Country_ID, Length, Height, Speed, Opened, Status. country -> Country_ID, Name, Population, Area, Languages. | Joins: roller_coaster.Country_ID = country.Country_ID, | show the names of roller coasters and names of country they are in. |
roller_coaster | select t1.name from country as t1 join roller_coaster as t2 on t1.country_id = t2.country_id group by t1.name having count(*) > 1 | Question: show the names of countries that have more than one roller coaster. | Tables: roller_coaster -> Roller_Coaster_ID, Name, Park, Country_ID, Length, Height, Speed, Opened, Status. country -> Country_ID, Name, Population, Area, Languages. | Joins: roller_coaster.Country_ID = country.Country_ID, | show the names of countries that have more than one roller coaster. |
roller_coaster | select t1.name , t1.population from country as t1 join roller_coaster as t2 on t1.country_id = t2.country_id order by t2.height desc limit 1 | Question: show the name and population of the country that has the highest roller coaster. | Tables: roller_coaster -> Roller_Coaster_ID, Name, Park, Country_ID, Length, Height, Speed, Opened, Status. country -> Country_ID, Name, Population, Area, Languages. | Joins: roller_coaster.Country_ID = country.Country_ID, | show the name and population of the country that has the highest roller coaster. |
roller_coaster | select t1.name , avg(t2.speed) from country as t1 join roller_coaster as t2 on t1.country_id = t2.country_id group by t1.name | Question: show the names of countries and the average speed of roller coasters from each country. | Tables: roller_coaster -> Roller_Coaster_ID, Name, Park, Country_ID, Length, Height, Speed, Opened, Status. country -> Country_ID, Name, Population, Area, Languages. | Joins: roller_coaster.Country_ID = country.Country_I... | show the names of countries and the average speed of roller coasters from each country. |
roller_coaster | select count(*) from country where country_id not in ( select country_id from roller_coaster where length > 3000 ) | Question: how many countries do not have an roller coaster longer than 3000? | Tables: roller_coaster -> Roller_Coaster_ID, Name, Park, Country_ID, Length, Height, Speed, Opened, Status. country -> Country_ID, Name, Population, Area, Languages. | Joins: roller_coaster.Country_ID = country.Country_ID, | how many countries do not have an roller coaster longer than 3000? |
roller_coaster | select t1.name , t1.area , t1.population from country as t1 join roller_coaster as t2 on t1.country_id = t2.country_id where t2.speed > 60 intersect select t1.name , t1.area , t1.population from country as t1 join roller_coaster as t2 on t1.country_id = t2.country_id where t2.speed < 55 | Question: what are the country names, area and population which has both roller coasters with speed higher | Tables: roller_coaster -> Roller_Coaster_ID, Name, Park, Country_ID, Length, Height, Speed, Opened, Status. country -> Country_ID, Name, Population, Area, Languages. | Joins: roller_coaster.Country_ID = country.... | what are the country names, area and population which has both roller coasters with speed higher |
ship_1 | select count(distinct rank) from captain | Question: how many different captain ranks are there? | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | how many different captain ranks are there? |
ship_1 | select count(distinct rank) from captain | Question: count the number of different ranks of captain. | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | count the number of different ranks of captain. |
ship_1 | select count(*) , rank from captain group by rank | Question: how many captains are in each rank? | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | how many captains are in each rank? |
ship_1 | select count(*) , rank from captain group by rank | Question: count the number of captains that have each rank. | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | count the number of captains that have each rank. |
ship_1 | select count(*) , rank from captain where age < 50 group by rank | Question: how many captains with younger than 50 are in each rank? | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | how many captains with younger than 50 are in each rank? |
ship_1 | select count(*) , rank from captain where age < 50 group by rank | Question: count the number of captains younger than 50 of each rank. | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | count the number of captains younger than 50 of each rank. |
ship_1 | select name from captain order by age desc | Question: sort all captain names by their ages from old to young. | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | sort all captain names by their ages from old to young. |
ship_1 | select name from captain order by age desc | Question: what are the names of captains, sorted by age descending? | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | what are the names of captains, sorted by age descending? |
ship_1 | select name , class , rank from captain | Question: find the name, class and rank of all captains. | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | find the name, class and rank of all captains. |
ship_1 | select name , class , rank from captain | Question: what are the names, classes, and ranks of all captains? | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | what are the names, classes, and ranks of all captains? |
ship_1 | select rank from captain group by rank order by count(*) desc limit 1 | Question: which rank is the most common among captains? | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | which rank is the most common among captains? |
ship_1 | select rank from captain group by rank order by count(*) desc limit 1 | Question: return the rank for which there are the fewest captains. | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | return the rank for which there are the fewest captains. |
ship_1 | select class from captain group by class having count(*) > 2 | Question: which classes have more than two captains? | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | which classes have more than two captains? |
ship_1 | select class from captain group by class having count(*) > 2 | Question: give the classes that have more than two captains. | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | give the classes that have more than two captains. |
ship_1 | select name from captain where rank = 'midshipman' or rank = 'lieutenant' | Question: find the name of captains whose rank are either midshipman or lieutenant. | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | find the name of captains whose rank are either midshipman or lieutenant. |
ship_1 | select name from captain where rank = 'midshipman' or rank = 'lieutenant' | Question: what are the names of captains that have either the rank midshipman or lieutenant? | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | what are the names of captains that have either the rank midshipman or lieutenant? |
ship_1 | select avg(age) , min(age) , class from captain group by class | Question: what are the average and minimum age of captains in different class? | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | what are the average and minimum age of captains in different class? |
ship_1 | select avg(age) , min(age) , class from captain group by class | Question: return the average and minimum age of captains in each class. | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | return the average and minimum age of captains in each class. |
ship_1 | select rank from captain where class = 'cutter' intersect select rank from captain where class = 'armed schooner' | Question: find the captain rank that has some captains in both cutter and armed schooner classes. | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | find the captain rank that has some captains in both cutter and armed schooner classes. |
ship_1 | select rank from captain where class = 'cutter' intersect select rank from captain where class = 'armed schooner' | Question: what are the ranks of captains that are both in the cutter and armed schooner classes? | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | what are the ranks of captains that are both in the cutter and armed schooner classes? |
ship_1 | select rank from captain except select rank from captain where class = 'third-rate ship of the line' | Question: find the captain rank that has no captain in third-rate ship of the line class. | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | find the captain rank that has no captain in third-rate ship of the line class. |
ship_1 | select rank from captain except select rank from captain where class = 'third-rate ship of the line' | Question: what are the ranks of captains that have no captain that are in the third-rate ship of the line class? | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | what are the ranks of captains that have no captain that are in the third-rate ship of the line class? |
ship_1 | select name from captain order by age limit 1 | Question: what is the name of the youngest captain? | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | what is the name of the youngest captain? |
ship_1 | select name from captain order by age limit 1 | Question: return the name of the youngest captain. | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | return the name of the youngest captain. |
ship_1 | select count(*) from ship | Question: how many ships are there? | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | how many ships are there? |
ship_1 | select count(*) from ship | Question: count the number of ships. | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | count the number of ships. |
ship_1 | select name , type , flag from ship order by built_year desc limit 1 | Question: find the name, type, and flag of the ship that is built in the most recent year. | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | find the name, type, and flag of the ship that is built in the most recent year. |
ship_1 | select name , type , flag from ship order by built_year desc limit 1 | Question: what is the name, type, and flag of the ship that was built in the most recent year? | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | what is the name, type, and flag of the ship that was built in the most recent year? |
ship_1 | select count(*) , flag from ship group by flag | Question: group by ships by flag, and return number of ships that have each flag. | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | group by ships by flag, and return number of ships that have each flag. |
ship_1 | select count(*) , flag from ship group by flag | Question: what are the different ship flags, and how many ships have each? | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | what are the different ship flags, and how many ships have each? |
ship_1 | select flag from ship group by flag order by count(*) desc limit 1 | Question: which flag is most widely used among all ships? | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | which flag is most widely used among all ships? |
ship_1 | select flag from ship group by flag order by count(*) desc limit 1 | Question: return the flag that is most common among all ships. | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | return the flag that is most common among all ships. |
ship_1 | select name from ship order by built_year , class | Question: list all ship names in the order of built year and class. | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | list all ship names in the order of built year and class. |
ship_1 | select name from ship order by built_year , class | Question: what are the names of ships, ordered by year they were built and their class? | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | what are the names of ships, ordered by year they were built and their class? |
ship_1 | select type from ship where flag = 'panama' intersect select type from ship where flag = 'malta' | Question: find the ship type that are used by both ships with panama and malta flags. | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | find the ship type that are used by both ships with panama and malta flags. |
ship_1 | select type from ship where flag = 'panama' intersect select type from ship where flag = 'malta' | Question: what types of ships have both ships that have panama flags and malta flags? | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | what types of ships have both ships that have panama flags and malta flags? |
ship_1 | select built_year from ship group by built_year order by count(*) desc limit 1 | Question: in which year were most of ships built? | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | in which year were most of ships built? |
ship_1 | select built_year from ship group by built_year order by count(*) desc limit 1 | Question: what is the year in which most ships were built? | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | what is the year in which most ships were built? |
ship_1 | select t1.name from ship as t1 join captain as t2 on t1.ship_id = t2.ship_id group by t2.ship_id having count(*) > 1 | Question: find the name of the ships that have more than one captain. | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | find the name of the ships that have more than one captain. |
ship_1 | select t1.name from ship as t1 join captain as t2 on t1.ship_id = t2.ship_id group by t2.ship_id having count(*) > 1 | Question: what are the names of ships that have more than one captain? | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | what are the names of ships that have more than one captain? |
ship_1 | select name , class from ship where ship_id not in (select ship_id from captain) | Question: what are the names and classes of the ships that do not have any captain yet? | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | what are the names and classes of the ships that do not have any captain yet? |
ship_1 | select name , class from ship where ship_id not in (select ship_id from captain) | Question: return the names and classes of ships that do not have a captain? | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | return the names and classes of ships that do not have a captain? |
ship_1 | select t1.name from ship as t1 join captain as t2 on t1.ship_id = t2.ship_id order by t2.age limit 1 | Question: find the name of the ship that is steered by the youngest captain. | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | find the name of the ship that is steered by the youngest captain. |
ship_1 | select t1.name from ship as t1 join captain as t2 on t1.ship_id = t2.ship_id order by t2.age limit 1 | Question: what is the name of the ship that is commanded by the youngest captain? | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | what is the name of the ship that is commanded by the youngest captain? |
ship_1 | select name , flag from ship where ship_id not in (select ship_id from captain where rank = 'midshipman') | Question: find the name and flag of ships that are not steered by any captain with midshipman rank. | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | find the name and flag of ships that are not steered by any captain with midshipman rank. |
ship_1 | select name , flag from ship where ship_id not in (select ship_id from captain where rank = 'midshipman') | Question: what are the names and flags of ships that do not have a captain with the rank of midshipman? | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | what are the names and flags of ships that do not have a captain with the rank of midshipman? |
ship_1 | select t1.name from ship as t1 join captain as t2 on t1.ship_id = t2.ship_id where t2.rank = 'midshipman' intersect select t1.name from ship as t1 join captain as t2 on t1.ship_id = t2.ship_id where t2.rank = 'lieutenant' | Question: find the name of the ships that are steered by both a captain with midshipman rank and a captain with lieutenant rank. | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | find the name of the ships that are steered by both a captain with midshipman rank and a captain with lieutenant rank. |
ship_1 | select t1.name from ship as t1 join captain as t2 on t1.ship_id = t2.ship_id where t2.rank = 'midshipman' intersect select t1.name from ship as t1 join captain as t2 on t1.ship_id = t2.ship_id where t2.rank = 'lieutenant' | Question: what are the names of ships that are commanded by both captains with the rank of midshipman and captains with the rank of lieutenant? | Tables: captain -> Captain_ID, Name, Ship_ID, age, Class, Rank. Ship -> Ship_ID, Name, Type, Built_Year, Class, Flag. | Joins: captain.Ship_ID = Ship.Ship_ID, | what are the names of ships that are commanded by both captains with the rank of midshipman and captains with the rank of lieutenant? |
city_record | select host_city from hosting_city order by year desc limit 1 | Question: what is id of the city that hosted events in the most recent year? | Tables: city -> City_ID, City, Hanzi, Hanyu_Pinyin, Regional_Population, GDP. match -> Match_ID, Date, Venue, Score, Result, Competition. temperature -> City_ID, Jan, Feb, Mar, Apr, Jun, Jul, Aug, Sep, Oct, Nov, Dec. hosting_city -> Year, Ma... | what is id of the city that hosted events in the most recent year? |
city_record | select host_city from hosting_city order by year desc limit 1 | Question: find the city that hosted some events in the most recent year. what is the id of this city? | Tables: city -> City_ID, City, Hanzi, Hanyu_Pinyin, Regional_Population, GDP. match -> Match_ID, Date, Venue, Score, Result, Competition. temperature -> City_ID, Jan, Feb, Mar, Apr, Jun, Jul, Aug, Sep, Oct, Nov, Dec.... | find the city that hosted some events in the most recent year. what is the id of this city? |
city_record | select match_id from match where competition = '1994 fifa world cup qualification' | Question: find the match ids of the cities that hosted competition '1994 fifa world cup qualification'? | Tables: city -> City_ID, City, Hanzi, Hanyu_Pinyin, Regional_Population, GDP. match -> Match_ID, Date, Venue, Score, Result, Competition. temperature -> City_ID, Jan, Feb, Mar, Apr, Jun, Jul, Aug, Sep, Oct, Nov, De... | find the match ids of the cities that hosted competition '1994 fifa world cup qualification'? |
city_record | select match_id from match where competition = '1994 fifa world cup qualification' | Question: what is the match id of the competition called '1994 fifa world cup qualification'? | Tables: city -> City_ID, City, Hanzi, Hanyu_Pinyin, Regional_Population, GDP. match -> Match_ID, Date, Venue, Score, Result, Competition. temperature -> City_ID, Jan, Feb, Mar, Apr, Jun, Jul, Aug, Sep, Oct, Nov, Dec. hosting... | what is the match id of the competition called '1994 fifa world cup qualification'? |
city_record | select t1.city from city as t1 join hosting_city as t2 on t1.city_id = t2.host_city where t2.year > 2010 | Question: find the cities which were once a host city after 2010? | Tables: city -> City_ID, City, Hanzi, Hanyu_Pinyin, Regional_Population, GDP. match -> Match_ID, Date, Venue, Score, Result, Competition. temperature -> City_ID, Jan, Feb, Mar, Apr, Jun, Jul, Aug, Sep, Oct, Nov, Dec. hosting_city -> Year, Match_ID, Hos... | find the cities which were once a host city after 2010? |
city_record | select t1.city from city as t1 join hosting_city as t2 on t1.city_id = t2.host_city where t2.year > 2010 | Question: which cities served as a host city after 2010? | Tables: city -> City_ID, City, Hanzi, Hanyu_Pinyin, Regional_Population, GDP. match -> Match_ID, Date, Venue, Score, Result, Competition. temperature -> City_ID, Jan, Feb, Mar, Apr, Jun, Jul, Aug, Sep, Oct, Nov, Dec. hosting_city -> Year, Match_ID, Host_City. |... | which cities served as a host city after 2010? |
city_record | select t1.city from city as t1 join hosting_city as t2 on t1.city_id = t2.host_city group by t2.host_city order by count(*) desc limit 1 | Question: which city has hosted the most events? | Tables: city -> City_ID, City, Hanzi, Hanyu_Pinyin, Regional_Population, GDP. match -> Match_ID, Date, Venue, Score, Result, Competition. temperature -> City_ID, Jan, Feb, Mar, Apr, Jun, Jul, Aug, Sep, Oct, Nov, Dec. hosting_city -> Year, Match_ID, Host_City. | Joins: ... | which city has hosted the most events? |
city_record | select t1.city from city as t1 join hosting_city as t2 on t1.city_id = t2.host_city group by t2.host_city order by count(*) desc limit 1 | Question: find the city that hosted the most events. | Tables: city -> City_ID, City, Hanzi, Hanyu_Pinyin, Regional_Population, GDP. match -> Match_ID, Date, Venue, Score, Result, Competition. temperature -> City_ID, Jan, Feb, Mar, Apr, Jun, Jul, Aug, Sep, Oct, Nov, Dec. hosting_city -> Year, Match_ID, Host_City. | Joi... | find the city that hosted the most events. |
city_record | select t3.venue from city as t1 join hosting_city as t2 on t1.city_id = t2.host_city join match as t3 on t2.match_id = t3.match_id where t1.city = 'nanjing ( jiangsu )' and t3.competition = '1994 fifa world cup qualification' | Question: what is the venue of the competition '1994 fifa world cup qualification' hosted by 'nanjing ( jiangsu )'? | Tables: city -> City_ID, City, Hanzi, Hanyu_Pinyin, Regional_Population, GDP. match -> Match_ID, Date, Venue, Score, Result, Competition. temperature -> City_ID, Jan, Feb, Mar, Apr, Jun, Jul, Aug, Sep, ... | what is the venue of the competition '1994 fifa world cup qualification' hosted by 'nanjing ( jiangsu )'? |
city_record | select t3.venue from city as t1 join hosting_city as t2 on t1.city_id = t2.host_city join match as t3 on t2.match_id = t3.match_id where t1.city = 'nanjing ( jiangsu )' and t3.competition = '1994 fifa world cup qualification' | Question: find the venue of the competition '1994 fifa world cup qualification' which was hosted by 'nanjing ( jiangsu )'. | Tables: city -> City_ID, City, Hanzi, Hanyu_Pinyin, Regional_Population, GDP. match -> Match_ID, Date, Venue, Score, Result, Competition. temperature -> City_ID, Jan, Feb, Mar, Apr, Jun, Jul, Aug... | find the venue of the competition '1994 fifa world cup qualification' which was hosted by 'nanjing ( jiangsu )'. |
city_record | select t2.jan from city as t1 join temperature as t2 on t1.city_id = t2.city_id where t1.city = 'shanghai' | Question: give me the temperature of shanghai in january. | Tables: city -> City_ID, City, Hanzi, Hanyu_Pinyin, Regional_Population, GDP. match -> Match_ID, Date, Venue, Score, Result, Competition. temperature -> City_ID, Jan, Feb, Mar, Apr, Jun, Jul, Aug, Sep, Oct, Nov, Dec. hosting_city -> Year, Match_ID, Host_City. ... | give me the temperature of shanghai in january. |
city_record | select t2.jan from city as t1 join temperature as t2 on t1.city_id = t2.city_id where t1.city = 'shanghai' | Question: what is the temperature of 'shanghai' city in january? | Tables: city -> City_ID, City, Hanzi, Hanyu_Pinyin, Regional_Population, GDP. match -> Match_ID, Date, Venue, Score, Result, Competition. temperature -> City_ID, Jan, Feb, Mar, Apr, Jun, Jul, Aug, Sep, Oct, Nov, Dec. hosting_city -> Year, Match_ID, Host... | what is the temperature of 'shanghai' city in january? |
city_record | select t2.year from city as t1 join hosting_city as t2 on t1.city_id = t2.host_city where t1.city = 'taizhou ( zhejiang )' | Question: what is the host year of city 'taizhou ( zhejiang )'? | Tables: city -> City_ID, City, Hanzi, Hanyu_Pinyin, Regional_Population, GDP. match -> Match_ID, Date, Venue, Score, Result, Competition. temperature -> City_ID, Jan, Feb, Mar, Apr, Jun, Jul, Aug, Sep, Oct, Nov, Dec. hosting_city -> Year, Match_ID, Host_... | what is the host year of city 'taizhou ( zhejiang )'? |
city_record | select t2.year from city as t1 join hosting_city as t2 on t1.city_id = t2.host_city where t1.city = 'taizhou ( zhejiang )' | Question: in which year did city 'taizhou ( zhejiang )' serve as a host city? | Tables: city -> City_ID, City, Hanzi, Hanyu_Pinyin, Regional_Population, GDP. match -> Match_ID, Date, Venue, Score, Result, Competition. temperature -> City_ID, Jan, Feb, Mar, Apr, Jun, Jul, Aug, Sep, Oct, Nov, Dec. hosting_city -> Year, M... | in which year did city 'taizhou ( zhejiang )' serve as a host city? |
city_record | select city from city order by regional_population desc limit 3 | Question: which three cities have the largest regional population? | Tables: city -> City_ID, City, Hanzi, Hanyu_Pinyin, Regional_Population, GDP. match -> Match_ID, Date, Venue, Score, Result, Competition. temperature -> City_ID, Jan, Feb, Mar, Apr, Jun, Jul, Aug, Sep, Oct, Nov, Dec. hosting_city -> Year, Match_ID, Ho... | which three cities have the largest regional population? |
city_record | select city from city order by regional_population desc limit 3 | Question: what are the three largest cities in terms of regional population? | Tables: city -> City_ID, City, Hanzi, Hanyu_Pinyin, Regional_Population, GDP. match -> Match_ID, Date, Venue, Score, Result, Competition. temperature -> City_ID, Jan, Feb, Mar, Apr, Jun, Jul, Aug, Sep, Oct, Nov, Dec. hosting_city -> Year, Ma... | what are the three largest cities in terms of regional population? |
city_record | select city , gdp from city order by gdp limit 1 | Question: which city has the lowest gdp? please list the city name and its gdp. | Tables: city -> City_ID, City, Hanzi, Hanyu_Pinyin, Regional_Population, GDP. match -> Match_ID, Date, Venue, Score, Result, Competition. temperature -> City_ID, Jan, Feb, Mar, Apr, Jun, Jul, Aug, Sep, Oct, Nov, Dec. hosting_city -> Year,... | which city has the lowest gdp? please list the city name and its gdp. |
city_record | select city , gdp from city order by gdp limit 1 | Question: what is the city with the smallest gdp? return the city and its gdp. | Tables: city -> City_ID, City, Hanzi, Hanyu_Pinyin, Regional_Population, GDP. match -> Match_ID, Date, Venue, Score, Result, Competition. temperature -> City_ID, Jan, Feb, Mar, Apr, Jun, Jul, Aug, Sep, Oct, Nov, Dec. hosting_city -> Year, ... | what is the city with the smallest gdp? return the city and its gdp. |
city_record | select t1.city from city as t1 join temperature as t2 on t1.city_id = t2.city_id order by t2.feb desc limit 1 | Question: which city has the highest temperature in february? | Tables: city -> City_ID, City, Hanzi, Hanyu_Pinyin, Regional_Population, GDP. match -> Match_ID, Date, Venue, Score, Result, Competition. temperature -> City_ID, Jan, Feb, Mar, Apr, Jun, Jul, Aug, Sep, Oct, Nov, Dec. hosting_city -> Year, Match_ID, Host_Ci... | which city has the highest temperature in february? |
city_record | select t1.city from city as t1 join temperature as t2 on t1.city_id = t2.city_id order by t2.feb desc limit 1 | Question: in february, which city marks the highest temperature? | Tables: city -> City_ID, City, Hanzi, Hanyu_Pinyin, Regional_Population, GDP. match -> Match_ID, Date, Venue, Score, Result, Competition. temperature -> City_ID, Jan, Feb, Mar, Apr, Jun, Jul, Aug, Sep, Oct, Nov, Dec. hosting_city -> Year, Match_ID, Host... | in february, which city marks the highest temperature? |
city_record | select t1.city from city as t1 join temperature as t2 on t1.city_id = t2.city_id where t2.mar < t2.jul or t2.mar > t2.oct | Question: give me a list of cities whose temperature in march is lower than that in july or higher than that in oct? | Tables: city -> City_ID, City, Hanzi, Hanyu_Pinyin, Regional_Population, GDP. match -> Match_ID, Date, Venue, Score, Result, Competition. temperature -> City_ID, Jan, Feb, Mar, Apr, Jun, Jul, Aug, Sep,... | give me a list of cities whose temperature in march is lower than that in july or higher than that in oct? |
city_record | select t1.city from city as t1 join temperature as t2 on t1.city_id = t2.city_id where t2.mar < t2.jul or t2.mar > t2.oct | Question: which cities' temperature in march is lower than that in july or higher than that in oct? | Tables: city -> City_ID, City, Hanzi, Hanyu_Pinyin, Regional_Population, GDP. match -> Match_ID, Date, Venue, Score, Result, Competition. temperature -> City_ID, Jan, Feb, Mar, Apr, Jun, Jul, Aug, Sep, Oct, Nov, Dec. h... | which cities' temperature in march is lower than that in july or higher than that in oct? |
city_record | select t1.city from city as t1 join temperature as t2 on t1.city_id = t2.city_id where t2.mar < t2.jul intersect select t3.city from city as t3 join hosting_city as t4 on t3.city_id = t4.host_city | Question: give me a list of cities whose temperature in mar is lower than that in july and which have also served as host cities? | Tables: city -> City_ID, City, Hanzi, Hanyu_Pinyin, Regional_Population, GDP. match -> Match_ID, Date, Venue, Score, Result, Competition. temperature -> City_ID, Jan, Feb, Mar, Apr, Jun, J... | give me a list of cities whose temperature in mar is lower than that in july and which have also served as host cities? |
city_record | select t1.city from city as t1 join temperature as t2 on t1.city_id = t2.city_id where t2.mar < t2.jul intersect select t3.city from city as t3 join hosting_city as t4 on t3.city_id = t4.host_city | Question: which cities have lower temperature in march than in july and have been once host cities? | Tables: city -> City_ID, City, Hanzi, Hanyu_Pinyin, Regional_Population, GDP. match -> Match_ID, Date, Venue, Score, Result, Competition. temperature -> City_ID, Jan, Feb, Mar, Apr, Jun, Jul, Aug, Sep, Oct, Nov, Dec. h... | which cities have lower temperature in march than in july and have been once host cities? |
city_record | select t1.city from city as t1 join temperature as t2 on t1.city_id = t2.city_id where t2.mar < t2.dec except select t3.city from city as t3 join hosting_city as t4 on t3.city_id = t4.host_city | Question: give me a list of cities whose temperature in mar is lower than that in dec and which have never been host cities. | Tables: city -> City_ID, City, Hanzi, Hanyu_Pinyin, Regional_Population, GDP. match -> Match_ID, Date, Venue, Score, Result, Competition. temperature -> City_ID, Jan, Feb, Mar, Apr, Jun, Jul, A... | give me a list of cities whose temperature in mar is lower than that in dec and which have never been host cities. |
city_record | select t1.city from city as t1 join temperature as t2 on t1.city_id = t2.city_id where t2.mar < t2.dec except select t3.city from city as t3 join hosting_city as t4 on t3.city_id = t4.host_city | Question: which cities have lower temperature in march than in dec and have never served as host cities? | Tables: city -> City_ID, City, Hanzi, Hanyu_Pinyin, Regional_Population, GDP. match -> Match_ID, Date, Venue, Score, Result, Competition. temperature -> City_ID, Jan, Feb, Mar, Apr, Jun, Jul, Aug, Sep, Oct, Nov, D... | which cities have lower temperature in march than in dec and have never served as host cities? |
city_record | select t1.city from city as t1 join temperature as t2 on t1.city_id = t2.city_id where t2.feb > t2.jun union select t3.city from city as t3 join hosting_city as t4 on t3.city_id = t4.host_city | Question: give me a list of cities whose temperature in feb is higher than that in jun or cities that were once host cities? | Tables: city -> City_ID, City, Hanzi, Hanyu_Pinyin, Regional_Population, GDP. match -> Match_ID, Date, Venue, Score, Result, Competition. temperature -> City_ID, Jan, Feb, Mar, Apr, Jun, Jul, A... | give me a list of cities whose temperature in feb is higher than that in jun or cities that were once host cities? |
city_record | select t1.city from city as t1 join temperature as t2 on t1.city_id = t2.city_id where t2.feb > t2.jun union select t3.city from city as t3 join hosting_city as t4 on t3.city_id = t4.host_city | Question: which cities have higher temperature in feb than in jun or have once served as host cities? | Tables: city -> City_ID, City, Hanzi, Hanyu_Pinyin, Regional_Population, GDP. match -> Match_ID, Date, Venue, Score, Result, Competition. temperature -> City_ID, Jan, Feb, Mar, Apr, Jun, Jul, Aug, Sep, Oct, Nov, Dec.... | which cities have higher temperature in feb than in jun or have once served as host cities? |
city_record | select city from city where regional_population > 10000000 | Question: please give me a list of cities whose regional population is over 10000000. | Tables: city -> City_ID, City, Hanzi, Hanyu_Pinyin, Regional_Population, GDP. match -> Match_ID, Date, Venue, Score, Result, Competition. temperature -> City_ID, Jan, Feb, Mar, Apr, Jun, Jul, Aug, Sep, Oct, Nov, Dec. hosting_city ->... | please give me a list of cities whose regional population is over 10000000. |
city_record | select city from city where regional_population > 10000000 | Question: which cities have regional population above 10000000? | Tables: city -> City_ID, City, Hanzi, Hanyu_Pinyin, Regional_Population, GDP. match -> Match_ID, Date, Venue, Score, Result, Competition. temperature -> City_ID, Jan, Feb, Mar, Apr, Jun, Jul, Aug, Sep, Oct, Nov, Dec. hosting_city -> Year, Match_ID, Host_... | which cities have regional population above 10000000? |
city_record | select city from city where regional_population > 10000000 union select city from city where regional_population < 5000000 | Question: please give me a list of cities whose regional population is over 8000000 or under 5000000. | Tables: city -> City_ID, City, Hanzi, Hanyu_Pinyin, Regional_Population, GDP. match -> Match_ID, Date, Venue, Score, Result, Competition. temperature -> City_ID, Jan, Feb, Mar, Apr, Jun, Jul, Aug, Sep, Oct, Nov, Dec.... | please give me a list of cities whose regional population is over 8000000 or under 5000000. |
city_record | select city from city where regional_population > 10000000 union select city from city where regional_population < 5000000 | Question: which cities have regional population above 8000000 or below 5000000? | Tables: city -> City_ID, City, Hanzi, Hanyu_Pinyin, Regional_Population, GDP. match -> Match_ID, Date, Venue, Score, Result, Competition. temperature -> City_ID, Jan, Feb, Mar, Apr, Jun, Jul, Aug, Sep, Oct, Nov, Dec. hosting_city -> Year,... | which cities have regional population above 8000000 or below 5000000? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.