db_name
stringclasses 146
values | prompt
stringlengths 310
4.81k
|
|---|---|
music_4
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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, Result )
#
# volume.Artist_ID can be joined with artist.Artist_ID
# music_festival.Volume can be joined with volume.Volume_ID
#
### Question:
#
# How many music festivals have had each kind of result, ordered descending by count?
#
### SQL:
#
# SELECT RESULT , COUNT(*) FROM music_festival GROUP BY RESULT ORDER BY COUNT(*) DESC
#
### End.
|
music_4
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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, Result )
#
# volume.Artist_ID can be joined with artist.Artist_ID
# music_festival.Volume can be joined with volume.Volume_ID
#
### Question:
#
# What are the issue dates of volumes associated with the artist aged 23 or younger?
#
### SQL:
#
# SELECT Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age <= 23
#
### End.
|
music_4
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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, Result )
#
# volume.Artist_ID can be joined with artist.Artist_ID
# music_festival.Volume can be joined with volume.Volume_ID
#
### Question:
#
# Return the issue dates of volumes by artists who are at most 23 years old?
#
### SQL:
#
# SELECT Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age <= 23
#
### End.
|
roller_coaster
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# roller_coaster ( Roller_Coaster_ID, Name, Park, Country_ID, Length, Height, Speed, Opened, Status )
# country ( Country_ID, Name, Population, Area, Languages )
#
# roller_coaster.Country_ID can be joined with country.Country_ID
#
### Question:
#
# How many roller coasters are there?
#
### SQL:
#
# SELECT count(*) FROM roller_coaster
#
### End.
|
roller_coaster
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# roller_coaster ( Roller_Coaster_ID, Name, Park, Country_ID, Length, Height, Speed, Opened, Status )
# country ( Country_ID, Name, Population, Area, Languages )
#
# roller_coaster.Country_ID can be joined with country.Country_ID
#
### Question:
#
# List the names of roller coasters by ascending order of length.
#
### SQL:
#
# SELECT Name FROM roller_coaster ORDER BY LENGTH ASC
#
### End.
|
roller_coaster
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# roller_coaster ( Roller_Coaster_ID, Name, Park, Country_ID, Length, Height, Speed, Opened, Status )
# country ( Country_ID, Name, Population, Area, Languages )
#
# roller_coaster.Country_ID can be joined with country.Country_ID
#
### Question:
#
# What are the lengths and heights of roller coasters?
#
### SQL:
#
# SELECT LENGTH , Height FROM roller_coaster
#
### End.
|
roller_coaster
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# roller_coaster ( Roller_Coaster_ID, Name, Park, Country_ID, Length, Height, Speed, Opened, Status )
# country ( Country_ID, Name, Population, Area, Languages )
#
# roller_coaster.Country_ID can be joined with country.Country_ID
#
### Question:
#
# List the names of countries whose language is not "German".
#
### SQL:
#
# SELECT Name FROM country WHERE Languages != "German"
#
### End.
|
roller_coaster
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# roller_coaster ( Roller_Coaster_ID, Name, Park, Country_ID, Length, Height, Speed, Opened, Status )
# country ( Country_ID, Name, Population, Area, Languages )
#
# roller_coaster.Country_ID can be joined with country.Country_ID
#
### Question:
#
# Show the statuses of roller coasters longer than 3300 or higher than 100.
#
### SQL:
#
# SELECT Status FROM roller_coaster WHERE LENGTH > 3300 OR Height > 100
#
### End.
|
roller_coaster
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# roller_coaster ( Roller_Coaster_ID, Name, Park, Country_ID, Length, Height, Speed, Opened, Status )
# country ( Country_ID, Name, Population, Area, Languages )
#
# roller_coaster.Country_ID can be joined with country.Country_ID
#
### Question:
#
# What are the speeds of the longest roller coaster?
#
### SQL:
#
# SELECT Speed FROM roller_coaster ORDER BY LENGTH DESC LIMIT 1
#
### End.
|
roller_coaster
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# roller_coaster ( Roller_Coaster_ID, Name, Park, Country_ID, Length, Height, Speed, Opened, Status )
# country ( Country_ID, Name, Population, Area, Languages )
#
# roller_coaster.Country_ID can be joined with country.Country_ID
#
### Question:
#
# What is the average speed of roller coasters?
#
### SQL:
#
# SELECT avg(Speed) FROM roller_coaster
#
### End.
|
roller_coaster
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# roller_coaster ( Roller_Coaster_ID, Name, Park, Country_ID, Length, Height, Speed, Opened, Status )
# country ( Country_ID, Name, Population, Area, Languages )
#
# roller_coaster.Country_ID can be joined with country.Country_ID
#
### Question:
#
# Show the different statuses and the numbers of roller coasters for each status.
#
### SQL:
#
# SELECT Status , COUNT(*) FROM roller_coaster GROUP BY Status
#
### End.
|
roller_coaster
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# roller_coaster ( Roller_Coaster_ID, Name, Park, Country_ID, Length, Height, Speed, Opened, Status )
# country ( Country_ID, Name, Population, Area, Languages )
#
# roller_coaster.Country_ID can be joined with country.Country_ID
#
### Question:
#
# Please show the most common status of roller coasters.
#
### SQL:
#
# SELECT Status FROM roller_coaster GROUP BY Status ORDER BY COUNT(*) DESC LIMIT 1
#
### End.
|
roller_coaster
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# roller_coaster ( Roller_Coaster_ID, Name, Park, Country_ID, Length, Height, Speed, Opened, Status )
# country ( Country_ID, Name, Population, Area, Languages )
#
# roller_coaster.Country_ID can be joined with country.Country_ID
#
### Question:
#
# List the status shared by more than two roller coaster.
#
### SQL:
#
# SELECT Status FROM roller_coaster GROUP BY Status HAVING COUNT(*) > 2
#
### End.
|
roller_coaster
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# roller_coaster ( Roller_Coaster_ID, Name, Park, Country_ID, Length, Height, Speed, Opened, Status )
# country ( Country_ID, Name, Population, Area, Languages )
#
# roller_coaster.Country_ID can be joined with country.Country_ID
#
### Question:
#
# Show the park of the roller coaster with the highest speed.
#
### SQL:
#
# SELECT Park FROM roller_coaster ORDER BY Speed DESC LIMIT 1
#
### End.
|
roller_coaster
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# roller_coaster ( Roller_Coaster_ID, Name, Park, Country_ID, Length, Height, Speed, Opened, Status )
# country ( Country_ID, Name, Population, Area, Languages )
#
# roller_coaster.Country_ID can be joined with country.Country_ID
#
### Question:
#
# Show the names of roller coasters and names of country they are in.
#
### SQL:
#
# SELECT T2.Name , T1.Name FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID
#
### End.
|
roller_coaster
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# roller_coaster ( Roller_Coaster_ID, Name, Park, Country_ID, Length, Height, Speed, Opened, Status )
# country ( Country_ID, Name, Population, Area, Languages )
#
# roller_coaster.Country_ID can be joined with country.Country_ID
#
### Question:
#
# Show the names of countries that have more than one roller coaster.
#
### SQL:
#
# 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
#
### End.
|
roller_coaster
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# roller_coaster ( Roller_Coaster_ID, Name, Park, Country_ID, Length, Height, Speed, Opened, Status )
# country ( Country_ID, Name, Population, Area, Languages )
#
# roller_coaster.Country_ID can be joined with country.Country_ID
#
### Question:
#
# Show the name and population of the country that has the highest roller coaster.
#
### SQL:
#
# 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
#
### End.
|
roller_coaster
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# roller_coaster ( Roller_Coaster_ID, Name, Park, Country_ID, Length, Height, Speed, Opened, Status )
# country ( Country_ID, Name, Population, Area, Languages )
#
# roller_coaster.Country_ID can be joined with country.Country_ID
#
### Question:
#
# Show the names of countries and the average speed of roller coasters from each country.
#
### SQL:
#
# 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
#
### End.
|
roller_coaster
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# roller_coaster ( Roller_Coaster_ID, Name, Park, Country_ID, Length, Height, Speed, Opened, Status )
# country ( Country_ID, Name, Population, Area, Languages )
#
# roller_coaster.Country_ID can be joined with country.Country_ID
#
### Question:
#
# How many countries do not have an roller coaster longer than 3000?
#
### SQL:
#
# SELECT count(*) FROM country WHERE country_id NOT IN ( SELECT country_id FROM roller_coaster WHERE LENGTH > 3000 )
#
### End.
|
roller_coaster
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# roller_coaster ( Roller_Coaster_ID, Name, Park, Country_ID, Length, Height, Speed, Opened, Status )
# country ( Country_ID, Name, Population, Area, Languages )
#
# roller_coaster.Country_ID can be joined with country.Country_ID
#
### Question:
#
# What are the country names, area and population which has both roller coasters with speed higher
#
### SQL:
#
# 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
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# How many different captain ranks are there?
#
### SQL:
#
# SELECT count(DISTINCT rank) FROM captain
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# Count the number of different ranks of captain.
#
### SQL:
#
# SELECT count(DISTINCT rank) FROM captain
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# How many captains are in each rank?
#
### SQL:
#
# SELECT count(*) , rank FROM captain GROUP BY rank
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# Count the number of captains that have each rank.
#
### SQL:
#
# SELECT count(*) , rank FROM captain GROUP BY rank
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# How many captains with younger than 50 are in each rank?
#
### SQL:
#
# SELECT count(*) , rank FROM captain WHERE age < 50 GROUP BY rank
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# Count the number of captains younger than 50 of each rank.
#
### SQL:
#
# SELECT count(*) , rank FROM captain WHERE age < 50 GROUP BY rank
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# Sort all captain names by their ages from old to young.
#
### SQL:
#
# SELECT name FROM captain ORDER BY age DESC
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# What are the names of captains, sorted by age descending?
#
### SQL:
#
# SELECT name FROM captain ORDER BY age DESC
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# Find the name, class and rank of all captains.
#
### SQL:
#
# SELECT name , CLASS , rank FROM captain
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# What are the names, classes, and ranks of all captains?
#
### SQL:
#
# SELECT name , CLASS , rank FROM captain
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# Which rank is the most common among captains?
#
### SQL:
#
# SELECT rank FROM captain GROUP BY rank ORDER BY count(*) DESC LIMIT 1
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# Return the rank for which there are the fewest captains.
#
### SQL:
#
# SELECT rank FROM captain GROUP BY rank ORDER BY count(*) DESC LIMIT 1
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# Which classes have more than two captains?
#
### SQL:
#
# SELECT CLASS FROM captain GROUP BY CLASS HAVING count(*) > 2
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# Give the classes that have more than two captains.
#
### SQL:
#
# SELECT CLASS FROM captain GROUP BY CLASS HAVING count(*) > 2
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# Find the name of captains whose rank are either Midshipman or Lieutenant.
#
### SQL:
#
# SELECT name FROM captain WHERE rank = 'Midshipman' OR rank = 'Lieutenant'
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# What are the names of captains that have either the rank Midshipman or Lieutenant?
#
### SQL:
#
# SELECT name FROM captain WHERE rank = 'Midshipman' OR rank = 'Lieutenant'
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# What are the average and minimum age of captains in different class?
#
### SQL:
#
# SELECT avg(age) , min(age) , CLASS FROM captain GROUP BY CLASS
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# Return the average and minimum age of captains in each class.
#
### SQL:
#
# SELECT avg(age) , min(age) , CLASS FROM captain GROUP BY CLASS
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# Find the captain rank that has some captains in both Cutter and Armed schooner classes.
#
### SQL:
#
# SELECT rank FROM captain WHERE CLASS = 'Cutter' INTERSECT SELECT rank FROM captain WHERE CLASS = 'Armed schooner'
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# What are the ranks of captains that are both in the Cutter and Armed schooner classes?
#
### SQL:
#
# SELECT rank FROM captain WHERE CLASS = 'Cutter' INTERSECT SELECT rank FROM captain WHERE CLASS = 'Armed schooner'
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# Find the captain rank that has no captain in Third-rate ship of the line class.
#
### SQL:
#
# SELECT rank FROM captain EXCEPT SELECT rank FROM captain WHERE CLASS = 'Third-rate ship of the line'
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# What are the ranks of captains that have no captain that are in the Third-rate ship of the line class?
#
### SQL:
#
# SELECT rank FROM captain EXCEPT SELECT rank FROM captain WHERE CLASS = 'Third-rate ship of the line'
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# What is the name of the youngest captain?
#
### SQL:
#
# SELECT name FROM captain ORDER BY age LIMIT 1
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# Return the name of the youngest captain.
#
### SQL:
#
# SELECT name FROM captain ORDER BY age LIMIT 1
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# how many ships are there?
#
### SQL:
#
# SELECT count(*) FROM ship
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# Count the number of ships.
#
### SQL:
#
# SELECT count(*) FROM ship
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# Find the name, type, and flag of the ship that is built in the most recent year.
#
### SQL:
#
# SELECT name , TYPE , flag FROM ship ORDER BY built_year DESC LIMIT 1
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# What is the name, type, and flag of the ship that was built in the most recent year?
#
### SQL:
#
# SELECT name , TYPE , flag FROM ship ORDER BY built_year DESC LIMIT 1
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# Group by ships by flag, and return number of ships that have each flag.
#
### SQL:
#
# SELECT count(*) , flag FROM ship GROUP BY flag
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# What are the different ship flags, and how many ships have each?
#
### SQL:
#
# SELECT count(*) , flag FROM ship GROUP BY flag
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# Which flag is most widely used among all ships?
#
### SQL:
#
# SELECT flag FROM ship GROUP BY flag ORDER BY count(*) DESC LIMIT 1
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# Return the flag that is most common among all ships.
#
### SQL:
#
# SELECT flag FROM ship GROUP BY flag ORDER BY count(*) DESC LIMIT 1
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# List all ship names in the order of built year and class.
#
### SQL:
#
# SELECT name FROM ship ORDER BY built_year , CLASS
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# What are the names of ships, ordered by year they were built and their class?
#
### SQL:
#
# SELECT name FROM ship ORDER BY built_year , CLASS
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# Find the ship type that are used by both ships with Panama and Malta flags.
#
### SQL:
#
# SELECT TYPE FROM ship WHERE flag = 'Panama' INTERSECT SELECT TYPE FROM ship WHERE flag = 'Malta'
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# What types of ships have both ships that have Panama Flags and Malta flags?
#
### SQL:
#
# SELECT TYPE FROM ship WHERE flag = 'Panama' INTERSECT SELECT TYPE FROM ship WHERE flag = 'Malta'
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# In which year were most of ships built?
#
### SQL:
#
# SELECT built_year FROM ship GROUP BY built_year ORDER BY count(*) DESC LIMIT 1
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# What is the year in which most ships were built?
#
### SQL:
#
# SELECT built_year FROM ship GROUP BY built_year ORDER BY count(*) DESC LIMIT 1
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# Find the name of the ships that have more than one captain.
#
### SQL:
#
# 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
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# What are the names of ships that have more than one captain?
#
### SQL:
#
# 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
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# what are the names and classes of the ships that do not have any captain yet?
#
### SQL:
#
# SELECT name , CLASS FROM ship WHERE ship_id NOT IN (SELECT ship_id FROM captain)
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# Return the names and classes of ships that do not have a captain?
#
### SQL:
#
# SELECT name , CLASS FROM ship WHERE ship_id NOT IN (SELECT ship_id FROM captain)
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# Find the name of the ship that is steered by the youngest captain.
#
### SQL:
#
# SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id ORDER BY t2.age LIMIT 1
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# What is the name of the ship that is commanded by the youngest captain?
#
### SQL:
#
# SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id ORDER BY t2.age LIMIT 1
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# Find the name and flag of ships that are not steered by any captain with Midshipman rank.
#
### SQL:
#
# SELECT name , flag FROM ship WHERE ship_id NOT IN (SELECT ship_id FROM captain WHERE rank = 'Midshipman')
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# What are the names and flags of ships that do not have a captain with the rank of Midshipman?
#
### SQL:
#
# SELECT name , flag FROM ship WHERE ship_id NOT IN (SELECT ship_id FROM captain WHERE rank = 'Midshipman')
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### Question:
#
# Find the name of the ships that are steered by both a captain with Midshipman rank and a captain with Lieutenant rank.
#
### SQL:
#
# 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'
#
### End.
|
ship_1
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# captain ( Captain_ID, Name, Ship_ID, age, Class, Rank )
# Ship ( Ship_ID, Name, Type, Built_Year, Class, Flag )
#
# captain.Ship_ID can be joined with Ship.Ship_ID
#
### 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?
#
### SQL:
#
# 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'
#
### End.
|
city_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# temperature.City_ID can be joined with city.City_ID
# hosting_city.Match_ID can be joined with match.Match_ID
# hosting_city.Host_City can be joined with city.City_ID
#
### Question:
#
# What is id of the city that hosted events in the most recent year?
#
### SQL:
#
# SELECT host_city FROM hosting_city ORDER BY YEAR DESC LIMIT 1
#
### End.
|
city_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# temperature.City_ID can be joined with city.City_ID
# hosting_city.Match_ID can be joined with match.Match_ID
# hosting_city.Host_City can be joined with city.City_ID
#
### Question:
#
# Find the city that hosted some events in the most recent year. What is the id of this city?
#
### SQL:
#
# SELECT host_city FROM hosting_city ORDER BY YEAR DESC LIMIT 1
#
### End.
|
city_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# temperature.City_ID can be joined with city.City_ID
# hosting_city.Match_ID can be joined with match.Match_ID
# hosting_city.Host_City can be joined with city.City_ID
#
### Question:
#
# Find the match ids of the cities that hosted competition "1994 FIFA World Cup qualification"?
#
### SQL:
#
# SELECT match_id FROM MATCH WHERE competition = "1994 FIFA World Cup qualification"
#
### End.
|
city_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# temperature.City_ID can be joined with city.City_ID
# hosting_city.Match_ID can be joined with match.Match_ID
# hosting_city.Host_City can be joined with city.City_ID
#
### Question:
#
# What is the match id of the competition called "1994 FIFA World Cup qualification"?
#
### SQL:
#
# SELECT match_id FROM MATCH WHERE competition = "1994 FIFA World Cup qualification"
#
### End.
|
city_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# temperature.City_ID can be joined with city.City_ID
# hosting_city.Match_ID can be joined with match.Match_ID
# hosting_city.Host_City can be joined with city.City_ID
#
### Question:
#
# Find the cities which were once a host city after 2010?
#
### SQL:
#
# SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T2.year > 2010
#
### End.
|
city_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# temperature.City_ID can be joined with city.City_ID
# hosting_city.Match_ID can be joined with match.Match_ID
# hosting_city.Host_City can be joined with city.City_ID
#
### Question:
#
# Which cities served as a host city after 2010?
#
### SQL:
#
# SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T2.year > 2010
#
### End.
|
city_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# temperature.City_ID can be joined with city.City_ID
# hosting_city.Match_ID can be joined with match.Match_ID
# hosting_city.Host_City can be joined with city.City_ID
#
### Question:
#
# Which city has hosted the most events?
#
### SQL:
#
# 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
#
### End.
|
city_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# temperature.City_ID can be joined with city.City_ID
# hosting_city.Match_ID can be joined with match.Match_ID
# hosting_city.Host_City can be joined with city.City_ID
#
### Question:
#
# Find the city that hosted the most events.
#
### SQL:
#
# 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
#
### End.
|
city_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# temperature.City_ID can be joined with city.City_ID
# hosting_city.Match_ID can be joined with match.Match_ID
# hosting_city.Host_City can be joined with city.City_ID
#
### Question:
#
# What is the venue of the competition "1994 FIFA World Cup qualification" hosted by "Nanjing ( Jiangsu )"?
#
### SQL:
#
# 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"
#
### End.
|
city_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# temperature.City_ID can be joined with city.City_ID
# hosting_city.Match_ID can be joined with match.Match_ID
# hosting_city.Host_City can be joined with city.City_ID
#
### Question:
#
# Find the venue of the competition "1994 FIFA World Cup qualification" which was hosted by "Nanjing ( Jiangsu )".
#
### SQL:
#
# 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"
#
### End.
|
city_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# temperature.City_ID can be joined with city.City_ID
# hosting_city.Match_ID can be joined with match.Match_ID
# hosting_city.Host_City can be joined with city.City_ID
#
### Question:
#
# Give me the temperature of Shanghai in January.
#
### SQL:
#
# SELECT T2.Jan FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T1.city = "Shanghai"
#
### End.
|
city_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# temperature.City_ID can be joined with city.City_ID
# hosting_city.Match_ID can be joined with match.Match_ID
# hosting_city.Host_City can be joined with city.City_ID
#
### Question:
#
# What is the temperature of "Shanghai" city in January?
#
### SQL:
#
# SELECT T2.Jan FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T1.city = "Shanghai"
#
### End.
|
city_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# temperature.City_ID can be joined with city.City_ID
# hosting_city.Match_ID can be joined with match.Match_ID
# hosting_city.Host_City can be joined with city.City_ID
#
### Question:
#
# What is the host year of city "Taizhou ( Zhejiang )"?
#
### SQL:
#
# SELECT T2.year FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T1.city = "Taizhou ( Zhejiang )"
#
### End.
|
city_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# temperature.City_ID can be joined with city.City_ID
# hosting_city.Match_ID can be joined with match.Match_ID
# hosting_city.Host_City can be joined with city.City_ID
#
### Question:
#
# IN which year did city "Taizhou ( Zhejiang )" serve as a host city?
#
### SQL:
#
# SELECT T2.year FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T1.city = "Taizhou ( Zhejiang )"
#
### End.
|
city_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# temperature.City_ID can be joined with city.City_ID
# hosting_city.Match_ID can be joined with match.Match_ID
# hosting_city.Host_City can be joined with city.City_ID
#
### Question:
#
# Which three cities have the largest regional population?
#
### SQL:
#
# SELECT city FROM city ORDER BY regional_population DESC LIMIT 3
#
### End.
|
city_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# temperature.City_ID can be joined with city.City_ID
# hosting_city.Match_ID can be joined with match.Match_ID
# hosting_city.Host_City can be joined with city.City_ID
#
### Question:
#
# What are the three largest cities in terms of regional population?
#
### SQL:
#
# SELECT city FROM city ORDER BY regional_population DESC LIMIT 3
#
### End.
|
city_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# temperature.City_ID can be joined with city.City_ID
# hosting_city.Match_ID can be joined with match.Match_ID
# hosting_city.Host_City can be joined with city.City_ID
#
### Question:
#
# Which city has the lowest GDP? Please list the city name and its GDP.
#
### SQL:
#
# SELECT city , GDP FROM city ORDER BY GDP LIMIT 1
#
### End.
|
city_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# temperature.City_ID can be joined with city.City_ID
# hosting_city.Match_ID can be joined with match.Match_ID
# hosting_city.Host_City can be joined with city.City_ID
#
### Question:
#
# What is the city with the smallest GDP? Return the city and its GDP.
#
### SQL:
#
# SELECT city , GDP FROM city ORDER BY GDP LIMIT 1
#
### End.
|
city_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# temperature.City_ID can be joined with city.City_ID
# hosting_city.Match_ID can be joined with match.Match_ID
# hosting_city.Host_City can be joined with city.City_ID
#
### Question:
#
# Which city has the highest temperature in February?
#
### SQL:
#
# 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
#
### End.
|
city_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# temperature.City_ID can be joined with city.City_ID
# hosting_city.Match_ID can be joined with match.Match_ID
# hosting_city.Host_City can be joined with city.City_ID
#
### Question:
#
# In February, which city marks the highest temperature?
#
### SQL:
#
# 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
#
### End.
|
city_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# temperature.City_ID can be joined with city.City_ID
# hosting_city.Match_ID can be joined with match.Match_ID
# hosting_city.Host_City can be joined with city.City_ID
#
### Question:
#
# Give me a list of cities whose temperature in March is lower than that in July or higher than that in Oct?
#
### SQL:
#
# 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
#
### End.
|
city_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# temperature.City_ID can be joined with city.City_ID
# hosting_city.Match_ID can be joined with match.Match_ID
# hosting_city.Host_City can be joined with city.City_ID
#
### Question:
#
# Which cities' temperature in March is lower than that in July or higher than that in Oct?
#
### SQL:
#
# 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
#
### End.
|
city_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# temperature.City_ID can be joined with city.City_ID
# hosting_city.Match_ID can be joined with match.Match_ID
# hosting_city.Host_City can be joined with city.City_ID
#
### 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?
#
### SQL:
#
# 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
#
### End.
|
city_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# temperature.City_ID can be joined with city.City_ID
# hosting_city.Match_ID can be joined with match.Match_ID
# hosting_city.Host_City can be joined with city.City_ID
#
### Question:
#
# Which cities have lower temperature in March than in July and have been once host cities?
#
### SQL:
#
# 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
#
### End.
|
city_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# temperature.City_ID can be joined with city.City_ID
# hosting_city.Match_ID can be joined with match.Match_ID
# hosting_city.Host_City can be joined with city.City_ID
#
### Question:
#
# Give me a list of cities whose temperature in Mar is lower than that in Dec and which have never been host cities.
#
### SQL:
#
# 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
#
### End.
|
city_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# temperature.City_ID can be joined with city.City_ID
# hosting_city.Match_ID can be joined with match.Match_ID
# hosting_city.Host_City can be joined with city.City_ID
#
### Question:
#
# Which cities have lower temperature in March than in Dec and have never served as host cities?
#
### SQL:
#
# 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
#
### End.
|
city_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# temperature.City_ID can be joined with city.City_ID
# hosting_city.Match_ID can be joined with match.Match_ID
# hosting_city.Host_City can be joined with city.City_ID
#
### Question:
#
# Give me a list of cities whose temperature in Feb is higher than that in Jun or cities that were once host cities?
#
### SQL:
#
# 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
#
### End.
|
city_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# temperature.City_ID can be joined with city.City_ID
# hosting_city.Match_ID can be joined with match.Match_ID
# hosting_city.Host_City can be joined with city.City_ID
#
### Question:
#
# Which cities have higher temperature in Feb than in Jun or have once served as host cities?
#
### SQL:
#
# 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
#
### End.
|
city_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# temperature.City_ID can be joined with city.City_ID
# hosting_city.Match_ID can be joined with match.Match_ID
# hosting_city.Host_City can be joined with city.City_ID
#
### Question:
#
# Please give me a list of cities whose regional population is over 10000000.
#
### SQL:
#
# SELECT city FROM city WHERE regional_population > 10000000
#
### End.
|
city_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# temperature.City_ID can be joined with city.City_ID
# hosting_city.Match_ID can be joined with match.Match_ID
# hosting_city.Host_City can be joined with city.City_ID
#
### Question:
#
# Which cities have regional population above 10000000?
#
### SQL:
#
# SELECT city FROM city WHERE regional_population > 10000000
#
### End.
|
city_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# temperature.City_ID can be joined with city.City_ID
# hosting_city.Match_ID can be joined with match.Match_ID
# hosting_city.Host_City can be joined with city.City_ID
#
### Question:
#
# Please give me a list of cities whose regional population is over 8000000 or under 5000000.
#
### SQL:
#
# SELECT city FROM city WHERE regional_population > 10000000 UNION SELECT city FROM city WHERE regional_population < 5000000
#
### End.
|
city_record
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# temperature.City_ID can be joined with city.City_ID
# hosting_city.Match_ID can be joined with match.Match_ID
# hosting_city.Host_City can be joined with city.City_ID
#
### Question:
#
# Which cities have regional population above 8000000 or below 5000000?
#
### SQL:
#
# SELECT city FROM city WHERE regional_population > 10000000 UNION SELECT city FROM city WHERE regional_population < 5000000
#
### End.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.