query_id
int64
0
7k
database_id
stringclasses
140 values
table_id
sequencelengths
1
5
query
stringlengths
16
224
answer
stringlengths
18
577
difficulty
stringclasses
4 values
6,200
roller_coaster
[ "roller_coaster" ]
How many roller coasters are there?
SELECT count(*) FROM roller_coaster
easy
6,201
roller_coaster
[ "roller_coaster" ]
List the names of roller coasters by ascending order of length.
SELECT Name FROM roller_coaster ORDER BY LENGTH ASC
easy
6,202
roller_coaster
[ "roller_coaster" ]
What are the lengths and heights of roller coasters?
SELECT LENGTH , Height FROM roller_coaster
medium
6,203
roller_coaster
[ "country" ]
List the names of countries whose language is not "German".
SELECT Name FROM country WHERE Languages != "German"
easy
6,204
roller_coaster
[ "roller_coaster" ]
Show the statuses of roller coasters longer than 3300 or higher than 100.
SELECT Status FROM roller_coaster WHERE LENGTH > 3300 OR Height > 100
medium
6,205
roller_coaster
[ "roller_coaster" ]
What are the speeds of the longest roller coaster?
SELECT Speed FROM roller_coaster ORDER BY LENGTH DESC LIMIT 1
medium
6,206
roller_coaster
[ "roller_coaster" ]
What is the average speed of roller coasters?
SELECT avg(Speed) FROM roller_coaster
easy
6,207
roller_coaster
[ "roller_coaster" ]
Show the different statuses and the numbers of roller coasters for each status.
SELECT Status , COUNT(*) FROM roller_coaster GROUP BY Status
medium
6,208
roller_coaster
[ "roller_coaster" ]
Please show the most common status of roller coasters.
SELECT Status FROM roller_coaster GROUP BY Status ORDER BY COUNT(*) DESC LIMIT 1
hard
6,209
roller_coaster
[ "roller_coaster" ]
List the status shared by more than two roller coaster.
SELECT Status FROM roller_coaster GROUP BY Status HAVING COUNT(*) > 2
easy
6,210
roller_coaster
[ "roller_coaster" ]
Show the park of the roller coaster with the highest speed.
SELECT Park FROM roller_coaster ORDER BY Speed DESC LIMIT 1
medium
6,211
roller_coaster
[ "roller_coaster", "country" ]
Show the names of roller coasters and names of country they are in.
SELECT T2.Name , T1.Name FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID
medium
6,212
roller_coaster
[ "roller_coaster", "country" ]
Show the names of countries that have more than one 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
medium
6,213
roller_coaster
[ "roller_coaster", "country" ]
Show the name and population of the country that has the highest 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
hard
6,214
roller_coaster
[ "roller_coaster", "country" ]
Show the names of countries and the average speed of roller coasters from each country.
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
medium
6,215
roller_coaster
[ "roller_coaster", "country" ]
How many countries do not have an roller coaster longer than 3000?
SELECT count(*) FROM country WHERE country_id NOT IN ( SELECT country_id FROM roller_coaster WHERE LENGTH > 3000 )
extra
6,216
roller_coaster
[ "roller_coaster", "country" ]
What are the country names, area and population which has both roller coasters with speed higher
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
extra
6,217
ship_1
[ "captain" ]
How many different captain ranks are there?
SELECT count(DISTINCT rank) FROM captain
easy
6,218
ship_1
[ "captain" ]
Count the number of different ranks of captain.
SELECT count(DISTINCT rank) FROM captain
easy
6,219
ship_1
[ "captain" ]
How many captains are in each rank?
SELECT count(*) , rank FROM captain GROUP BY rank
medium
6,220
ship_1
[ "captain" ]
Count the number of captains that have each rank.
SELECT count(*) , rank FROM captain GROUP BY rank
medium
6,221
ship_1
[ "captain" ]
How many captains with younger than 50 are in each rank?
SELECT count(*) , rank FROM captain WHERE age < 50 GROUP BY rank
medium
6,222
ship_1
[ "captain" ]
Count the number of captains younger than 50 of each rank.
SELECT count(*) , rank FROM captain WHERE age < 50 GROUP BY rank
medium
6,223
ship_1
[ "captain" ]
Sort all captain names by their ages from old to young.
SELECT name FROM captain ORDER BY age DESC
easy
6,224
ship_1
[ "captain" ]
What are the names of captains, sorted by age descending?
SELECT name FROM captain ORDER BY age DESC
easy
6,225
ship_1
[ "captain" ]
Find the name, class and rank of all captains.
SELECT name , CLASS , rank FROM captain
medium
6,226
ship_1
[ "captain" ]
What are the names, classes, and ranks of all captains?
SELECT name , CLASS , rank FROM captain
medium
6,227
ship_1
[ "captain" ]
Which rank is the most common among captains?
SELECT rank FROM captain GROUP BY rank ORDER BY count(*) DESC LIMIT 1
hard
6,228
ship_1
[ "captain" ]
Return the rank for which there are the fewest captains.
SELECT rank FROM captain GROUP BY rank ORDER BY count(*) DESC LIMIT 1
hard
6,229
ship_1
[ "captain" ]
Which classes have more than two captains?
SELECT CLASS FROM captain GROUP BY CLASS HAVING count(*) > 2
easy
6,230
ship_1
[ "captain" ]
Give the classes that have more than two captains.
SELECT CLASS FROM captain GROUP BY CLASS HAVING count(*) > 2
easy
6,231
ship_1
[ "captain" ]
Find the name of captains whose rank are either Midshipman or Lieutenant.
SELECT name FROM captain WHERE rank = 'Midshipman' OR rank = 'Lieutenant'
medium
6,232
ship_1
[ "captain" ]
What are the names of captains that have either the rank Midshipman or Lieutenant?
SELECT name FROM captain WHERE rank = 'Midshipman' OR rank = 'Lieutenant'
medium
6,233
ship_1
[ "captain" ]
What are the average and minimum age of captains in different class?
SELECT avg(age) , min(age) , CLASS FROM captain GROUP BY CLASS
medium
6,234
ship_1
[ "captain" ]
Return the average and minimum age of captains in each class.
SELECT avg(age) , min(age) , CLASS FROM captain GROUP BY CLASS
medium
6,235
ship_1
[ "captain" ]
Find the captain rank that has some captains in both Cutter and Armed schooner classes.
SELECT rank FROM captain WHERE CLASS = 'Cutter' INTERSECT SELECT rank FROM captain WHERE CLASS = 'Armed schooner'
hard
6,236
ship_1
[ "captain" ]
What are the ranks of captains that are both in the Cutter and Armed schooner classes?
SELECT rank FROM captain WHERE CLASS = 'Cutter' INTERSECT SELECT rank FROM captain WHERE CLASS = 'Armed schooner'
hard
6,237
ship_1
[ "captain" ]
Find the captain rank that has no captain in Third-rate ship of the line class.
SELECT rank FROM captain EXCEPT SELECT rank FROM captain WHERE CLASS = 'Third-rate ship of the line'
hard
6,238
ship_1
[ "captain" ]
What are the ranks of captains that have no captain that are in the Third-rate ship of the line class?
SELECT rank FROM captain EXCEPT SELECT rank FROM captain WHERE CLASS = 'Third-rate ship of the line'
hard
6,239
ship_1
[ "captain" ]
What is the name of the youngest captain?
SELECT name FROM captain ORDER BY age LIMIT 1
medium
6,240
ship_1
[ "captain" ]
Return the name of the youngest captain.
SELECT name FROM captain ORDER BY age LIMIT 1
medium
6,241
ship_1
[ "ship" ]
how many ships are there?
SELECT count(*) FROM ship
easy
6,242
ship_1
[ "ship" ]
Count the number of ships.
SELECT count(*) FROM ship
easy
6,243
ship_1
[ "ship" ]
Find the name, type, and flag of the ship that is built in the most recent year.
SELECT name , TYPE , flag FROM ship ORDER BY built_year DESC LIMIT 1
medium
6,244
ship_1
[ "ship" ]
What is the name, type, and flag of the ship that was built in the most recent year?
SELECT name , TYPE , flag FROM ship ORDER BY built_year DESC LIMIT 1
medium
6,245
ship_1
[ "ship" ]
Group by ships by flag, and return number of ships that have each flag.
SELECT count(*) , flag FROM ship GROUP BY flag
medium
6,246
ship_1
[ "ship" ]
What are the different ship flags, and how many ships have each?
SELECT count(*) , flag FROM ship GROUP BY flag
medium
6,247
ship_1
[ "ship" ]
Which flag is most widely used among all ships?
SELECT flag FROM ship GROUP BY flag ORDER BY count(*) DESC LIMIT 1
hard
6,248
ship_1
[ "ship" ]
Return the flag that is most common among all ships.
SELECT flag FROM ship GROUP BY flag ORDER BY count(*) DESC LIMIT 1
hard
6,249
ship_1
[ "ship" ]
List all ship names in the order of built year and class.
SELECT name FROM ship ORDER BY built_year , CLASS
easy
6,250
ship_1
[ "ship" ]
What are the names of ships, ordered by year they were built and their class?
SELECT name FROM ship ORDER BY built_year , CLASS
easy
6,251
ship_1
[ "ship" ]
Find the ship type that are used by both ships with Panama and Malta flags.
SELECT TYPE FROM ship WHERE flag = 'Panama' INTERSECT SELECT TYPE FROM ship WHERE flag = 'Malta'
hard
6,252
ship_1
[ "ship" ]
What types of ships have both ships that have Panama Flags and Malta flags?
SELECT TYPE FROM ship WHERE flag = 'Panama' INTERSECT SELECT TYPE FROM ship WHERE flag = 'Malta'
hard
6,253
ship_1
[ "ship" ]
In which year were most of ships built?
SELECT built_year FROM ship GROUP BY built_year ORDER BY count(*) DESC LIMIT 1
hard
6,254
ship_1
[ "ship" ]
What is the year in which most ships were built?
SELECT built_year FROM ship GROUP BY built_year ORDER BY count(*) DESC LIMIT 1
hard
6,255
ship_1
[ "captain", "ship" ]
Find the name of the ships that have more than one captain.
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
medium
6,256
ship_1
[ "captain", "ship" ]
What are the names of ships that have more than one captain?
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
medium
6,257
ship_1
[ "captain", "ship" ]
what are the names and classes of the ships that do not have any captain yet?
SELECT name , CLASS FROM ship WHERE ship_id NOT IN (SELECT ship_id FROM captain)
extra
6,258
ship_1
[ "captain", "ship" ]
Return the names and classes of ships that do not have a captain?
SELECT name , CLASS FROM ship WHERE ship_id NOT IN (SELECT ship_id FROM captain)
extra
6,259
ship_1
[ "captain", "ship" ]
Find the name of the ship that is steered by the youngest captain.
SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id ORDER BY t2.age LIMIT 1
hard
6,260
ship_1
[ "captain", "ship" ]
What is the name of the ship that is commanded by the youngest captain?
SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id ORDER BY t2.age LIMIT 1
hard
6,261
ship_1
[ "captain", "ship" ]
Find the name and flag of ships that are not steered by any captain with Midshipman rank.
SELECT name , flag FROM ship WHERE ship_id NOT IN (SELECT ship_id FROM captain WHERE rank = 'Midshipman')
extra
6,262
ship_1
[ "captain", "ship" ]
What are the names and flags of ships that do not have a captain with the rank of Midshipman?
SELECT name , flag FROM ship WHERE ship_id NOT IN (SELECT ship_id FROM captain WHERE rank = 'Midshipman')
extra
6,263
ship_1
[ "captain", "ship" ]
Find the name of the ships that are steered by both a captain with Midshipman rank and a captain with Lieutenant rank.
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'
extra
6,264
ship_1
[ "captain", "ship" ]
What are the names of ships that are commanded by both captains with the rank of Midshipman and captains with the rank of Lieutenant?
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'
extra
6,265
city_record
[ "hosting_city" ]
What is id of the city that hosted events in the most recent year?
SELECT host_city FROM hosting_city ORDER BY YEAR DESC LIMIT 1
medium
6,266
city_record
[ "hosting_city" ]
Find the city that hosted some events in the most recent year. What is the id of this city?
SELECT host_city FROM hosting_city ORDER BY YEAR DESC LIMIT 1
medium
6,267
city_record
[ "MATCH" ]
Find the match ids of the cities that hosted competition "1994 FIFA World Cup qualification"?
SELECT match_id FROM MATCH WHERE competition = "1994 FIFA World Cup qualification"
easy
6,268
city_record
[ "MATCH" ]
What is the match id of the competition called "1994 FIFA World Cup qualification"?
SELECT match_id FROM MATCH WHERE competition = "1994 FIFA World Cup qualification"
easy
6,269
city_record
[ "city", "hosting_city" ]
Find the cities which were once a host city after 2010?
SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T2.year > 2010
medium
6,270
city_record
[ "city", "hosting_city" ]
Which cities served as a host city after 2010?
SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T2.year > 2010
medium
6,271
city_record
[ "city", "hosting_city" ]
Which city has hosted the most events?
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
extra
6,272
city_record
[ "city", "hosting_city" ]
Find the city that hosted the most events.
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
extra
6,273
city_record
[ "MATCH", "city", "hosting_city" ]
What is the venue of the competition "1994 FIFA World Cup qualification" hosted by "Nanjing ( Jiangsu )"?
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"
hard
6,274
city_record
[ "MATCH", "city", "hosting_city" ]
Find the venue of the competition "1994 FIFA World Cup qualification" which was hosted by "Nanjing ( Jiangsu )".
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"
hard
6,275
city_record
[ "city", "temperature" ]
Give me the temperature of Shanghai in January.
SELECT T2.Jan FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T1.city = "Shanghai"
medium
6,276
city_record
[ "city", "temperature" ]
What is the temperature of "Shanghai" city in January?
SELECT T2.Jan FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T1.city = "Shanghai"
medium
6,277
city_record
[ "city", "hosting_city" ]
What is the host year of city "Taizhou ( Zhejiang )"?
SELECT T2.year FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T1.city = "Taizhou ( Zhejiang )"
medium
6,278
city_record
[ "city", "hosting_city" ]
IN which year did city "Taizhou ( Zhejiang )" serve as a host city?
SELECT T2.year FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T1.city = "Taizhou ( Zhejiang )"
medium
6,279
city_record
[ "city" ]
Which three cities have the largest regional population?
SELECT city FROM city ORDER BY regional_population DESC LIMIT 3
medium
6,280
city_record
[ "city" ]
What are the three largest cities in terms of regional population?
SELECT city FROM city ORDER BY regional_population DESC LIMIT 3
medium
6,281
city_record
[ "city" ]
Which city has the lowest GDP? Please list the city name and its GDP.
SELECT city , GDP FROM city ORDER BY GDP LIMIT 1
medium
6,282
city_record
[ "city" ]
What is the city with the smallest GDP? Return the city and its GDP.
SELECT city , GDP FROM city ORDER BY GDP LIMIT 1
medium
6,283
city_record
[ "city", "temperature" ]
Which city has the highest temperature in February?
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
hard
6,284
city_record
[ "city", "temperature" ]
In February, which city marks the highest temperature?
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
hard
6,285
city_record
[ "city", "temperature" ]
Give me a list of cities whose temperature in March is lower than that in July or higher than that in Oct?
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
medium
6,286
city_record
[ "city", "temperature" ]
Which cities' temperature in March is lower than that in July or higher than that in Oct?
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
medium
6,287
city_record
[ "city", "temperature", "hosting_city" ]
Give me a list of cities whose temperature in Mar is lower than that in July and which have also served as host cities?
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
extra
6,288
city_record
[ "city", "temperature", "hosting_city" ]
Which cities have lower temperature in March than in July and have been once host cities?
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
extra
6,289
city_record
[ "city", "temperature", "hosting_city" ]
Give me a list of cities whose temperature in Mar is lower than that in Dec and which have never been host cities.
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
extra
6,290
city_record
[ "city", "temperature", "hosting_city" ]
Which cities have lower temperature in March than in Dec and have never served as host cities?
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
extra
6,291
city_record
[ "city", "temperature", "hosting_city" ]
Give me a list of cities whose temperature in Feb is higher than that in Jun or cities that were once host cities?
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
extra
6,292
city_record
[ "city", "temperature", "hosting_city" ]
Which cities have higher temperature in Feb than in Jun or have once served as host cities?
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
extra
6,293
city_record
[ "city" ]
Please give me a list of cities whose regional population is over 10000000.
SELECT city FROM city WHERE regional_population > 10000000
easy
6,294
city_record
[ "city" ]
Which cities have regional population above 10000000?
SELECT city FROM city WHERE regional_population > 10000000
easy
6,295
city_record
[ "city" ]
Please give me a list of cities whose regional population is over 8000000 or under 5000000.
SELECT city FROM city WHERE regional_population > 10000000 UNION SELECT city FROM city WHERE regional_population < 5000000
hard
6,296
city_record
[ "city" ]
Which cities have regional population above 8000000 or below 5000000?
SELECT city FROM city WHERE regional_population > 10000000 UNION SELECT city FROM city WHERE regional_population < 5000000
hard
6,297
city_record
[ "MATCH" ]
Find the number of matches in different competitions.
SELECT count(*) , Competition FROM MATCH GROUP BY Competition
medium
6,298
city_record
[ "MATCH" ]
For each competition, count the number of matches.
SELECT count(*) , Competition FROM MATCH GROUP BY Competition
medium
6,299
city_record
[ "MATCH" ]
List venues of all matches in the order of their dates starting from the most recent one.
SELECT venue FROM MATCH ORDER BY date DESC
easy