db_id
stringclasses
146 values
question
stringlengths
3
224
query
stringlengths
18
577
query_format
stringlengths
18
577
answer
stringlengths
13
874k
match_season
Show the name of colleges that have at least two players.
SELECT College FROM match_season GROUP BY College HAVING count(*) >= 2
SELECT College FROM match_season GROUP BY College HAVING count(*) >= 2
[{'College': 'Maryland'}, {'College': 'UCLA'}, {'College': 'Virginia'}]
match_season
What are the names of all colleges that have two or more players?
SELECT College FROM match_season GROUP BY College HAVING count(*) >= 2
SELECT College FROM match_season GROUP BY College HAVING count(*) >= 2
[{'College': 'Maryland'}, {'College': 'UCLA'}, {'College': 'Virginia'}]
match_season
Show the name of colleges that have at least two players in descending alphabetical order.
SELECT College FROM match_season GROUP BY College HAVING count(*) >= 2 ORDER BY College DESC
SELECT College FROM match_season GROUP BY College HAVING count(*) >= 2 ORDER BY College DESC
[{'College': 'Virginia'}, {'College': 'UCLA'}, {'College': 'Maryland'}]
match_season
What are the names of colleges that have two or more players, listed in descending alphabetical order?
SELECT College FROM match_season GROUP BY College HAVING count(*) >= 2 ORDER BY College DESC
SELECT College FROM match_season GROUP BY College HAVING count(*) >= 2 ORDER BY College DESC
[{'College': 'Virginia'}, {'College': 'UCLA'}, {'College': 'Maryland'}]
match_season
What are the names of teams that do no have match season record?
SELECT Name FROM team WHERE Team_id NOT IN (SELECT Team FROM match_season)
SELECT Name FROM team WHERE Team_id NOT IN (SELECT Team FROM match_season)
[{'Name': 'Brown Erdman'}, {'Name': 'Los Angeles Galaxy'}, {'Name': 'Berneice Hand'}]
match_season
Return the names of teams that have no match season record.
SELECT Name FROM team WHERE Team_id NOT IN (SELECT Team FROM match_season)
SELECT Name FROM team WHERE Team_id NOT IN (SELECT Team FROM match_season)
[{'Name': 'Brown Erdman'}, {'Name': 'Los Angeles Galaxy'}, {'Name': 'Berneice Hand'}]
match_season
What are the names of countries that have both players with position forward and players with position defender?
SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = "Forward" INTERSECT SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = "Defender"
SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = "Forward" INTERSECT SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = "Defender"
[{'Country_name': 'United States'}]
match_season
Return the names of countries that have players that play the Forward position, as well as players who play the Defender position.
SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = "Forward" INTERSECT SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = "Defender"
SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = "Forward" INTERSECT SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = "Defender"
[{'Country_name': 'United States'}]
match_season
Which college have both players with position midfielder and players with position defender?
SELECT College FROM match_season WHERE POSITION = "Midfielder" INTERSECT SELECT College FROM match_season WHERE POSITION = "Defender"
SELECT College FROM match_season WHERE POSITION = "Midfielder" INTERSECT SELECT College FROM match_season WHERE POSITION = "Defender"
[{'College': 'Maryland'}]
match_season
Return the colleges that have players who play the Midfielder position, as well as players who play the Defender position.
SELECT College FROM match_season WHERE POSITION = "Midfielder" INTERSECT SELECT College FROM match_season WHERE POSITION = "Defender"
SELECT College FROM match_season WHERE POSITION = "Midfielder" INTERSECT SELECT College FROM match_season WHERE POSITION = "Defender"
[{'College': 'Maryland'}]
climbing
How many climbers are there?
SELECT count(*) FROM climber
SELECT count(*) FROM climber
[{'count(*)': 10}]
climbing
Count the number of climbers.
SELECT count(*) FROM climber
SELECT count(*) FROM climber
[{'count(*)': 10}]
climbing
List the names of climbers in descending order of points.
SELECT Name FROM climber ORDER BY Points DESC
SELECT Name FROM climber ORDER BY Points DESC
[{'Name': 'Klaus Enders'}, {'Name': 'Siegfried Schauzu'}, {'Name': 'Hans Luthringhauser'}, {'Name': 'Jean Claude Castella'}, {'Name': 'Horst Owesle'}, {'Name': 'Georg Auerbacher'}, {'Name': 'Arseneus Butscher'}, {'Name': 'Charlie Freedman'}, {'Name': 'L Currie'}, {'Name': 'Mick Horsepole'}]
climbing
What are the names of the climbers, ordered by points descending?
SELECT Name FROM climber ORDER BY Points DESC
SELECT Name FROM climber ORDER BY Points DESC
[{'Name': 'Klaus Enders'}, {'Name': 'Siegfried Schauzu'}, {'Name': 'Hans Luthringhauser'}, {'Name': 'Jean Claude Castella'}, {'Name': 'Horst Owesle'}, {'Name': 'Georg Auerbacher'}, {'Name': 'Arseneus Butscher'}, {'Name': 'Charlie Freedman'}, {'Name': 'L Currie'}, {'Name': 'Mick Horsepole'}]
climbing
List the names of climbers whose country is not Switzerland.
SELECT Name FROM climber WHERE Country != "Switzerland"
SELECT Name FROM climber WHERE Country != "Switzerland"
[{'Name': 'Klaus Enders'}, {'Name': 'Siegfried Schauzu'}, {'Name': 'Hans Luthringhauser'}, {'Name': 'Horst Owesle'}, {'Name': 'Georg Auerbacher'}, {'Name': 'Arseneus Butscher'}, {'Name': 'Charlie Freedman'}, {'Name': 'L Currie'}, {'Name': 'Mick Horsepole'}]
climbing
What are the names of climbers who are not from the country of Switzerland?
SELECT Name FROM climber WHERE Country != "Switzerland"
SELECT Name FROM climber WHERE Country != "Switzerland"
[{'Name': 'Klaus Enders'}, {'Name': 'Siegfried Schauzu'}, {'Name': 'Hans Luthringhauser'}, {'Name': 'Horst Owesle'}, {'Name': 'Georg Auerbacher'}, {'Name': 'Arseneus Butscher'}, {'Name': 'Charlie Freedman'}, {'Name': 'L Currie'}, {'Name': 'Mick Horsepole'}]
climbing
What is the maximum point for climbers whose country is United Kingdom?
SELECT max(Points) FROM climber WHERE Country = "United Kingdom"
SELECT max(Points) FROM climber WHERE Country = "United Kingdom"
[{'max(Points)': 3.0}]
climbing
Return the maximum number of points for climbers from the United Kingdom.
SELECT max(Points) FROM climber WHERE Country = "United Kingdom"
SELECT max(Points) FROM climber WHERE Country = "United Kingdom"
[{'max(Points)': 3.0}]
climbing
How many distinct countries are the climbers from?
SELECT COUNT(DISTINCT Country) FROM climber
SELECT COUNT(DISTINCT Country) FROM climber
[{'COUNT(DISTINCT Country)': 3}]
climbing
Count the number of different countries that climbers are from.
SELECT COUNT(DISTINCT Country) FROM climber
SELECT COUNT(DISTINCT Country) FROM climber
[{'COUNT(DISTINCT Country)': 3}]
climbing
What are the names of mountains in ascending alphabetical order?
SELECT Name FROM mountain ORDER BY Name ASC
SELECT Name FROM mountain ORDER BY Name ASC
[{'Name': 'Duwoni / Mt Speke (Vittorio Emanuele Pk)'}, {'Name': 'Kibo (Uhuru Pk)'}, {'Name': 'Mawenzi (Hans Meyer Pk)'}, {'Name': 'Mount Kenya (Batian)'}, {'Name': 'Mount Kenya (Lenana)'}, {'Name': 'Ngaliema / Mt Stanley (Margherita Pk)'}, {'Name': 'Ngaliema / Mt Stanley (Savoia Pk)'}]
climbing
Give the names of mountains in alphabetical order.
SELECT Name FROM mountain ORDER BY Name ASC
SELECT Name FROM mountain ORDER BY Name ASC
[{'Name': 'Duwoni / Mt Speke (Vittorio Emanuele Pk)'}, {'Name': 'Kibo (Uhuru Pk)'}, {'Name': 'Mawenzi (Hans Meyer Pk)'}, {'Name': 'Mount Kenya (Batian)'}, {'Name': 'Mount Kenya (Lenana)'}, {'Name': 'Ngaliema / Mt Stanley (Margherita Pk)'}, {'Name': 'Ngaliema / Mt Stanley (Savoia Pk)'}]
climbing
What are the countries of mountains with height bigger than 5000?
SELECT Country FROM mountain WHERE Height > 5000
SELECT Country FROM mountain WHERE Height > 5000
[{'Country': 'Tanzania'}, {'Country': 'Kenya'}, {'Country': 'Tanzania'}, {'Country': 'DR Congo Uganda'}]
climbing
Return the countries of the mountains that have a height larger than 5000.
SELECT Country FROM mountain WHERE Height > 5000
SELECT Country FROM mountain WHERE Height > 5000
[{'Country': 'Tanzania'}, {'Country': 'Kenya'}, {'Country': 'Tanzania'}, {'Country': 'DR Congo Uganda'}]
climbing
What is the name of the highest mountain?
SELECT Name FROM mountain ORDER BY Height DESC LIMIT 1
SELECT Name FROM mountain ORDER BY Height DESC LIMIT 1
[{'Name': 'Kibo (Uhuru Pk)'}]
climbing
Return the name of the mountain with the greatest height.
SELECT Name FROM mountain ORDER BY Height DESC LIMIT 1
SELECT Name FROM mountain ORDER BY Height DESC LIMIT 1
[{'Name': 'Kibo (Uhuru Pk)'}]
climbing
List the distinct ranges of the mountains with the top 3 prominence.
SELECT DISTINCT Range FROM mountain ORDER BY Prominence DESC LIMIT 3
SELECT DISTINCT Range FROM mountain ORDER BY Prominence DESC LIMIT 3
[{'Range': 'Kilimanjaro'}, {'Range': 'Rwenzori'}, {'Range': 'Mount Kenya'}]
climbing
What are the different ranges of the 3 mountains with the highest prominence?
SELECT DISTINCT Range FROM mountain ORDER BY Prominence DESC LIMIT 3
SELECT DISTINCT Range FROM mountain ORDER BY Prominence DESC LIMIT 3
[{'Range': 'Kilimanjaro'}, {'Range': 'Rwenzori'}, {'Range': 'Mount Kenya'}]
climbing
Show names of climbers and the names of mountains they climb.
SELECT T1.Name , T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID
SELECT T1.Name , T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID
[{'Name': 'Kibo (Uhuru Pk)'}, {'Name': 'Kibo (Uhuru Pk)'}, {'Name': 'Mount Kenya (Batian)'}, {'Name': 'Mount Kenya (Batian)'}, {'Name': 'Mount Kenya (Batian)'}, {'Name': 'Mawenzi (Hans Meyer Pk)'}, {'Name': 'Mount Kenya (Lenana)'}, {'Name': 'Mount Kenya (Lenana)'}, {'Name': 'Duwoni / Mt Speke (Vittorio Emanuele Pk)'}, {'Name': 'Duwoni / Mt Speke (Vittorio Emanuele Pk)'}]
climbing
What are the names of climbers and the corresponding names of mountains that they climb?
SELECT T1.Name , T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID
SELECT T1.Name , T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID
[{'Name': 'Kibo (Uhuru Pk)'}, {'Name': 'Kibo (Uhuru Pk)'}, {'Name': 'Mount Kenya (Batian)'}, {'Name': 'Mount Kenya (Batian)'}, {'Name': 'Mount Kenya (Batian)'}, {'Name': 'Mawenzi (Hans Meyer Pk)'}, {'Name': 'Mount Kenya (Lenana)'}, {'Name': 'Mount Kenya (Lenana)'}, {'Name': 'Duwoni / Mt Speke (Vittorio Emanuele Pk)'}, {'Name': 'Duwoni / Mt Speke (Vittorio Emanuele Pk)'}]
climbing
Show the names of climbers and the heights of mountains they climb.
SELECT T1.Name , T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID
SELECT T1.Name , T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID
[{'Name': 'Klaus Enders', 'Height': 5895.0}, {'Name': 'Siegfried Schauzu', 'Height': 5895.0}, {'Name': 'Hans Luthringhauser', 'Height': 5199.0}, {'Name': 'Jean Claude Castella', 'Height': 5199.0}, {'Name': 'Horst Owesle', 'Height': 5199.0}, {'Name': 'Georg Auerbacher', 'Height': 5148.0}, {'Name': 'Arseneus Butscher', 'Height': 4985.0}, {'Name': 'Charlie Freedman', 'Height': 4985.0}, {'Name': 'L Currie', 'Height': 4890.0}, {'Name': 'Mick Horsepole', 'Height': 4890.0}]
climbing
What are the names of climbers and the corresponding heights of the mountains that they climb?
SELECT T1.Name , T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID
SELECT T1.Name , T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID
[{'Name': 'Klaus Enders', 'Height': 5895.0}, {'Name': 'Siegfried Schauzu', 'Height': 5895.0}, {'Name': 'Hans Luthringhauser', 'Height': 5199.0}, {'Name': 'Jean Claude Castella', 'Height': 5199.0}, {'Name': 'Horst Owesle', 'Height': 5199.0}, {'Name': 'Georg Auerbacher', 'Height': 5148.0}, {'Name': 'Arseneus Butscher', 'Height': 4985.0}, {'Name': 'Charlie Freedman', 'Height': 4985.0}, {'Name': 'L Currie', 'Height': 4890.0}, {'Name': 'Mick Horsepole', 'Height': 4890.0}]
climbing
Show the height of the mountain climbed by the climber with the maximum points.
SELECT T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID ORDER BY T1.Points DESC LIMIT 1
SELECT T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID ORDER BY T1.Points DESC LIMIT 1
[{'Height': 5895.0}]
climbing
What is the height of the mountain climbined by the climbing who had the most points?
SELECT T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID ORDER BY T1.Points DESC LIMIT 1
SELECT T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID ORDER BY T1.Points DESC LIMIT 1
[{'Height': 5895.0}]
climbing
Show the distinct names of mountains climbed by climbers from country "West Germany".
SELECT DISTINCT T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T1.Country = "West Germany"
SELECT DISTINCT T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T1.Country = "West Germany"
[{'Name': 'Kibo (Uhuru Pk)'}, {'Name': 'Mount Kenya (Batian)'}, {'Name': 'Mawenzi (Hans Meyer Pk)'}, {'Name': 'Mount Kenya (Lenana)'}]
climbing
What are the different names of mountains ascended by climbers from the country of West Germany?
SELECT DISTINCT T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T1.Country = "West Germany"
SELECT DISTINCT T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T1.Country = "West Germany"
[{'Name': 'Kibo (Uhuru Pk)'}, {'Name': 'Mount Kenya (Batian)'}, {'Name': 'Mawenzi (Hans Meyer Pk)'}, {'Name': 'Mount Kenya (Lenana)'}]
climbing
Show the times used by climbers to climb mountains in Country Uganda.
SELECT T1.Time FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T2.Country = "Uganda"
SELECT T1.Time FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T2.Country = "Uganda"
[{'Time': '1:25.40.6'}, {'Time': '1:27.28.8'}]
climbing
What are the times used by climbers who climbed mountains in the country of Uganda?
SELECT T1.Time FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T2.Country = "Uganda"
SELECT T1.Time FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T2.Country = "Uganda"
[{'Time': '1:25.40.6'}, {'Time': '1:27.28.8'}]
climbing
Please show the countries and the number of climbers from each country.
SELECT Country , COUNT(*) FROM climber GROUP BY Country
SELECT Country , COUNT(*) FROM climber GROUP BY Country
[{'Country': 'Switzerland', 'COUNT(*)': 1}, {'Country': 'United Kingdom', 'COUNT(*)': 3}, {'Country': 'West Germany', 'COUNT(*)': 6}]
climbing
How many climbers are from each country?
SELECT Country , COUNT(*) FROM climber GROUP BY Country
SELECT Country , COUNT(*) FROM climber GROUP BY Country
[{'Country': 'Switzerland', 'COUNT(*)': 1}, {'Country': 'United Kingdom', 'COUNT(*)': 3}, {'Country': 'West Germany', 'COUNT(*)': 6}]
climbing
List the countries that have more than one mountain.
SELECT Country FROM mountain GROUP BY Country HAVING COUNT(*) > 1
SELECT Country FROM mountain GROUP BY Country HAVING COUNT(*) > 1
[{'Country': 'Kenya'}, {'Country': 'Tanzania'}, {'Country': 'Uganda'}]
climbing
Which countries have more than one mountain?
SELECT Country FROM mountain GROUP BY Country HAVING COUNT(*) > 1
SELECT Country FROM mountain GROUP BY Country HAVING COUNT(*) > 1
[{'Country': 'Kenya'}, {'Country': 'Tanzania'}, {'Country': 'Uganda'}]
climbing
List the names of mountains that do not have any climber.
SELECT Name FROM mountain WHERE Mountain_ID NOT IN (SELECT Mountain_ID FROM climber)
SELECT Name FROM mountain WHERE Mountain_ID NOT IN (SELECT Mountain_ID FROM climber)
[{'Name': 'Ngaliema / Mt Stanley (Margherita Pk)'}, {'Name': 'Ngaliema / Mt Stanley (Savoia Pk)'}]
climbing
What are the names of countains that no climber has climbed?
SELECT Name FROM mountain WHERE Mountain_ID NOT IN (SELECT Mountain_ID FROM climber)
SELECT Name FROM mountain WHERE Mountain_ID NOT IN (SELECT Mountain_ID FROM climber)
[{'Name': 'Ngaliema / Mt Stanley (Margherita Pk)'}, {'Name': 'Ngaliema / Mt Stanley (Savoia Pk)'}]
climbing
Show the countries that have mountains with height more than 5600 stories and mountains with height less than 5200.
SELECT Country FROM mountain WHERE Height > 5600 INTERSECT SELECT Country FROM mountain WHERE Height < 5200
SELECT Country FROM mountain WHERE Height > 5600 INTERSECT SELECT Country FROM mountain WHERE Height < 5200
[{'Country': 'Tanzania'}]
climbing
What are the countries that have both mountains that are higher than 5600 and lower than 5200?
SELECT Country FROM mountain WHERE Height > 5600 INTERSECT SELECT Country FROM mountain WHERE Height < 5200
SELECT Country FROM mountain WHERE Height > 5600 INTERSECT SELECT Country FROM mountain WHERE Height < 5200
[{'Country': 'Tanzania'}]
climbing
Show the range that has the most number of mountains.
SELECT Range FROM mountain GROUP BY Range ORDER BY COUNT(*) DESC LIMIT 1
SELECT Range FROM mountain GROUP BY Range ORDER BY COUNT(*) DESC LIMIT 1
[{'Range': 'Rwenzori'}]
climbing
Which range contains the most mountains?
SELECT Range FROM mountain GROUP BY Range ORDER BY COUNT(*) DESC LIMIT 1
SELECT Range FROM mountain GROUP BY Range ORDER BY COUNT(*) DESC LIMIT 1
[{'Range': 'Rwenzori'}]
climbing
Show the names of mountains with height more than 5000 or prominence more than 1000.
SELECT Name FROM mountain WHERE Height > 5000 OR Prominence > 1000
SELECT Name FROM mountain WHERE Height > 5000 OR Prominence > 1000
[{'Name': 'Kibo (Uhuru Pk)'}, {'Name': 'Mount Kenya (Batian)'}, {'Name': 'Mawenzi (Hans Meyer Pk)'}, {'Name': 'Ngaliema / Mt Stanley (Margherita Pk)'}]
climbing
What are the names of mountains that have a height of over 5000 or a prominence of over 1000?
SELECT Name FROM mountain WHERE Height > 5000 OR Prominence > 1000
SELECT Name FROM mountain WHERE Height > 5000 OR Prominence > 1000
[{'Name': 'Kibo (Uhuru Pk)'}, {'Name': 'Mount Kenya (Batian)'}, {'Name': 'Mawenzi (Hans Meyer Pk)'}, {'Name': 'Ngaliema / Mt Stanley (Margherita Pk)'}]
body_builder
How many body builders are there?
SELECT count(*) FROM body_builder
SELECT count(*) FROM body_builder
[{'count(*)': 5}]
body_builder
List the total scores of body builders in ascending order.
SELECT Total FROM body_builder ORDER BY Total ASC
SELECT Total FROM body_builder ORDER BY Total ASC
[{'Total': 292.5}, {'Total': 312.5}, {'Total': 315.0}, {'Total': 315.0}, {'Total': 317.5}]
body_builder
List the snatch score and clean jerk score of body builders in ascending order of snatch score.
SELECT Snatch , Clean_Jerk FROM body_builder ORDER BY Snatch ASC
SELECT Snatch , Clean_Jerk FROM body_builder ORDER BY Snatch ASC
[{'Snatch': 130.0, 'Clean_Jerk': 162.5}, {'Snatch': 137.5, 'Clean_Jerk': 177.5}, {'Snatch': 137.5, 'Clean_Jerk': 175.0}, {'Snatch': 140.0, 'Clean_Jerk': 175.0}, {'Snatch': 142.5, 'Clean_Jerk': 175.0}]
body_builder
What is the average snatch score of body builders?
SELECT avg(Snatch) FROM body_builder
SELECT avg(Snatch) FROM body_builder
[{'avg(Snatch)': 137.5}]
body_builder
What are the clean and jerk score of the body builder with the highest total score?
SELECT Clean_Jerk FROM body_builder ORDER BY Total DESC LIMIT 1
SELECT Clean_Jerk FROM body_builder ORDER BY Total DESC LIMIT 1
[{'Clean_Jerk': 175.0}]
body_builder
What are the birthdays of people in ascending order of height?
SELECT Birth_Date FROM People ORDER BY Height ASC
SELECT Birth_Date FROM People ORDER BY Height ASC
[{'Birth_Date': 'January 1, 1992'}, {'Birth_Date': 'March 30, 1976'}, {'Birth_Date': 'February 13, 1985'}, {'Birth_Date': 'December 5, 1991'}, {'Birth_Date': 'July 4, 1990'}, {'Birth_Date': 'May 5, 1987'}]
body_builder
What are the names of body builders?
SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID
SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID
[{'Name': 'Jack Campbell'}, {'Name': 'Ty Conklin'}, {'Name': 'Al Montoya'}, {'Name': 'Cam Fowler'}, {'Name': 'Jake Gardiner'}]
body_builder
What are the names of body builders whose total score is higher than 300?
SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Total > 300
SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Total > 300
[{'Name': 'Jack Campbell'}, {'Name': 'Ty Conklin'}, {'Name': 'Al Montoya'}, {'Name': 'Cam Fowler'}]
body_builder
What is the name of the body builder with the greatest body weight?
SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Weight DESC LIMIT 1
SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Weight DESC LIMIT 1
[{'Name': 'Al Montoya'}]
body_builder
What are the birth date and birth place of the body builder with the highest total points?
SELECT T2.Birth_Date , T2.Birth_Place FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Total DESC LIMIT 1
SELECT T2.Birth_Date , T2.Birth_Place FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Total DESC LIMIT 1
[{'Birth_Date': 'January 1, 1992', 'Birth_Place': 'Port Huron, Michigan'}]
body_builder
What are the heights of body builders with total score smaller than 315?
SELECT T2.Height FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Total < 315
SELECT T2.Height FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Total < 315
[{'Height': 196.0}, {'Height': 205.0}]
body_builder
What is the average total score of body builders with height bigger than 200?
SELECT avg(T1.Total) FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Height > 200
SELECT avg(T1.Total) FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Height > 200
[{'avg(T1.Total)': 292.5}]
body_builder
What are the names of body builders in descending order of total scores?
SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Total DESC
SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Total DESC
[{'Name': 'Jack Campbell'}, {'Name': 'Ty Conklin'}, {'Name': 'Al Montoya'}, {'Name': 'Cam Fowler'}, {'Name': 'Jake Gardiner'}]
body_builder
List each birth place along with the number of people from there.
SELECT Birth_Place , COUNT(*) FROM people GROUP BY Birth_Place
SELECT Birth_Place , COUNT(*) FROM people GROUP BY Birth_Place
[{'Birth_Place': 'Anchorage, Alaska', 'COUNT(*)': 1}, {'Birth_Place': 'Farmington Hills, Michigan', 'COUNT(*)': 1}, {'Birth_Place': 'Glenview, Illinois', 'COUNT(*)': 1}, {'Birth_Place': 'Minnetonka, Minnesota', 'COUNT(*)': 1}, {'Birth_Place': 'Nashua, New Hampshire', 'COUNT(*)': 1}, {'Birth_Place': 'Port Huron, Michigan', 'COUNT(*)': 1}]
body_builder
What is the most common birth place of people?
SELECT Birth_Place FROM people GROUP BY Birth_Place ORDER BY COUNT(*) DESC LIMIT 1
SELECT Birth_Place FROM people GROUP BY Birth_Place ORDER BY COUNT(*) DESC LIMIT 1
[{'Birth_Place': 'Port Huron, Michigan'}]
body_builder
What are the birth places that are shared by at least two people?
SELECT Birth_Place FROM people GROUP BY Birth_Place HAVING COUNT(*) >= 2
SELECT Birth_Place FROM people GROUP BY Birth_Place HAVING COUNT(*) >= 2
[{'Nenhum': 'Nenhum resultado encontrado'}]
body_builder
List the height and weight of people in descending order of height.
SELECT Height , Weight FROM people ORDER BY Height DESC
SELECT Height , Weight FROM people ORDER BY Height DESC
[{'Height': 215.0, 'Weight': 102.0}, {'Height': 205.0, 'Weight': 92.0}, {'Height': 196.0, 'Weight': 89.0}, {'Height': 195.0, 'Weight': 100.0}, {'Height': 192.0, 'Weight': 90.0}, {'Height': 182.0, 'Weight': 80.0}]
body_builder
Show all information about each body builder.
SELECT * FROM body_builder
SELECT * FROM body_builder
[{'Body_Builder_ID': 1, 'People_ID': 1, 'Snatch': 142.5, 'Clean_Jerk': 175.0, 'Total': 317.5}, {'Body_Builder_ID': 2, 'People_ID': 2, 'Snatch': 137.5, 'Clean_Jerk': 177.5, 'Total': 315.0}, {'Body_Builder_ID': 3, 'People_ID': 3, 'Snatch': 140.0, 'Clean_Jerk': 175.0, 'Total': 315.0}, {'Body_Builder_ID': 4, 'People_ID': 5, 'Snatch': 137.5, 'Clean_Jerk': 175.0, 'Total': 312.5}, {'Body_Builder_ID': 5, 'People_ID': 6, 'Snatch': 130.0, 'Clean_Jerk': 162.5, 'Total': 292.5}]
body_builder
List the names and origins of people who are not body builders.
SELECT Name , birth_place FROM people EXCEPT SELECT T1.Name , T1.birth_place FROM people AS T1 JOIN body_builder AS T2 ON T1.people_id = T2.people_id
SELECT Name , birth_place FROM people EXCEPT SELECT T1.Name , T1.birth_place FROM people AS T1 JOIN body_builder AS T2 ON T1.people_id = T2.people_id
[{'Name': 'Mark Fayne', 'Birth_Place': 'Nashua, New Hampshire'}]
body_builder
How many distinct birth places are there?
SELECT count(DISTINCT Birth_Place) FROM people
SELECT count(DISTINCT Birth_Place) FROM people
[{'count(DISTINCT Birth_Place)': 6}]
body_builder
How many persons are not body builders?
SELECT count(*) FROM people WHERE people_id NOT IN (SELECT People_ID FROM body_builder)
SELECT count(*) FROM people WHERE people_id NOT IN (SELECT People_ID FROM body_builder)
[{'count(*)': 1}]
body_builder
List the weight of the body builders who have snatch score higher than 140 or have the height greater than 200.
SELECT T2.weight FROM body_builder AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id WHERE T1.snatch > 140 OR T2.height > 200;
SELECT T2.weight FROM body_builder AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id WHERE T1.snatch > 140 OR T2.height > 200;
[{'Weight': 80.0}, {'Weight': 92.0}]
body_builder
What are the total scores of the body builders whose birthday contains the string "January" ?
SELECT T1.total FROM body_builder AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id WHERE T2.Birth_Date LIKE "%January%";
SELECT T1.total FROM body_builder AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id WHERE T2.Birth_Date LIKE "%January%";
[{'Total': 317.5}]
body_builder
What is the minimum snatch score?
SELECT min(snatch) FROM body_builder
SELECT min(snatch) FROM body_builder
[{'min(snatch)': 130.0}]
election_representative
How many elections are there?
SELECT count(*) FROM election
SELECT count(*) FROM election
[{'count(*)': 5}]
election_representative
List the votes of elections in descending order.
SELECT Votes FROM election ORDER BY Votes DESC
SELECT Votes FROM election ORDER BY Votes DESC
[{'Votes': 14077.0}, {'Votes': 13049.0}, {'Votes': 12422.0}, {'Votes': 11059.0}, {'Votes': 9423.0}]
election_representative
List the dates and vote percents of elections.
SELECT Date , Vote_Percent FROM election
SELECT Date , Vote_Percent FROM election
[{'Date': 'July 1942', 'Vote_Percent': 16.2}, {'Date': 'October 1942', 'Vote_Percent': 18.5}, {'Date': '1946', 'Vote_Percent': 19.5}, {'Date': '1949', 'Vote_Percent': 19.5}, {'Date': '1953', 'Vote_Percent': 16.0}]
election_representative
What are the minimum and maximum vote percents of elections?
SELECT min(Vote_Percent) , max(Vote_Percent) FROM election
SELECT min(Vote_Percent) , max(Vote_Percent) FROM election
[{'min(Vote_Percent)': 16.0, 'max(Vote_Percent)': 19.5}]
election_representative
What are the names and parties of representatives?
SELECT Name , Party FROM representative
SELECT Name , Party FROM representative
[{'Name': 'Dan Quayle', 'Party': 'Republican'}, {'Name': 'John Quayle', 'Party': 'Democratic'}, {'Name': 'Al Quie', 'Party': 'Republican'}, {'Name': 'James M. Quigley', 'Party': 'Democratic'}, {'Name': 'Jimmy Quillen', 'Party': 'Republican'}, {'Name': 'Jack Quinn', 'Party': 'Republican'}, {'Name': 'James L. Quinn', 'Party': 'Democratic'}]
election_representative
What are the names of representatives whose party is not "Republican"?
SELECT Name FROM Representative WHERE Party != "Republican"
SELECT Name FROM Representative WHERE Party != "Republican"
[{'Name': 'John Quayle'}, {'Name': 'James M. Quigley'}, {'Name': 'James L. Quinn'}]
election_representative
What are the life spans of representatives from New York state or Indiana state?
SELECT Lifespan FROM representative WHERE State = "New York" OR State = "Indiana"
SELECT Lifespan FROM representative WHERE State = "New York" OR State = "Indiana"
[{'Lifespan': '1947–'}, {'Lifespan': '1868–1930'}, {'Lifespan': '1951–'}]
election_representative
What are the names of representatives and the dates of elections they participated in.
SELECT T2.Name , T1.Date FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID
SELECT T2.Name , T1.Date FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID
[{'Name': 'Dan Quayle', 'Date': 'July 1942'}, {'Name': 'John Quayle', 'Date': 'October 1942'}, {'Name': 'James M. Quigley', 'Date': '1946'}, {'Name': 'Jimmy Quillen', 'Date': '1949'}, {'Name': 'James L. Quinn', 'Date': '1953'}]
election_representative
What are the names of representatives with more than 10000 votes in election?
SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID WHERE Votes > 10000
SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID WHERE Votes > 10000
[{'Name': 'John Quayle'}, {'Name': 'James M. Quigley'}, {'Name': 'Jimmy Quillen'}, {'Name': 'James L. Quinn'}]
election_representative
What are the names of representatives in descending order of votes?
SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY votes DESC
SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY votes DESC
[{'Name': 'Jimmy Quillen'}, {'Name': 'James M. Quigley'}, {'Name': 'James L. Quinn'}, {'Name': 'John Quayle'}, {'Name': 'Dan Quayle'}]
election_representative
What is the party of the representative that has the smallest number of votes.
SELECT T2.Party FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY votes ASC LIMIT 1
SELECT T2.Party FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY votes ASC LIMIT 1
[{'Party': 'Republican'}]
election_representative
What are the lifespans of representatives in descending order of vote percent?
SELECT T2.Lifespan FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY Vote_Percent DESC
SELECT T2.Lifespan FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY Vote_Percent DESC
[{'Lifespan': '1918–'}, {'Lifespan': '1916–2003'}, {'Lifespan': '1868–1930'}, {'Lifespan': '1947–'}, {'Lifespan': '1875–1960'}]
election_representative
What is the average number of votes of representatives from party "Republican"?
SELECT avg(T1.Votes) FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID WHERE T2.Party = "Republican"
SELECT avg(T1.Votes) FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID WHERE T2.Party = "Republican"
[{'avg(T1.Votes)': 11750.0}]
election_representative
What are the different parties of representative? Show the party name and the number of representatives in each party.
SELECT Party , COUNT(*) FROM representative GROUP BY Party
SELECT Party , COUNT(*) FROM representative GROUP BY Party
[{'Party': 'Democratic', 'COUNT(*)': 3}, {'Party': 'Republican', 'COUNT(*)': 4}]
election_representative
What is the party that has the largest number of representatives?
SELECT Party , COUNT(*) FROM representative GROUP BY Party ORDER BY COUNT(*) DESC LIMIT 1
SELECT Party , COUNT(*) FROM representative GROUP BY Party ORDER BY COUNT(*) DESC LIMIT 1
[{'Party': 'Republican', 'COUNT(*)': 4}]
election_representative
What parties have at least three representatives?
SELECT Party FROM representative GROUP BY Party HAVING COUNT(*) >= 3
SELECT Party FROM representative GROUP BY Party HAVING COUNT(*) >= 3
[{'Party': 'Democratic'}, {'Party': 'Republican'}]
election_representative
What states have at least two representatives?
SELECT State FROM representative GROUP BY State HAVING COUNT(*) >= 2
SELECT State FROM representative GROUP BY State HAVING COUNT(*) >= 2
[{'State': 'New York'}, {'State': 'Pennsylvania'}]
election_representative
List the names of representatives that have not participated in elections listed here.
SELECT Name FROM representative WHERE Representative_ID NOT IN (SELECT Representative_ID FROM election)
SELECT Name FROM representative WHERE Representative_ID NOT IN (SELECT Representative_ID FROM election)
[{'Name': 'Al Quie'}, {'Name': 'Jack Quinn'}]
election_representative
Show the parties that have both representatives in New York state and representatives in Pennsylvania state.
SELECT Party FROM representative WHERE State = "New York" INTERSECT SELECT Party FROM representative WHERE State = "Pennsylvania"
SELECT Party FROM representative WHERE State = "New York" INTERSECT SELECT Party FROM representative WHERE State = "Pennsylvania"
[{'Party': 'Democratic'}]
election_representative
How many distinct parties are there for representatives?
SELECT count(DISTINCT Party) FROM representative
SELECT count(DISTINCT Party) FROM representative
[{'count(DISTINCT Party)': 2}]
apartment_rentals
How many apartment bookings are there in total?
SELECT count(*) FROM Apartment_Bookings
SELECT count(*) FROM Apartment_Bookings
[{'count(*)': 15}]
apartment_rentals
Count the total number of apartment bookings.
SELECT count(*) FROM Apartment_Bookings
SELECT count(*) FROM Apartment_Bookings
[{'count(*)': 15}]
apartment_rentals
Show the start dates and end dates of all the apartment bookings.
SELECT booking_start_date , booking_end_date FROM Apartment_Bookings
SELECT booking_start_date , booking_end_date FROM Apartment_Bookings
[{'booking_start_date': '2016-09-26 17:13:49', 'booking_end_date': '2017-10-07 11:38:48'}, {'booking_start_date': '2016-04-01 06:28:08', 'booking_end_date': '2017-10-25 11:08:42'}, {'booking_start_date': '2017-03-13 16:20:14', 'booking_end_date': '2018-02-19 16:59:08'}, {'booking_start_date': '2016-08-04 10:33:00', 'booking_end_date': '2017-09-29 12:43:50'}, {'booking_start_date': '2017-02-11 14:34:14', 'booking_end_date': '2017-10-07 20:47:19'}, {'booking_start_date': '2016-05-24 20:09:38', 'booking_end_date': '2017-10-03 01:56:21'}, {'booking_start_date': '2016-07-25 02:57:04', 'booking_end_date': '2017-09-28 11:08:15'}, {'booking_start_date': '2016-11-26 05:04:31', 'booking_end_date': '2018-02-25 15:15:37'}, {'booking_start_date': '2017-05-13 18:17:20', 'booking_end_date': '2017-10-06 11:15:58'}, {'booking_start_date': '2017-03-04 02:23:49', 'booking_end_date': '2018-02-06 16:57:05'}, {'booking_start_date': '2016-06-07 05:05:18', 'booking_end_date': '2017-11-13 13:59:45'}, {'booking_start_date': '2016-04-17 12:53:59', 'booking_end_date': '2018-03-20 17:32:58'}, {'booking_start_date': '2016-09-28 05:00:50', 'booking_end_date': '2017-09-30 18:41:04'}, {'booking_start_date': '2017-04-07 04:53:27', 'booking_end_date': '2017-11-29 12:59:42'}, {'booking_start_date': '2017-07-03 14:15:56', 'booking_end_date': '2017-11-12 01:05:09'}]
apartment_rentals
What are the start date and end date of each apartment booking?
SELECT booking_start_date , booking_end_date FROM Apartment_Bookings
SELECT booking_start_date , booking_end_date FROM Apartment_Bookings
[{'booking_start_date': '2016-09-26 17:13:49', 'booking_end_date': '2017-10-07 11:38:48'}, {'booking_start_date': '2016-04-01 06:28:08', 'booking_end_date': '2017-10-25 11:08:42'}, {'booking_start_date': '2017-03-13 16:20:14', 'booking_end_date': '2018-02-19 16:59:08'}, {'booking_start_date': '2016-08-04 10:33:00', 'booking_end_date': '2017-09-29 12:43:50'}, {'booking_start_date': '2017-02-11 14:34:14', 'booking_end_date': '2017-10-07 20:47:19'}, {'booking_start_date': '2016-05-24 20:09:38', 'booking_end_date': '2017-10-03 01:56:21'}, {'booking_start_date': '2016-07-25 02:57:04', 'booking_end_date': '2017-09-28 11:08:15'}, {'booking_start_date': '2016-11-26 05:04:31', 'booking_end_date': '2018-02-25 15:15:37'}, {'booking_start_date': '2017-05-13 18:17:20', 'booking_end_date': '2017-10-06 11:15:58'}, {'booking_start_date': '2017-03-04 02:23:49', 'booking_end_date': '2018-02-06 16:57:05'}, {'booking_start_date': '2016-06-07 05:05:18', 'booking_end_date': '2017-11-13 13:59:45'}, {'booking_start_date': '2016-04-17 12:53:59', 'booking_end_date': '2018-03-20 17:32:58'}, {'booking_start_date': '2016-09-28 05:00:50', 'booking_end_date': '2017-09-30 18:41:04'}, {'booking_start_date': '2017-04-07 04:53:27', 'booking_end_date': '2017-11-29 12:59:42'}, {'booking_start_date': '2017-07-03 14:15:56', 'booking_end_date': '2017-11-12 01:05:09'}]
apartment_rentals
Show all distinct building descriptions.
SELECT DISTINCT building_description FROM Apartment_Buildings
SELECT DISTINCT building_description FROM Apartment_Buildings
[{'building_description': 'Studio'}, {'building_description': 'Flat'}, {'building_description': 'Duplex'}]
apartment_rentals
Give me a list of all the distinct building descriptions.
SELECT DISTINCT building_description FROM Apartment_Buildings
SELECT DISTINCT building_description FROM Apartment_Buildings
[{'building_description': 'Studio'}, {'building_description': 'Flat'}, {'building_description': 'Duplex'}]