db_name
stringclasses 146
values | prompt
stringlengths 310
4.81k
|
---|---|
match_season
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# country ( Country_id, Country_name, Capital, Official_native_language )
# team ( Team_id, Name )
# match_season ( Season, Player, Position, Country, Team, Draft_Pick_Number, Draft_Class, College )
# player ( Player_ID, Player, Years_Played, Total_WL, Singles_WL, Doubles_WL, Team )
#
# match_season.Team can be joined with team.Team_id
# match_season.Country can be joined with country.Country_id
# player.Team can be joined with team.Team_id
#
### Question:
#
# Show the name of colleges that have at least two players.
#
### SQL:
#
# SELECT College FROM match_season GROUP BY College HAVING count(*) >= 2
#
### End.
|
match_season
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# country ( Country_id, Country_name, Capital, Official_native_language )
# team ( Team_id, Name )
# match_season ( Season, Player, Position, Country, Team, Draft_Pick_Number, Draft_Class, College )
# player ( Player_ID, Player, Years_Played, Total_WL, Singles_WL, Doubles_WL, Team )
#
# match_season.Team can be joined with team.Team_id
# match_season.Country can be joined with country.Country_id
# player.Team can be joined with team.Team_id
#
### Question:
#
# What are the names of all colleges that have two or more players?
#
### SQL:
#
# SELECT College FROM match_season GROUP BY College HAVING count(*) >= 2
#
### End.
|
match_season
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# country ( Country_id, Country_name, Capital, Official_native_language )
# team ( Team_id, Name )
# match_season ( Season, Player, Position, Country, Team, Draft_Pick_Number, Draft_Class, College )
# player ( Player_ID, Player, Years_Played, Total_WL, Singles_WL, Doubles_WL, Team )
#
# match_season.Team can be joined with team.Team_id
# match_season.Country can be joined with country.Country_id
# player.Team can be joined with team.Team_id
#
### Question:
#
# Show the name of colleges that have at least two players in descending alphabetical order.
#
### SQL:
#
# SELECT College FROM match_season GROUP BY College HAVING count(*) >= 2 ORDER BY College DESC
#
### End.
|
match_season
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# country ( Country_id, Country_name, Capital, Official_native_language )
# team ( Team_id, Name )
# match_season ( Season, Player, Position, Country, Team, Draft_Pick_Number, Draft_Class, College )
# player ( Player_ID, Player, Years_Played, Total_WL, Singles_WL, Doubles_WL, Team )
#
# match_season.Team can be joined with team.Team_id
# match_season.Country can be joined with country.Country_id
# player.Team can be joined with team.Team_id
#
### Question:
#
# What are the names of colleges that have two or more players, listed in descending alphabetical order?
#
### SQL:
#
# SELECT College FROM match_season GROUP BY College HAVING count(*) >= 2 ORDER BY College DESC
#
### End.
|
match_season
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# country ( Country_id, Country_name, Capital, Official_native_language )
# team ( Team_id, Name )
# match_season ( Season, Player, Position, Country, Team, Draft_Pick_Number, Draft_Class, College )
# player ( Player_ID, Player, Years_Played, Total_WL, Singles_WL, Doubles_WL, Team )
#
# match_season.Team can be joined with team.Team_id
# match_season.Country can be joined with country.Country_id
# player.Team can be joined with team.Team_id
#
### Question:
#
# What are the names of teams that do no have match season record?
#
### SQL:
#
# SELECT Name FROM team WHERE Team_id NOT IN (SELECT Team FROM match_season)
#
### End.
|
match_season
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# country ( Country_id, Country_name, Capital, Official_native_language )
# team ( Team_id, Name )
# match_season ( Season, Player, Position, Country, Team, Draft_Pick_Number, Draft_Class, College )
# player ( Player_ID, Player, Years_Played, Total_WL, Singles_WL, Doubles_WL, Team )
#
# match_season.Team can be joined with team.Team_id
# match_season.Country can be joined with country.Country_id
# player.Team can be joined with team.Team_id
#
### Question:
#
# Return the names of teams that have no match season record.
#
### SQL:
#
# SELECT Name FROM team WHERE Team_id NOT IN (SELECT Team FROM match_season)
#
### End.
|
match_season
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# country ( Country_id, Country_name, Capital, Official_native_language )
# team ( Team_id, Name )
# match_season ( Season, Player, Position, Country, Team, Draft_Pick_Number, Draft_Class, College )
# player ( Player_ID, Player, Years_Played, Total_WL, Singles_WL, Doubles_WL, Team )
#
# match_season.Team can be joined with team.Team_id
# match_season.Country can be joined with country.Country_id
# player.Team can be joined with team.Team_id
#
### Question:
#
# What are the names of countries that have both players with position forward and players with position defender?
#
### SQL:
#
# 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"
#
### End.
|
match_season
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# country ( Country_id, Country_name, Capital, Official_native_language )
# team ( Team_id, Name )
# match_season ( Season, Player, Position, Country, Team, Draft_Pick_Number, Draft_Class, College )
# player ( Player_ID, Player, Years_Played, Total_WL, Singles_WL, Doubles_WL, Team )
#
# match_season.Team can be joined with team.Team_id
# match_season.Country can be joined with country.Country_id
# player.Team can be joined with team.Team_id
#
### Question:
#
# Return the names of countries that have players that play the Forward position, as well as players who play the Defender position.
#
### SQL:
#
# 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"
#
### End.
|
match_season
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# country ( Country_id, Country_name, Capital, Official_native_language )
# team ( Team_id, Name )
# match_season ( Season, Player, Position, Country, Team, Draft_Pick_Number, Draft_Class, College )
# player ( Player_ID, Player, Years_Played, Total_WL, Singles_WL, Doubles_WL, Team )
#
# match_season.Team can be joined with team.Team_id
# match_season.Country can be joined with country.Country_id
# player.Team can be joined with team.Team_id
#
### Question:
#
# Which college have both players with position midfielder and players with position defender?
#
### SQL:
#
# SELECT College FROM match_season WHERE POSITION = "Midfielder" INTERSECT SELECT College FROM match_season WHERE POSITION = "Defender"
#
### End.
|
match_season
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# country ( Country_id, Country_name, Capital, Official_native_language )
# team ( Team_id, Name )
# match_season ( Season, Player, Position, Country, Team, Draft_Pick_Number, Draft_Class, College )
# player ( Player_ID, Player, Years_Played, Total_WL, Singles_WL, Doubles_WL, Team )
#
# match_season.Team can be joined with team.Team_id
# match_season.Country can be joined with country.Country_id
# player.Team can be joined with team.Team_id
#
### Question:
#
# Return the colleges that have players who play the Midfielder position, as well as players who play the Defender position.
#
### SQL:
#
# SELECT College FROM match_season WHERE POSITION = "Midfielder" INTERSECT SELECT College FROM match_season WHERE POSITION = "Defender"
#
### End.
|
climbing
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# mountain ( Mountain_ID, Name, Height, Prominence, Range, Country )
# climber ( Climber_ID, Name, Country, Time, Points, Mountain_ID )
#
# climber.Mountain_ID can be joined with mountain.Mountain_ID
#
### Question:
#
# How many climbers are there?
#
### SQL:
#
# SELECT count(*) FROM climber
#
### End.
|
climbing
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# mountain ( Mountain_ID, Name, Height, Prominence, Range, Country )
# climber ( Climber_ID, Name, Country, Time, Points, Mountain_ID )
#
# climber.Mountain_ID can be joined with mountain.Mountain_ID
#
### Question:
#
# Count the number of climbers.
#
### SQL:
#
# SELECT count(*) FROM climber
#
### End.
|
climbing
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# mountain ( Mountain_ID, Name, Height, Prominence, Range, Country )
# climber ( Climber_ID, Name, Country, Time, Points, Mountain_ID )
#
# climber.Mountain_ID can be joined with mountain.Mountain_ID
#
### Question:
#
# List the names of climbers in descending order of points.
#
### SQL:
#
# SELECT Name FROM climber ORDER BY Points DESC
#
### End.
|
climbing
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# mountain ( Mountain_ID, Name, Height, Prominence, Range, Country )
# climber ( Climber_ID, Name, Country, Time, Points, Mountain_ID )
#
# climber.Mountain_ID can be joined with mountain.Mountain_ID
#
### Question:
#
# What are the names of the climbers, ordered by points descending?
#
### SQL:
#
# SELECT Name FROM climber ORDER BY Points DESC
#
### End.
|
climbing
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# mountain ( Mountain_ID, Name, Height, Prominence, Range, Country )
# climber ( Climber_ID, Name, Country, Time, Points, Mountain_ID )
#
# climber.Mountain_ID can be joined with mountain.Mountain_ID
#
### Question:
#
# List the names of climbers whose country is not Switzerland.
#
### SQL:
#
# SELECT Name FROM climber WHERE Country != "Switzerland"
#
### End.
|
climbing
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# mountain ( Mountain_ID, Name, Height, Prominence, Range, Country )
# climber ( Climber_ID, Name, Country, Time, Points, Mountain_ID )
#
# climber.Mountain_ID can be joined with mountain.Mountain_ID
#
### Question:
#
# What are the names of climbers who are not from the country of Switzerland?
#
### SQL:
#
# SELECT Name FROM climber WHERE Country != "Switzerland"
#
### End.
|
climbing
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# mountain ( Mountain_ID, Name, Height, Prominence, Range, Country )
# climber ( Climber_ID, Name, Country, Time, Points, Mountain_ID )
#
# climber.Mountain_ID can be joined with mountain.Mountain_ID
#
### Question:
#
# What is the maximum point for climbers whose country is United Kingdom?
#
### SQL:
#
# SELECT max(Points) FROM climber WHERE Country = "United Kingdom"
#
### End.
|
climbing
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# mountain ( Mountain_ID, Name, Height, Prominence, Range, Country )
# climber ( Climber_ID, Name, Country, Time, Points, Mountain_ID )
#
# climber.Mountain_ID can be joined with mountain.Mountain_ID
#
### Question:
#
# Return the maximum number of points for climbers from the United Kingdom.
#
### SQL:
#
# SELECT max(Points) FROM climber WHERE Country = "United Kingdom"
#
### End.
|
climbing
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# mountain ( Mountain_ID, Name, Height, Prominence, Range, Country )
# climber ( Climber_ID, Name, Country, Time, Points, Mountain_ID )
#
# climber.Mountain_ID can be joined with mountain.Mountain_ID
#
### Question:
#
# How many distinct countries are the climbers from?
#
### SQL:
#
# SELECT COUNT(DISTINCT Country) FROM climber
#
### End.
|
climbing
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# mountain ( Mountain_ID, Name, Height, Prominence, Range, Country )
# climber ( Climber_ID, Name, Country, Time, Points, Mountain_ID )
#
# climber.Mountain_ID can be joined with mountain.Mountain_ID
#
### Question:
#
# Count the number of different countries that climbers are from.
#
### SQL:
#
# SELECT COUNT(DISTINCT Country) FROM climber
#
### End.
|
climbing
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# mountain ( Mountain_ID, Name, Height, Prominence, Range, Country )
# climber ( Climber_ID, Name, Country, Time, Points, Mountain_ID )
#
# climber.Mountain_ID can be joined with mountain.Mountain_ID
#
### Question:
#
# What are the names of mountains in ascending alphabetical order?
#
### SQL:
#
# SELECT Name FROM mountain ORDER BY Name ASC
#
### End.
|
climbing
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# mountain ( Mountain_ID, Name, Height, Prominence, Range, Country )
# climber ( Climber_ID, Name, Country, Time, Points, Mountain_ID )
#
# climber.Mountain_ID can be joined with mountain.Mountain_ID
#
### Question:
#
# Give the names of mountains in alphabetical order.
#
### SQL:
#
# SELECT Name FROM mountain ORDER BY Name ASC
#
### End.
|
climbing
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# mountain ( Mountain_ID, Name, Height, Prominence, Range, Country )
# climber ( Climber_ID, Name, Country, Time, Points, Mountain_ID )
#
# climber.Mountain_ID can be joined with mountain.Mountain_ID
#
### Question:
#
# What are the countries of mountains with height bigger than 5000?
#
### SQL:
#
# SELECT Country FROM mountain WHERE Height > 5000
#
### End.
|
climbing
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# mountain ( Mountain_ID, Name, Height, Prominence, Range, Country )
# climber ( Climber_ID, Name, Country, Time, Points, Mountain_ID )
#
# climber.Mountain_ID can be joined with mountain.Mountain_ID
#
### Question:
#
# Return the countries of the mountains that have a height larger than 5000.
#
### SQL:
#
# SELECT Country FROM mountain WHERE Height > 5000
#
### End.
|
climbing
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# mountain ( Mountain_ID, Name, Height, Prominence, Range, Country )
# climber ( Climber_ID, Name, Country, Time, Points, Mountain_ID )
#
# climber.Mountain_ID can be joined with mountain.Mountain_ID
#
### Question:
#
# What is the name of the highest mountain?
#
### SQL:
#
# SELECT Name FROM mountain ORDER BY Height DESC LIMIT 1
#
### End.
|
climbing
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# mountain ( Mountain_ID, Name, Height, Prominence, Range, Country )
# climber ( Climber_ID, Name, Country, Time, Points, Mountain_ID )
#
# climber.Mountain_ID can be joined with mountain.Mountain_ID
#
### Question:
#
# Return the name of the mountain with the greatest height.
#
### SQL:
#
# SELECT Name FROM mountain ORDER BY Height DESC LIMIT 1
#
### End.
|
climbing
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# mountain ( Mountain_ID, Name, Height, Prominence, Range, Country )
# climber ( Climber_ID, Name, Country, Time, Points, Mountain_ID )
#
# climber.Mountain_ID can be joined with mountain.Mountain_ID
#
### Question:
#
# List the distinct ranges of the mountains with the top 3 prominence.
#
### SQL:
#
# SELECT DISTINCT Range FROM mountain ORDER BY Prominence DESC LIMIT 3
#
### End.
|
climbing
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# mountain ( Mountain_ID, Name, Height, Prominence, Range, Country )
# climber ( Climber_ID, Name, Country, Time, Points, Mountain_ID )
#
# climber.Mountain_ID can be joined with mountain.Mountain_ID
#
### Question:
#
# What are the different ranges of the 3 mountains with the highest prominence?
#
### SQL:
#
# SELECT DISTINCT Range FROM mountain ORDER BY Prominence DESC LIMIT 3
#
### End.
|
climbing
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# mountain ( Mountain_ID, Name, Height, Prominence, Range, Country )
# climber ( Climber_ID, Name, Country, Time, Points, Mountain_ID )
#
# climber.Mountain_ID can be joined with mountain.Mountain_ID
#
### Question:
#
# Show names of climbers and the names of mountains they climb.
#
### SQL:
#
# SELECT T1.Name , T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID
#
### End.
|
climbing
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# mountain ( Mountain_ID, Name, Height, Prominence, Range, Country )
# climber ( Climber_ID, Name, Country, Time, Points, Mountain_ID )
#
# climber.Mountain_ID can be joined with mountain.Mountain_ID
#
### Question:
#
# What are the names of climbers and the corresponding names of mountains that they climb?
#
### SQL:
#
# SELECT T1.Name , T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID
#
### End.
|
climbing
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# mountain ( Mountain_ID, Name, Height, Prominence, Range, Country )
# climber ( Climber_ID, Name, Country, Time, Points, Mountain_ID )
#
# climber.Mountain_ID can be joined with mountain.Mountain_ID
#
### Question:
#
# Show the names of climbers and the heights of mountains they climb.
#
### SQL:
#
# SELECT T1.Name , T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID
#
### End.
|
climbing
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# mountain ( Mountain_ID, Name, Height, Prominence, Range, Country )
# climber ( Climber_ID, Name, Country, Time, Points, Mountain_ID )
#
# climber.Mountain_ID can be joined with mountain.Mountain_ID
#
### Question:
#
# What are the names of climbers and the corresponding heights of the mountains that they climb?
#
### SQL:
#
# SELECT T1.Name , T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID
#
### End.
|
climbing
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# mountain ( Mountain_ID, Name, Height, Prominence, Range, Country )
# climber ( Climber_ID, Name, Country, Time, Points, Mountain_ID )
#
# climber.Mountain_ID can be joined with mountain.Mountain_ID
#
### Question:
#
# Show the height of the mountain climbed by the climber with the maximum points.
#
### SQL:
#
# 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
#
### End.
|
climbing
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# mountain ( Mountain_ID, Name, Height, Prominence, Range, Country )
# climber ( Climber_ID, Name, Country, Time, Points, Mountain_ID )
#
# climber.Mountain_ID can be joined with mountain.Mountain_ID
#
### Question:
#
# What is the height of the mountain climbined by the climbing who had the most points?
#
### SQL:
#
# 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
#
### End.
|
climbing
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# mountain ( Mountain_ID, Name, Height, Prominence, Range, Country )
# climber ( Climber_ID, Name, Country, Time, Points, Mountain_ID )
#
# climber.Mountain_ID can be joined with mountain.Mountain_ID
#
### Question:
#
# Show the distinct names of mountains climbed by climbers from country "West Germany".
#
### SQL:
#
# SELECT DISTINCT T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T1.Country = "West Germany"
#
### End.
|
climbing
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# mountain ( Mountain_ID, Name, Height, Prominence, Range, Country )
# climber ( Climber_ID, Name, Country, Time, Points, Mountain_ID )
#
# climber.Mountain_ID can be joined with mountain.Mountain_ID
#
### Question:
#
# What are the different names of mountains ascended by climbers from the country of West Germany?
#
### SQL:
#
# SELECT DISTINCT T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T1.Country = "West Germany"
#
### End.
|
climbing
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# mountain ( Mountain_ID, Name, Height, Prominence, Range, Country )
# climber ( Climber_ID, Name, Country, Time, Points, Mountain_ID )
#
# climber.Mountain_ID can be joined with mountain.Mountain_ID
#
### Question:
#
# Show the times used by climbers to climb mountains in Country Uganda.
#
### SQL:
#
# SELECT T1.Time FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T2.Country = "Uganda"
#
### End.
|
climbing
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# mountain ( Mountain_ID, Name, Height, Prominence, Range, Country )
# climber ( Climber_ID, Name, Country, Time, Points, Mountain_ID )
#
# climber.Mountain_ID can be joined with mountain.Mountain_ID
#
### Question:
#
# What are the times used by climbers who climbed mountains in the country of Uganda?
#
### SQL:
#
# SELECT T1.Time FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T2.Country = "Uganda"
#
### End.
|
climbing
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# mountain ( Mountain_ID, Name, Height, Prominence, Range, Country )
# climber ( Climber_ID, Name, Country, Time, Points, Mountain_ID )
#
# climber.Mountain_ID can be joined with mountain.Mountain_ID
#
### Question:
#
# Please show the countries and the number of climbers from each country.
#
### SQL:
#
# SELECT Country , COUNT(*) FROM climber GROUP BY Country
#
### End.
|
climbing
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# mountain ( Mountain_ID, Name, Height, Prominence, Range, Country )
# climber ( Climber_ID, Name, Country, Time, Points, Mountain_ID )
#
# climber.Mountain_ID can be joined with mountain.Mountain_ID
#
### Question:
#
# How many climbers are from each country?
#
### SQL:
#
# SELECT Country , COUNT(*) FROM climber GROUP BY Country
#
### End.
|
climbing
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# mountain ( Mountain_ID, Name, Height, Prominence, Range, Country )
# climber ( Climber_ID, Name, Country, Time, Points, Mountain_ID )
#
# climber.Mountain_ID can be joined with mountain.Mountain_ID
#
### Question:
#
# List the countries that have more than one mountain.
#
### SQL:
#
# SELECT Country FROM mountain GROUP BY Country HAVING COUNT(*) > 1
#
### End.
|
climbing
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# mountain ( Mountain_ID, Name, Height, Prominence, Range, Country )
# climber ( Climber_ID, Name, Country, Time, Points, Mountain_ID )
#
# climber.Mountain_ID can be joined with mountain.Mountain_ID
#
### Question:
#
# Which countries have more than one mountain?
#
### SQL:
#
# SELECT Country FROM mountain GROUP BY Country HAVING COUNT(*) > 1
#
### End.
|
climbing
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# mountain ( Mountain_ID, Name, Height, Prominence, Range, Country )
# climber ( Climber_ID, Name, Country, Time, Points, Mountain_ID )
#
# climber.Mountain_ID can be joined with mountain.Mountain_ID
#
### Question:
#
# List the names of mountains that do not have any climber.
#
### SQL:
#
# SELECT Name FROM mountain WHERE Mountain_ID NOT IN (SELECT Mountain_ID FROM climber)
#
### End.
|
climbing
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# mountain ( Mountain_ID, Name, Height, Prominence, Range, Country )
# climber ( Climber_ID, Name, Country, Time, Points, Mountain_ID )
#
# climber.Mountain_ID can be joined with mountain.Mountain_ID
#
### Question:
#
# What are the names of countains that no climber has climbed?
#
### SQL:
#
# SELECT Name FROM mountain WHERE Mountain_ID NOT IN (SELECT Mountain_ID FROM climber)
#
### End.
|
climbing
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# mountain ( Mountain_ID, Name, Height, Prominence, Range, Country )
# climber ( Climber_ID, Name, Country, Time, Points, Mountain_ID )
#
# climber.Mountain_ID can be joined with mountain.Mountain_ID
#
### Question:
#
# Show the countries that have mountains with height more than 5600 stories and mountains with height less than 5200.
#
### SQL:
#
# SELECT Country FROM mountain WHERE Height > 5600 INTERSECT SELECT Country FROM mountain WHERE Height < 5200
#
### End.
|
climbing
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# mountain ( Mountain_ID, Name, Height, Prominence, Range, Country )
# climber ( Climber_ID, Name, Country, Time, Points, Mountain_ID )
#
# climber.Mountain_ID can be joined with mountain.Mountain_ID
#
### Question:
#
# What are the countries that have both mountains that are higher than 5600 and lower than 5200?
#
### SQL:
#
# SELECT Country FROM mountain WHERE Height > 5600 INTERSECT SELECT Country FROM mountain WHERE Height < 5200
#
### End.
|
climbing
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# mountain ( Mountain_ID, Name, Height, Prominence, Range, Country )
# climber ( Climber_ID, Name, Country, Time, Points, Mountain_ID )
#
# climber.Mountain_ID can be joined with mountain.Mountain_ID
#
### Question:
#
# Show the range that has the most number of mountains.
#
### SQL:
#
# SELECT Range FROM mountain GROUP BY Range ORDER BY COUNT(*) DESC LIMIT 1
#
### End.
|
climbing
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# mountain ( Mountain_ID, Name, Height, Prominence, Range, Country )
# climber ( Climber_ID, Name, Country, Time, Points, Mountain_ID )
#
# climber.Mountain_ID can be joined with mountain.Mountain_ID
#
### Question:
#
# Which range contains the most mountains?
#
### SQL:
#
# SELECT Range FROM mountain GROUP BY Range ORDER BY COUNT(*) DESC LIMIT 1
#
### End.
|
climbing
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# mountain ( Mountain_ID, Name, Height, Prominence, Range, Country )
# climber ( Climber_ID, Name, Country, Time, Points, Mountain_ID )
#
# climber.Mountain_ID can be joined with mountain.Mountain_ID
#
### Question:
#
# Show the names of mountains with height more than 5000 or prominence more than 1000.
#
### SQL:
#
# SELECT Name FROM mountain WHERE Height > 5000 OR Prominence > 1000
#
### End.
|
climbing
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# mountain ( Mountain_ID, Name, Height, Prominence, Range, Country )
# climber ( Climber_ID, Name, Country, Time, Points, Mountain_ID )
#
# climber.Mountain_ID can be joined with mountain.Mountain_ID
#
### Question:
#
# What are the names of mountains that have a height of over 5000 or a prominence of over 1000?
#
### SQL:
#
# SELECT Name FROM mountain WHERE Height > 5000 OR Prominence > 1000
#
### End.
|
body_builder
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# body_builder ( Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total )
# people ( People_ID, Name, Height, Weight, Birth_Date, Birth_Place )
#
# body_builder.People_ID can be joined with people.People_ID
#
### Question:
#
# How many body builders are there?
#
### SQL:
#
# SELECT count(*) FROM body_builder
#
### End.
|
body_builder
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# body_builder ( Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total )
# people ( People_ID, Name, Height, Weight, Birth_Date, Birth_Place )
#
# body_builder.People_ID can be joined with people.People_ID
#
### Question:
#
# List the total scores of body builders in ascending order.
#
### SQL:
#
# SELECT Total FROM body_builder ORDER BY Total ASC
#
### End.
|
body_builder
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# body_builder ( Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total )
# people ( People_ID, Name, Height, Weight, Birth_Date, Birth_Place )
#
# body_builder.People_ID can be joined with people.People_ID
#
### Question:
#
# List the snatch score and clean jerk score of body builders in ascending order of snatch score.
#
### SQL:
#
# SELECT Snatch , Clean_Jerk FROM body_builder ORDER BY Snatch ASC
#
### End.
|
body_builder
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# body_builder ( Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total )
# people ( People_ID, Name, Height, Weight, Birth_Date, Birth_Place )
#
# body_builder.People_ID can be joined with people.People_ID
#
### Question:
#
# What is the average snatch score of body builders?
#
### SQL:
#
# SELECT avg(Snatch) FROM body_builder
#
### End.
|
body_builder
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# body_builder ( Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total )
# people ( People_ID, Name, Height, Weight, Birth_Date, Birth_Place )
#
# body_builder.People_ID can be joined with people.People_ID
#
### Question:
#
# What are the clean and jerk score of the body builder with the highest total score?
#
### SQL:
#
# SELECT Clean_Jerk FROM body_builder ORDER BY Total DESC LIMIT 1
#
### End.
|
body_builder
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# body_builder ( Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total )
# people ( People_ID, Name, Height, Weight, Birth_Date, Birth_Place )
#
# body_builder.People_ID can be joined with people.People_ID
#
### Question:
#
# What are the birthdays of people in ascending order of height?
#
### SQL:
#
# SELECT Birth_Date FROM People ORDER BY Height ASC
#
### End.
|
body_builder
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# body_builder ( Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total )
# people ( People_ID, Name, Height, Weight, Birth_Date, Birth_Place )
#
# body_builder.People_ID can be joined with people.People_ID
#
### Question:
#
# What are the names of body builders?
#
### SQL:
#
# SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID
#
### End.
|
body_builder
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# body_builder ( Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total )
# people ( People_ID, Name, Height, Weight, Birth_Date, Birth_Place )
#
# body_builder.People_ID can be joined with people.People_ID
#
### Question:
#
# What are the names of body builders whose total score is higher than 300?
#
### SQL:
#
# SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Total > 300
#
### End.
|
body_builder
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# body_builder ( Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total )
# people ( People_ID, Name, Height, Weight, Birth_Date, Birth_Place )
#
# body_builder.People_ID can be joined with people.People_ID
#
### Question:
#
# What is the name of the body builder with the greatest body weight?
#
### SQL:
#
# 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
#
### End.
|
body_builder
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# body_builder ( Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total )
# people ( People_ID, Name, Height, Weight, Birth_Date, Birth_Place )
#
# body_builder.People_ID can be joined with people.People_ID
#
### Question:
#
# What are the birth date and birth place of the body builder with the highest total points?
#
### SQL:
#
# 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
#
### End.
|
body_builder
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# body_builder ( Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total )
# people ( People_ID, Name, Height, Weight, Birth_Date, Birth_Place )
#
# body_builder.People_ID can be joined with people.People_ID
#
### Question:
#
# What are the heights of body builders with total score smaller than 315?
#
### SQL:
#
# SELECT T2.Height FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Total < 315
#
### End.
|
body_builder
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# body_builder ( Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total )
# people ( People_ID, Name, Height, Weight, Birth_Date, Birth_Place )
#
# body_builder.People_ID can be joined with people.People_ID
#
### Question:
#
# What is the average total score of body builders with height bigger than 200?
#
### SQL:
#
# SELECT avg(T1.Total) FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Height > 200
#
### End.
|
body_builder
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# body_builder ( Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total )
# people ( People_ID, Name, Height, Weight, Birth_Date, Birth_Place )
#
# body_builder.People_ID can be joined with people.People_ID
#
### Question:
#
# What are the names of body builders in descending order of total scores?
#
### SQL:
#
# SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Total DESC
#
### End.
|
body_builder
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# body_builder ( Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total )
# people ( People_ID, Name, Height, Weight, Birth_Date, Birth_Place )
#
# body_builder.People_ID can be joined with people.People_ID
#
### Question:
#
# List each birth place along with the number of people from there.
#
### SQL:
#
# SELECT Birth_Place , COUNT(*) FROM people GROUP BY Birth_Place
#
### End.
|
body_builder
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# body_builder ( Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total )
# people ( People_ID, Name, Height, Weight, Birth_Date, Birth_Place )
#
# body_builder.People_ID can be joined with people.People_ID
#
### Question:
#
# What is the most common birth place of people?
#
### SQL:
#
# SELECT Birth_Place FROM people GROUP BY Birth_Place ORDER BY COUNT(*) DESC LIMIT 1
#
### End.
|
body_builder
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# body_builder ( Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total )
# people ( People_ID, Name, Height, Weight, Birth_Date, Birth_Place )
#
# body_builder.People_ID can be joined with people.People_ID
#
### Question:
#
# What are the birth places that are shared by at least two people?
#
### SQL:
#
# SELECT Birth_Place FROM people GROUP BY Birth_Place HAVING COUNT(*) >= 2
#
### End.
|
body_builder
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# body_builder ( Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total )
# people ( People_ID, Name, Height, Weight, Birth_Date, Birth_Place )
#
# body_builder.People_ID can be joined with people.People_ID
#
### Question:
#
# List the height and weight of people in descending order of height.
#
### SQL:
#
# SELECT Height , Weight FROM people ORDER BY Height DESC
#
### End.
|
body_builder
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# body_builder ( Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total )
# people ( People_ID, Name, Height, Weight, Birth_Date, Birth_Place )
#
# body_builder.People_ID can be joined with people.People_ID
#
### Question:
#
# Show all information about each body builder.
#
### SQL:
#
# SELECT * FROM body_builder
#
### End.
|
body_builder
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# body_builder ( Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total )
# people ( People_ID, Name, Height, Weight, Birth_Date, Birth_Place )
#
# body_builder.People_ID can be joined with people.People_ID
#
### Question:
#
# List the names and origins of people who are not body builders.
#
### SQL:
#
# 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
#
### End.
|
body_builder
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# body_builder ( Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total )
# people ( People_ID, Name, Height, Weight, Birth_Date, Birth_Place )
#
# body_builder.People_ID can be joined with people.People_ID
#
### Question:
#
# How many distinct birth places are there?
#
### SQL:
#
# SELECT count(DISTINCT Birth_Place) FROM people
#
### End.
|
body_builder
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# body_builder ( Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total )
# people ( People_ID, Name, Height, Weight, Birth_Date, Birth_Place )
#
# body_builder.People_ID can be joined with people.People_ID
#
### Question:
#
# How many persons are not body builders?
#
### SQL:
#
# SELECT count(*) FROM people WHERE people_id NOT IN (SELECT People_ID FROM body_builder)
#
### End.
|
body_builder
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# body_builder ( Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total )
# people ( People_ID, Name, Height, Weight, Birth_Date, Birth_Place )
#
# body_builder.People_ID can be joined with people.People_ID
#
### Question:
#
# List the weight of the body builders who have snatch score higher than 140 or have the height greater than 200.
#
### SQL:
#
# 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;
#
### End.
|
body_builder
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# body_builder ( Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total )
# people ( People_ID, Name, Height, Weight, Birth_Date, Birth_Place )
#
# body_builder.People_ID can be joined with people.People_ID
#
### Question:
#
# What are the total scores of the body builders whose birthday contains the string "January" ?
#
### SQL:
#
# 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%";
#
### End.
|
body_builder
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# body_builder ( Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total )
# people ( People_ID, Name, Height, Weight, Birth_Date, Birth_Place )
#
# body_builder.People_ID can be joined with people.People_ID
#
### Question:
#
# What is the minimum snatch score?
#
### SQL:
#
# SELECT min(snatch) FROM body_builder
#
### End.
|
election_representative
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# election ( Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place )
# representative ( Representative_ID, Name, State, Party, Lifespan )
#
# election.Representative_ID can be joined with representative.Representative_ID
#
### Question:
#
# How many elections are there?
#
### SQL:
#
# SELECT count(*) FROM election
#
### End.
|
election_representative
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# election ( Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place )
# representative ( Representative_ID, Name, State, Party, Lifespan )
#
# election.Representative_ID can be joined with representative.Representative_ID
#
### Question:
#
# List the votes of elections in descending order.
#
### SQL:
#
# SELECT Votes FROM election ORDER BY Votes DESC
#
### End.
|
election_representative
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# election ( Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place )
# representative ( Representative_ID, Name, State, Party, Lifespan )
#
# election.Representative_ID can be joined with representative.Representative_ID
#
### Question:
#
# List the dates and vote percents of elections.
#
### SQL:
#
# SELECT Date , Vote_Percent FROM election
#
### End.
|
election_representative
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# election ( Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place )
# representative ( Representative_ID, Name, State, Party, Lifespan )
#
# election.Representative_ID can be joined with representative.Representative_ID
#
### Question:
#
# What are the minimum and maximum vote percents of elections?
#
### SQL:
#
# SELECT min(Vote_Percent) , max(Vote_Percent) FROM election
#
### End.
|
election_representative
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# election ( Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place )
# representative ( Representative_ID, Name, State, Party, Lifespan )
#
# election.Representative_ID can be joined with representative.Representative_ID
#
### Question:
#
# What are the names and parties of representatives?
#
### SQL:
#
# SELECT Name , Party FROM representative
#
### End.
|
election_representative
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# election ( Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place )
# representative ( Representative_ID, Name, State, Party, Lifespan )
#
# election.Representative_ID can be joined with representative.Representative_ID
#
### Question:
#
# What are the names of representatives whose party is not "Republican"?
#
### SQL:
#
# SELECT Name FROM Representative WHERE Party != "Republican"
#
### End.
|
election_representative
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# election ( Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place )
# representative ( Representative_ID, Name, State, Party, Lifespan )
#
# election.Representative_ID can be joined with representative.Representative_ID
#
### Question:
#
# What are the life spans of representatives from New York state or Indiana state?
#
### SQL:
#
# SELECT Lifespan FROM representative WHERE State = "New York" OR State = "Indiana"
#
### End.
|
election_representative
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# election ( Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place )
# representative ( Representative_ID, Name, State, Party, Lifespan )
#
# election.Representative_ID can be joined with representative.Representative_ID
#
### Question:
#
# What are the names of representatives and the dates of elections they participated in.
#
### SQL:
#
# SELECT T2.Name , T1.Date FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID
#
### End.
|
election_representative
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# election ( Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place )
# representative ( Representative_ID, Name, State, Party, Lifespan )
#
# election.Representative_ID can be joined with representative.Representative_ID
#
### Question:
#
# What are the names of representatives with more than 10000 votes in election?
#
### SQL:
#
# SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID WHERE Votes > 10000
#
### End.
|
election_representative
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# election ( Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place )
# representative ( Representative_ID, Name, State, Party, Lifespan )
#
# election.Representative_ID can be joined with representative.Representative_ID
#
### Question:
#
# What are the names of representatives in descending order of votes?
#
### SQL:
#
# SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY votes DESC
#
### End.
|
election_representative
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# election ( Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place )
# representative ( Representative_ID, Name, State, Party, Lifespan )
#
# election.Representative_ID can be joined with representative.Representative_ID
#
### Question:
#
# What is the party of the representative that has the smallest number of votes.
#
### SQL:
#
# SELECT T2.Party FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY votes ASC LIMIT 1
#
### End.
|
election_representative
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# election ( Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place )
# representative ( Representative_ID, Name, State, Party, Lifespan )
#
# election.Representative_ID can be joined with representative.Representative_ID
#
### Question:
#
# What are the lifespans of representatives in descending order of vote percent?
#
### SQL:
#
# SELECT T2.Lifespan FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY Vote_Percent DESC
#
### End.
|
election_representative
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# election ( Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place )
# representative ( Representative_ID, Name, State, Party, Lifespan )
#
# election.Representative_ID can be joined with representative.Representative_ID
#
### Question:
#
# What is the average number of votes of representatives from party "Republican"?
#
### SQL:
#
# SELECT avg(T1.Votes) FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID WHERE T2.Party = "Republican"
#
### End.
|
election_representative
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# election ( Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place )
# representative ( Representative_ID, Name, State, Party, Lifespan )
#
# election.Representative_ID can be joined with representative.Representative_ID
#
### Question:
#
# What are the different parties of representative? Show the party name and the number of representatives in each party.
#
### SQL:
#
# SELECT Party , COUNT(*) FROM representative GROUP BY Party
#
### End.
|
election_representative
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# election ( Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place )
# representative ( Representative_ID, Name, State, Party, Lifespan )
#
# election.Representative_ID can be joined with representative.Representative_ID
#
### Question:
#
# What is the party that has the largest number of representatives?
#
### SQL:
#
# SELECT Party , COUNT(*) FROM representative GROUP BY Party ORDER BY COUNT(*) DESC LIMIT 1
#
### End.
|
election_representative
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# election ( Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place )
# representative ( Representative_ID, Name, State, Party, Lifespan )
#
# election.Representative_ID can be joined with representative.Representative_ID
#
### Question:
#
# What parties have at least three representatives?
#
### SQL:
#
# SELECT Party FROM representative GROUP BY Party HAVING COUNT(*) >= 3
#
### End.
|
election_representative
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# election ( Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place )
# representative ( Representative_ID, Name, State, Party, Lifespan )
#
# election.Representative_ID can be joined with representative.Representative_ID
#
### Question:
#
# What states have at least two representatives?
#
### SQL:
#
# SELECT State FROM representative GROUP BY State HAVING COUNT(*) >= 2
#
### End.
|
election_representative
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# election ( Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place )
# representative ( Representative_ID, Name, State, Party, Lifespan )
#
# election.Representative_ID can be joined with representative.Representative_ID
#
### Question:
#
# List the names of representatives that have not participated in elections listed here.
#
### SQL:
#
# SELECT Name FROM representative WHERE Representative_ID NOT IN (SELECT Representative_ID FROM election)
#
### End.
|
election_representative
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# election ( Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place )
# representative ( Representative_ID, Name, State, Party, Lifespan )
#
# election.Representative_ID can be joined with representative.Representative_ID
#
### Question:
#
# Show the parties that have both representatives in New York state and representatives in Pennsylvania state.
#
### SQL:
#
# SELECT Party FROM representative WHERE State = "New York" INTERSECT SELECT Party FROM representative WHERE State = "Pennsylvania"
#
### End.
|
election_representative
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# election ( Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place )
# representative ( Representative_ID, Name, State, Party, Lifespan )
#
# election.Representative_ID can be joined with representative.Representative_ID
#
### Question:
#
# How many distinct parties are there for representatives?
#
### SQL:
#
# SELECT count(DISTINCT Party) FROM representative
#
### End.
|
apartment_rentals
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Apartment_Buildings ( building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone )
# Apartments ( apt_id, building_id, apt_type_code, apt_number, bathroom_count, bedroom_count, room_count )
# Apartment_Facilities ( apt_id, facility_code )
# Guests ( guest_id, gender_code, guest_first_name, guest_last_name, date_of_birth )
# Apartment_Bookings ( apt_booking_id, apt_id, guest_id, booking_status_code, booking_start_date, booking_end_date )
# View_Unit_Status ( apt_id, apt_booking_id, status_date, available_yn )
#
# Apartments.building_id can be joined with Apartment_Buildings.building_id
# Apartment_Facilities.apt_id can be joined with Apartments.apt_id
# Apartment_Bookings.guest_id can be joined with Guests.guest_id
# Apartment_Bookings.apt_id can be joined with Apartments.apt_id
# View_Unit_Status.apt_booking_id can be joined with Apartment_Bookings.apt_booking_id
# View_Unit_Status.apt_id can be joined with Apartments.apt_id
#
### Question:
#
# How many apartment bookings are there in total?
#
### SQL:
#
# SELECT count(*) FROM Apartment_Bookings
#
### End.
|
apartment_rentals
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Apartment_Buildings ( building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone )
# Apartments ( apt_id, building_id, apt_type_code, apt_number, bathroom_count, bedroom_count, room_count )
# Apartment_Facilities ( apt_id, facility_code )
# Guests ( guest_id, gender_code, guest_first_name, guest_last_name, date_of_birth )
# Apartment_Bookings ( apt_booking_id, apt_id, guest_id, booking_status_code, booking_start_date, booking_end_date )
# View_Unit_Status ( apt_id, apt_booking_id, status_date, available_yn )
#
# Apartments.building_id can be joined with Apartment_Buildings.building_id
# Apartment_Facilities.apt_id can be joined with Apartments.apt_id
# Apartment_Bookings.guest_id can be joined with Guests.guest_id
# Apartment_Bookings.apt_id can be joined with Apartments.apt_id
# View_Unit_Status.apt_booking_id can be joined with Apartment_Bookings.apt_booking_id
# View_Unit_Status.apt_id can be joined with Apartments.apt_id
#
### Question:
#
# Count the total number of apartment bookings.
#
### SQL:
#
# SELECT count(*) FROM Apartment_Bookings
#
### End.
|
apartment_rentals
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Apartment_Buildings ( building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone )
# Apartments ( apt_id, building_id, apt_type_code, apt_number, bathroom_count, bedroom_count, room_count )
# Apartment_Facilities ( apt_id, facility_code )
# Guests ( guest_id, gender_code, guest_first_name, guest_last_name, date_of_birth )
# Apartment_Bookings ( apt_booking_id, apt_id, guest_id, booking_status_code, booking_start_date, booking_end_date )
# View_Unit_Status ( apt_id, apt_booking_id, status_date, available_yn )
#
# Apartments.building_id can be joined with Apartment_Buildings.building_id
# Apartment_Facilities.apt_id can be joined with Apartments.apt_id
# Apartment_Bookings.guest_id can be joined with Guests.guest_id
# Apartment_Bookings.apt_id can be joined with Apartments.apt_id
# View_Unit_Status.apt_booking_id can be joined with Apartment_Bookings.apt_booking_id
# View_Unit_Status.apt_id can be joined with Apartments.apt_id
#
### Question:
#
# Show the start dates and end dates of all the apartment bookings.
#
### SQL:
#
# SELECT booking_start_date , booking_end_date FROM Apartment_Bookings
#
### End.
|
apartment_rentals
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Apartment_Buildings ( building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone )
# Apartments ( apt_id, building_id, apt_type_code, apt_number, bathroom_count, bedroom_count, room_count )
# Apartment_Facilities ( apt_id, facility_code )
# Guests ( guest_id, gender_code, guest_first_name, guest_last_name, date_of_birth )
# Apartment_Bookings ( apt_booking_id, apt_id, guest_id, booking_status_code, booking_start_date, booking_end_date )
# View_Unit_Status ( apt_id, apt_booking_id, status_date, available_yn )
#
# Apartments.building_id can be joined with Apartment_Buildings.building_id
# Apartment_Facilities.apt_id can be joined with Apartments.apt_id
# Apartment_Bookings.guest_id can be joined with Guests.guest_id
# Apartment_Bookings.apt_id can be joined with Apartments.apt_id
# View_Unit_Status.apt_booking_id can be joined with Apartment_Bookings.apt_booking_id
# View_Unit_Status.apt_id can be joined with Apartments.apt_id
#
### Question:
#
# What are the start date and end date of each apartment booking?
#
### SQL:
#
# SELECT booking_start_date , booking_end_date FROM Apartment_Bookings
#
### End.
|
apartment_rentals
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Apartment_Buildings ( building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone )
# Apartments ( apt_id, building_id, apt_type_code, apt_number, bathroom_count, bedroom_count, room_count )
# Apartment_Facilities ( apt_id, facility_code )
# Guests ( guest_id, gender_code, guest_first_name, guest_last_name, date_of_birth )
# Apartment_Bookings ( apt_booking_id, apt_id, guest_id, booking_status_code, booking_start_date, booking_end_date )
# View_Unit_Status ( apt_id, apt_booking_id, status_date, available_yn )
#
# Apartments.building_id can be joined with Apartment_Buildings.building_id
# Apartment_Facilities.apt_id can be joined with Apartments.apt_id
# Apartment_Bookings.guest_id can be joined with Guests.guest_id
# Apartment_Bookings.apt_id can be joined with Apartments.apt_id
# View_Unit_Status.apt_booking_id can be joined with Apartment_Bookings.apt_booking_id
# View_Unit_Status.apt_id can be joined with Apartments.apt_id
#
### Question:
#
# Show all distinct building descriptions.
#
### SQL:
#
# SELECT DISTINCT building_description FROM Apartment_Buildings
#
### End.
|
apartment_rentals
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Apartment_Buildings ( building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone )
# Apartments ( apt_id, building_id, apt_type_code, apt_number, bathroom_count, bedroom_count, room_count )
# Apartment_Facilities ( apt_id, facility_code )
# Guests ( guest_id, gender_code, guest_first_name, guest_last_name, date_of_birth )
# Apartment_Bookings ( apt_booking_id, apt_id, guest_id, booking_status_code, booking_start_date, booking_end_date )
# View_Unit_Status ( apt_id, apt_booking_id, status_date, available_yn )
#
# Apartments.building_id can be joined with Apartment_Buildings.building_id
# Apartment_Facilities.apt_id can be joined with Apartments.apt_id
# Apartment_Bookings.guest_id can be joined with Guests.guest_id
# Apartment_Bookings.apt_id can be joined with Apartments.apt_id
# View_Unit_Status.apt_booking_id can be joined with Apartment_Bookings.apt_booking_id
# View_Unit_Status.apt_id can be joined with Apartments.apt_id
#
### Question:
#
# Give me a list of all the distinct building descriptions.
#
### SQL:
#
# SELECT DISTINCT building_description FROM Apartment_Buildings
#
### End.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.