db_id
stringlengths
3
31
query
stringlengths
18
577
question
stringlengths
3
224
schema
stringlengths
177
6.14k
primary_keys
stringlengths
16
545
foreign_keys
stringlengths
16
1.48k
match_season
SELECT College FROM match_season GROUP BY College HAVING count(*) >= 2
Show the name of colleges that have at least two players.
[Schema (values) (types)]: | match_season | country : country_id (text) , country_name (number) , capital (text) , official_native_language (text) | team : team_id (text) , name (number) | match_season : season (text) , player (number) , position (text) , country (text) , team (text) , draft_pick_number (number) , draft_class (text) , college (number) | player : player_id (text) , player (number) , years_played (text) , total_wl (text) , singles_wl (text) , doubles_wl (number) , team (text);
[Primary Keys]: country : country_id, team : team_id, match_season : season, player : player_id
[Foreign Keys]: match_season : team = team : team_id | match_season : country = country : country_id | player : team = team : team_id
match_season
SELECT College FROM match_season GROUP BY College HAVING count(*) >= 2
What are the names of all colleges that have two or more players?
[Schema (values) (types)]: | match_season | country : country_id (text) , country_name (number) , capital (text) , official_native_language (text) | team : team_id (text) , name (number) | match_season : season (text) , player (number) , position (text) , country (text) , team (text) , draft_pick_number (number) , draft_class (text) , college (number) | player : player_id (text) , player (number) , years_played (text) , total_wl (text) , singles_wl (text) , doubles_wl (number) , team (text);
[Primary Keys]: country : country_id, team : team_id, match_season : season, player : player_id
[Foreign Keys]: match_season : team = team : team_id | match_season : country = country : country_id | player : team = team : team_id
match_season
SELECT College FROM match_season GROUP BY College HAVING count(*) >= 2 ORDER BY College DESC
Show the name of colleges that have at least two players in descending alphabetical order.
[Schema (values) (types)]: | match_season | country : country_id (text) , country_name (number) , capital (text) , official_native_language (text) | team : team_id (text) , name (number) | match_season : season (text) , player (number) , position (text) , country (text) , team (text) , draft_pick_number (number) , draft_class (text) , college (number) | player : player_id (text) , player (number) , years_played (text) , total_wl (text) , singles_wl (text) , doubles_wl (number) , team (text);
[Primary Keys]: country : country_id, team : team_id, match_season : season, player : player_id
[Foreign Keys]: match_season : team = team : team_id | match_season : country = country : country_id | player : team = team : team_id
match_season
SELECT College FROM match_season GROUP BY College HAVING count(*) >= 2 ORDER BY College DESC
What are the names of colleges that have two or more players, listed in descending alphabetical order?
[Schema (values) (types)]: | match_season | country : country_id (text) , country_name (number) , capital (text) , official_native_language (text) | team : team_id (text) , name (number) | match_season : season (text) , player (number) , position (text) , country (text) , team (text) , draft_pick_number (number) , draft_class (text) , college (number) | player : player_id (text) , player (number) , years_played (text) , total_wl (text) , singles_wl (text) , doubles_wl (number) , team (text);
[Primary Keys]: country : country_id, team : team_id, match_season : season, player : player_id
[Foreign Keys]: match_season : team = team : team_id | match_season : country = country : country_id | player : team = team : team_id
match_season
SELECT Name FROM team WHERE Team_id NOT IN (SELECT Team FROM match_season)
What are the names of teams that do no have match season record?
[Schema (values) (types)]: | match_season | country : country_id (text) , country_name (number) , capital (text) , official_native_language (text) | team : team_id (text) , name (number) | match_season : season (text) , player (number) , position (text) , country (text) , team (text) , draft_pick_number (number) , draft_class (text) , college (number) | player : player_id (text) , player (number) , years_played (text) , total_wl (text) , singles_wl (text) , doubles_wl (number) , team (text);
[Primary Keys]: country : country_id, team : team_id, match_season : season, player : player_id
[Foreign Keys]: match_season : team = team : team_id | match_season : country = country : country_id | player : team = team : team_id
match_season
SELECT Name FROM team WHERE Team_id NOT IN (SELECT Team FROM match_season)
Return the names of teams that have no match season record.
[Schema (values) (types)]: | match_season | country : country_id (text) , country_name (number) , capital (text) , official_native_language (text) | team : team_id (text) , name (number) | match_season : season (text) , player (number) , position (text) , country (text) , team (text) , draft_pick_number (number) , draft_class (text) , college (number) | player : player_id (text) , player (number) , years_played (text) , total_wl (text) , singles_wl (text) , doubles_wl (number) , team (text);
[Primary Keys]: country : country_id, team : team_id, match_season : season, player : player_id
[Foreign Keys]: match_season : team = team : team_id | match_season : country = country : country_id | player : team = team : team_id
match_season
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"
What are the names of countries that have both players with position forward and players with position defender?
[Schema (values) (types)]: | match_season | country : country_id (text) , country_name (number) , capital (text) , official_native_language (text) | team : team_id (text) , name (number) | match_season : season (text) , player (number) , position (text) , country (text) , team (text) , draft_pick_number (number) , draft_class (text) , college (number) | player : player_id (text) , player (number) , years_played (text) , total_wl (text) , singles_wl (text) , doubles_wl (number) , team (text);
[Primary Keys]: country : country_id, team : team_id, match_season : season, player : player_id
[Foreign Keys]: match_season : team = team : team_id | match_season : country = country : country_id | player : team = team : team_id
match_season
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"
Return the names of countries that have players that play the Forward position, as well as players who play the Defender position.
[Schema (values) (types)]: | match_season | country : country_id (text) , country_name (number) , capital (text) , official_native_language (text) | team : team_id (text) , name (number) | match_season : season (text) , player (number) , position (text) , country (text) , team (text) , draft_pick_number (number) , draft_class (text) , college (number) | player : player_id (text) , player (number) , years_played (text) , total_wl (text) , singles_wl (text) , doubles_wl (number) , team (text);
[Primary Keys]: country : country_id, team : team_id, match_season : season, player : player_id
[Foreign Keys]: match_season : team = team : team_id | match_season : country = country : country_id | player : team = team : team_id
match_season
SELECT College FROM match_season WHERE POSITION = "Midfielder" INTERSECT SELECT College FROM match_season WHERE POSITION = "Defender"
Which college have both players with position midfielder and players with position defender?
[Schema (values) (types)]: | match_season | country : country_id (text) , country_name (number) , capital (text) , official_native_language (text) | team : team_id (text) , name (number) | match_season : season (text) , player (number) , position (text) , country (text) , team (text) , draft_pick_number (number) , draft_class (text) , college (number) | player : player_id (text) , player (number) , years_played (text) , total_wl (text) , singles_wl (text) , doubles_wl (number) , team (text);
[Primary Keys]: country : country_id, team : team_id, match_season : season, player : player_id
[Foreign Keys]: match_season : team = team : team_id | match_season : country = country : country_id | player : team = team : team_id
match_season
SELECT College FROM match_season WHERE POSITION = "Midfielder" INTERSECT SELECT College FROM match_season WHERE POSITION = "Defender"
Return the colleges that have players who play the Midfielder position, as well as players who play the Defender position.
[Schema (values) (types)]: | match_season | country : country_id (text) , country_name (number) , capital (text) , official_native_language (text) | team : team_id (text) , name (number) | match_season : season (text) , player (number) , position (text) , country (text) , team (text) , draft_pick_number (number) , draft_class (text) , college (number) | player : player_id (text) , player (number) , years_played (text) , total_wl (text) , singles_wl (text) , doubles_wl (number) , team (text);
[Primary Keys]: country : country_id, team : team_id, match_season : season, player : player_id
[Foreign Keys]: match_season : team = team : team_id | match_season : country = country : country_id | player : team = team : team_id
climbing
SELECT count(*) FROM climber
How many climbers are there?
[Schema (values) (types)]: | climbing | mountain : mountain_id (text) , name (number) , height (text) , prominence (number) , range (number) , country (text) | climber : climber_id (text) , name (number) , country (text) , time (number) , points (number) , mountain_id (text);
[Primary Keys]: mountain : mountain_id, climber : climber_id
[Foreign Keys]: climber : mountain_id = mountain : mountain_id
climbing
SELECT count(*) FROM climber
Count the number of climbers.
[Schema (values) (types)]: | climbing | mountain : mountain_id (text) , name (number) , height (text) , prominence (number) , range (number) , country (text) | climber : climber_id (text) , name (number) , country (text) , time (number) , points (number) , mountain_id (text);
[Primary Keys]: mountain : mountain_id, climber : climber_id
[Foreign Keys]: climber : mountain_id = mountain : mountain_id
climbing
SELECT Name FROM climber ORDER BY Points DESC
List the names of climbers in descending order of points.
[Schema (values) (types)]: | climbing | mountain : mountain_id (text) , name (number) , height (text) , prominence (number) , range (number) , country (text) | climber : climber_id (text) , name (number) , country (text) , time (number) , points (number) , mountain_id (text);
[Primary Keys]: mountain : mountain_id, climber : climber_id
[Foreign Keys]: climber : mountain_id = mountain : mountain_id
climbing
SELECT Name FROM climber ORDER BY Points DESC
What are the names of the climbers, ordered by points descending?
[Schema (values) (types)]: | climbing | mountain : mountain_id (text) , name (number) , height (text) , prominence (number) , range (number) , country (text) | climber : climber_id (text) , name (number) , country (text) , time (number) , points (number) , mountain_id (text);
[Primary Keys]: mountain : mountain_id, climber : climber_id
[Foreign Keys]: climber : mountain_id = mountain : mountain_id
climbing
SELECT Name FROM climber WHERE Country != "Switzerland"
List the names of climbers whose country is not Switzerland.
[Schema (values) (types)]: | climbing | mountain : mountain_id (text) , name (number) , height (text) , prominence (number) , range (number) , country (text) | climber : climber_id (text) , name (number) , country (text) , time (number) , points (number) , mountain_id (text);
[Primary Keys]: mountain : mountain_id, climber : climber_id
[Foreign Keys]: climber : mountain_id = mountain : mountain_id
climbing
SELECT Name FROM climber WHERE Country != "Switzerland"
What are the names of climbers who are not from the country of Switzerland?
[Schema (values) (types)]: | climbing | mountain : mountain_id (text) , name (number) , height (text) , prominence (number) , range (number) , country (text) | climber : climber_id (text) , name (number) , country (text) , time (number) , points (number) , mountain_id (text);
[Primary Keys]: mountain : mountain_id, climber : climber_id
[Foreign Keys]: climber : mountain_id = mountain : mountain_id
climbing
SELECT max(Points) FROM climber WHERE Country = "United Kingdom"
What is the maximum point for climbers whose country is United Kingdom?
[Schema (values) (types)]: | climbing | mountain : mountain_id (text) , name (number) , height (text) , prominence (number) , range (number) , country (text) | climber : climber_id (text) , name (number) , country (text) , time (number) , points (number) , mountain_id (text);
[Primary Keys]: mountain : mountain_id, climber : climber_id
[Foreign Keys]: climber : mountain_id = mountain : mountain_id
climbing
SELECT max(Points) FROM climber WHERE Country = "United Kingdom"
Return the maximum number of points for climbers from the United Kingdom.
[Schema (values) (types)]: | climbing | mountain : mountain_id (text) , name (number) , height (text) , prominence (number) , range (number) , country (text) | climber : climber_id (text) , name (number) , country (text) , time (number) , points (number) , mountain_id (text);
[Primary Keys]: mountain : mountain_id, climber : climber_id
[Foreign Keys]: climber : mountain_id = mountain : mountain_id
climbing
SELECT COUNT(DISTINCT Country) FROM climber
How many distinct countries are the climbers from?
[Schema (values) (types)]: | climbing | mountain : mountain_id (text) , name (number) , height (text) , prominence (number) , range (number) , country (text) | climber : climber_id (text) , name (number) , country (text) , time (number) , points (number) , mountain_id (text);
[Primary Keys]: mountain : mountain_id, climber : climber_id
[Foreign Keys]: climber : mountain_id = mountain : mountain_id
climbing
SELECT COUNT(DISTINCT Country) FROM climber
Count the number of different countries that climbers are from.
[Schema (values) (types)]: | climbing | mountain : mountain_id (text) , name (number) , height (text) , prominence (number) , range (number) , country (text) | climber : climber_id (text) , name (number) , country (text) , time (number) , points (number) , mountain_id (text);
[Primary Keys]: mountain : mountain_id, climber : climber_id
[Foreign Keys]: climber : mountain_id = mountain : mountain_id
climbing
SELECT Name FROM mountain ORDER BY Name ASC
What are the names of mountains in ascending alphabetical order?
[Schema (values) (types)]: | climbing | mountain : mountain_id (text) , name (number) , height (text) , prominence (number) , range (number) , country (text) | climber : climber_id (text) , name (number) , country (text) , time (number) , points (number) , mountain_id (text);
[Primary Keys]: mountain : mountain_id, climber : climber_id
[Foreign Keys]: climber : mountain_id = mountain : mountain_id
climbing
SELECT Name FROM mountain ORDER BY Name ASC
Give the names of mountains in alphabetical order.
[Schema (values) (types)]: | climbing | mountain : mountain_id (text) , name (number) , height (text) , prominence (number) , range (number) , country (text) | climber : climber_id (text) , name (number) , country (text) , time (number) , points (number) , mountain_id (text);
[Primary Keys]: mountain : mountain_id, climber : climber_id
[Foreign Keys]: climber : mountain_id = mountain : mountain_id
climbing
SELECT Country FROM mountain WHERE Height > 5000
What are the countries of mountains with height bigger than 5000?
[Schema (values) (types)]: | climbing | mountain : mountain_id (text) , name (number) , height (text) , prominence (number) , range (number) , country (text) | climber : climber_id (text) , name (number) , country (text) , time (number) , points (number) , mountain_id (text);
[Primary Keys]: mountain : mountain_id, climber : climber_id
[Foreign Keys]: climber : mountain_id = mountain : mountain_id
climbing
SELECT Country FROM mountain WHERE Height > 5000
Return the countries of the mountains that have a height larger than 5000.
[Schema (values) (types)]: | climbing | mountain : mountain_id (text) , name (number) , height (text) , prominence (number) , range (number) , country (text) | climber : climber_id (text) , name (number) , country (text) , time (number) , points (number) , mountain_id (text);
[Primary Keys]: mountain : mountain_id, climber : climber_id
[Foreign Keys]: climber : mountain_id = mountain : mountain_id
climbing
SELECT Name FROM mountain ORDER BY Height DESC LIMIT 1
What is the name of the highest mountain?
[Schema (values) (types)]: | climbing | mountain : mountain_id (text) , name (number) , height (text) , prominence (number) , range (number) , country (text) | climber : climber_id (text) , name (number) , country (text) , time (number) , points (number) , mountain_id (text);
[Primary Keys]: mountain : mountain_id, climber : climber_id
[Foreign Keys]: climber : mountain_id = mountain : mountain_id
climbing
SELECT Name FROM mountain ORDER BY Height DESC LIMIT 1
Return the name of the mountain with the greatest height.
[Schema (values) (types)]: | climbing | mountain : mountain_id (text) , name (number) , height (text) , prominence (number) , range (number) , country (text) | climber : climber_id (text) , name (number) , country (text) , time (number) , points (number) , mountain_id (text);
[Primary Keys]: mountain : mountain_id, climber : climber_id
[Foreign Keys]: climber : mountain_id = mountain : mountain_id
climbing
SELECT DISTINCT Range FROM mountain ORDER BY Prominence DESC LIMIT 3
List the distinct ranges of the mountains with the top 3 prominence.
[Schema (values) (types)]: | climbing | mountain : mountain_id (text) , name (number) , height (text) , prominence (number) , range (number) , country (text) | climber : climber_id (text) , name (number) , country (text) , time (number) , points (number) , mountain_id (text);
[Primary Keys]: mountain : mountain_id, climber : climber_id
[Foreign Keys]: climber : mountain_id = mountain : mountain_id
climbing
SELECT DISTINCT Range FROM mountain ORDER BY Prominence DESC LIMIT 3
What are the different ranges of the 3 mountains with the highest prominence?
[Schema (values) (types)]: | climbing | mountain : mountain_id (text) , name (number) , height (text) , prominence (number) , range (number) , country (text) | climber : climber_id (text) , name (number) , country (text) , time (number) , points (number) , mountain_id (text);
[Primary Keys]: mountain : mountain_id, climber : climber_id
[Foreign Keys]: climber : mountain_id = mountain : mountain_id
climbing
SELECT T1.Name , T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID
Show names of climbers and the names of mountains they climb.
[Schema (values) (types)]: | climbing | mountain : mountain_id (text) , name (number) , height (text) , prominence (number) , range (number) , country (text) | climber : climber_id (text) , name (number) , country (text) , time (number) , points (number) , mountain_id (text);
[Primary Keys]: mountain : mountain_id, climber : climber_id
[Foreign Keys]: climber : mountain_id = mountain : mountain_id
climbing
SELECT T1.Name , T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID
What are the names of climbers and the corresponding names of mountains that they climb?
[Schema (values) (types)]: | climbing | mountain : mountain_id (text) , name (number) , height (text) , prominence (number) , range (number) , country (text) | climber : climber_id (text) , name (number) , country (text) , time (number) , points (number) , mountain_id (text);
[Primary Keys]: mountain : mountain_id, climber : climber_id
[Foreign Keys]: climber : mountain_id = mountain : mountain_id
climbing
SELECT T1.Name , T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID
Show the names of climbers and the heights of mountains they climb.
[Schema (values) (types)]: | climbing | mountain : mountain_id (text) , name (number) , height (text) , prominence (number) , range (number) , country (text) | climber : climber_id (text) , name (number) , country (text) , time (number) , points (number) , mountain_id (text);
[Primary Keys]: mountain : mountain_id, climber : climber_id
[Foreign Keys]: climber : mountain_id = mountain : mountain_id
climbing
SELECT T1.Name , T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID
What are the names of climbers and the corresponding heights of the mountains that they climb?
[Schema (values) (types)]: | climbing | mountain : mountain_id (text) , name (number) , height (text) , prominence (number) , range (number) , country (text) | climber : climber_id (text) , name (number) , country (text) , time (number) , points (number) , mountain_id (text);
[Primary Keys]: mountain : mountain_id, climber : climber_id
[Foreign Keys]: climber : mountain_id = mountain : mountain_id
climbing
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
Show the height of the mountain climbed by the climber with the maximum points.
[Schema (values) (types)]: | climbing | mountain : mountain_id (text) , name (number) , height (text) , prominence (number) , range (number) , country (text) | climber : climber_id (text) , name (number) , country (text) , time (number) , points (number) , mountain_id (text);
[Primary Keys]: mountain : mountain_id, climber : climber_id
[Foreign Keys]: climber : mountain_id = mountain : mountain_id
climbing
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
What is the height of the mountain climbined by the climbing who had the most points?
[Schema (values) (types)]: | climbing | mountain : mountain_id (text) , name (number) , height (text) , prominence (number) , range (number) , country (text) | climber : climber_id (text) , name (number) , country (text) , time (number) , points (number) , mountain_id (text);
[Primary Keys]: mountain : mountain_id, climber : climber_id
[Foreign Keys]: climber : mountain_id = mountain : mountain_id
climbing
SELECT DISTINCT T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T1.Country = "West Germany"
Show the distinct names of mountains climbed by climbers from country "West Germany".
[Schema (values) (types)]: | climbing | mountain : mountain_id (text) , name (number) , height (text) , prominence (number) , range (number) , country (text) | climber : climber_id (text) , name (number) , country (text) , time (number) , points (number) , mountain_id (text);
[Primary Keys]: mountain : mountain_id, climber : climber_id
[Foreign Keys]: climber : mountain_id = mountain : mountain_id
climbing
SELECT DISTINCT T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T1.Country = "West Germany"
What are the different names of mountains ascended by climbers from the country of West Germany?
[Schema (values) (types)]: | climbing | mountain : mountain_id (text) , name (number) , height (text) , prominence (number) , range (number) , country (text) | climber : climber_id (text) , name (number) , country (text) , time (number) , points (number) , mountain_id (text);
[Primary Keys]: mountain : mountain_id, climber : climber_id
[Foreign Keys]: climber : mountain_id = mountain : mountain_id
climbing
SELECT T1.Time FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T2.Country = "Uganda"
Show the times used by climbers to climb mountains in Country Uganda.
[Schema (values) (types)]: | climbing | mountain : mountain_id (text) , name (number) , height (text) , prominence (number) , range (number) , country (text) | climber : climber_id (text) , name (number) , country (text) , time (number) , points (number) , mountain_id (text);
[Primary Keys]: mountain : mountain_id, climber : climber_id
[Foreign Keys]: climber : mountain_id = mountain : mountain_id
climbing
SELECT T1.Time FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T2.Country = "Uganda"
What are the times used by climbers who climbed mountains in the country of Uganda?
[Schema (values) (types)]: | climbing | mountain : mountain_id (text) , name (number) , height (text) , prominence (number) , range (number) , country (text) | climber : climber_id (text) , name (number) , country (text) , time (number) , points (number) , mountain_id (text);
[Primary Keys]: mountain : mountain_id, climber : climber_id
[Foreign Keys]: climber : mountain_id = mountain : mountain_id
climbing
SELECT Country , COUNT(*) FROM climber GROUP BY Country
Please show the countries and the number of climbers from each country.
[Schema (values) (types)]: | climbing | mountain : mountain_id (text) , name (number) , height (text) , prominence (number) , range (number) , country (text) | climber : climber_id (text) , name (number) , country (text) , time (number) , points (number) , mountain_id (text);
[Primary Keys]: mountain : mountain_id, climber : climber_id
[Foreign Keys]: climber : mountain_id = mountain : mountain_id
climbing
SELECT Country , COUNT(*) FROM climber GROUP BY Country
How many climbers are from each country?
[Schema (values) (types)]: | climbing | mountain : mountain_id (text) , name (number) , height (text) , prominence (number) , range (number) , country (text) | climber : climber_id (text) , name (number) , country (text) , time (number) , points (number) , mountain_id (text);
[Primary Keys]: mountain : mountain_id, climber : climber_id
[Foreign Keys]: climber : mountain_id = mountain : mountain_id
climbing
SELECT Country FROM mountain GROUP BY Country HAVING COUNT(*) > 1
List the countries that have more than one mountain.
[Schema (values) (types)]: | climbing | mountain : mountain_id (text) , name (number) , height (text) , prominence (number) , range (number) , country (text) | climber : climber_id (text) , name (number) , country (text) , time (number) , points (number) , mountain_id (text);
[Primary Keys]: mountain : mountain_id, climber : climber_id
[Foreign Keys]: climber : mountain_id = mountain : mountain_id
climbing
SELECT Country FROM mountain GROUP BY Country HAVING COUNT(*) > 1
Which countries have more than one mountain?
[Schema (values) (types)]: | climbing | mountain : mountain_id (text) , name (number) , height (text) , prominence (number) , range (number) , country (text) | climber : climber_id (text) , name (number) , country (text) , time (number) , points (number) , mountain_id (text);
[Primary Keys]: mountain : mountain_id, climber : climber_id
[Foreign Keys]: climber : mountain_id = mountain : mountain_id
climbing
SELECT Name FROM mountain WHERE Mountain_ID NOT IN (SELECT Mountain_ID FROM climber)
List the names of mountains that do not have any climber.
[Schema (values) (types)]: | climbing | mountain : mountain_id (text) , name (number) , height (text) , prominence (number) , range (number) , country (text) | climber : climber_id (text) , name (number) , country (text) , time (number) , points (number) , mountain_id (text);
[Primary Keys]: mountain : mountain_id, climber : climber_id
[Foreign Keys]: climber : mountain_id = mountain : mountain_id
climbing
SELECT Name FROM mountain WHERE Mountain_ID NOT IN (SELECT Mountain_ID FROM climber)
What are the names of countains that no climber has climbed?
[Schema (values) (types)]: | climbing | mountain : mountain_id (text) , name (number) , height (text) , prominence (number) , range (number) , country (text) | climber : climber_id (text) , name (number) , country (text) , time (number) , points (number) , mountain_id (text);
[Primary Keys]: mountain : mountain_id, climber : climber_id
[Foreign Keys]: climber : mountain_id = mountain : mountain_id
climbing
SELECT Country FROM mountain WHERE Height > 5600 INTERSECT SELECT Country FROM mountain WHERE Height < 5200
Show the countries that have mountains with height more than 5600 stories and mountains with height less than 5200.
[Schema (values) (types)]: | climbing | mountain : mountain_id (text) , name (number) , height (text) , prominence (number) , range (number) , country (text) | climber : climber_id (text) , name (number) , country (text) , time (number) , points (number) , mountain_id (text);
[Primary Keys]: mountain : mountain_id, climber : climber_id
[Foreign Keys]: climber : mountain_id = mountain : mountain_id
climbing
SELECT Country FROM mountain WHERE Height > 5600 INTERSECT SELECT Country FROM mountain WHERE Height < 5200
What are the countries that have both mountains that are higher than 5600 and lower than 5200?
[Schema (values) (types)]: | climbing | mountain : mountain_id (text) , name (number) , height (text) , prominence (number) , range (number) , country (text) | climber : climber_id (text) , name (number) , country (text) , time (number) , points (number) , mountain_id (text);
[Primary Keys]: mountain : mountain_id, climber : climber_id
[Foreign Keys]: climber : mountain_id = mountain : mountain_id
climbing
SELECT Range FROM mountain GROUP BY Range ORDER BY COUNT(*) DESC LIMIT 1
Show the range that has the most number of mountains.
[Schema (values) (types)]: | climbing | mountain : mountain_id (text) , name (number) , height (text) , prominence (number) , range (number) , country (text) | climber : climber_id (text) , name (number) , country (text) , time (number) , points (number) , mountain_id (text);
[Primary Keys]: mountain : mountain_id, climber : climber_id
[Foreign Keys]: climber : mountain_id = mountain : mountain_id
climbing
SELECT Range FROM mountain GROUP BY Range ORDER BY COUNT(*) DESC LIMIT 1
Which range contains the most mountains?
[Schema (values) (types)]: | climbing | mountain : mountain_id (text) , name (number) , height (text) , prominence (number) , range (number) , country (text) | climber : climber_id (text) , name (number) , country (text) , time (number) , points (number) , mountain_id (text);
[Primary Keys]: mountain : mountain_id, climber : climber_id
[Foreign Keys]: climber : mountain_id = mountain : mountain_id
climbing
SELECT Name FROM mountain WHERE Height > 5000 OR Prominence > 1000
Show the names of mountains with height more than 5000 or prominence more than 1000.
[Schema (values) (types)]: | climbing | mountain : mountain_id (text) , name (number) , height (text) , prominence (number) , range (number) , country (text) | climber : climber_id (text) , name (number) , country (text) , time (number) , points (number) , mountain_id (text);
[Primary Keys]: mountain : mountain_id, climber : climber_id
[Foreign Keys]: climber : mountain_id = mountain : mountain_id
climbing
SELECT Name FROM mountain WHERE Height > 5000 OR Prominence > 1000
What are the names of mountains that have a height of over 5000 or a prominence of over 1000?
[Schema (values) (types)]: | climbing | mountain : mountain_id (text) , name (number) , height (text) , prominence (number) , range (number) , country (text) | climber : climber_id (text) , name (number) , country (text) , time (number) , points (number) , mountain_id (text);
[Primary Keys]: mountain : mountain_id, climber : climber_id
[Foreign Keys]: climber : mountain_id = mountain : mountain_id
body_builder
SELECT count(*) FROM body_builder
How many body builders are there?
[Schema (values) (types)]: | body_builder | body_builder : body_builder_id (text) , people_id (number) , snatch (number) , clean_jerk (number) , total (number) | people : people_id (text) , name (number) , height (number) , weight (number) , birth_date (number) , birth_place (number);
[Primary Keys]: body_builder : body_builder_id, people : people_id
[Foreign Keys]: body_builder : people_id = people : people_id
body_builder
SELECT Total FROM body_builder ORDER BY Total ASC
List the total scores of body builders in ascending order.
[Schema (values) (types)]: | body_builder | body_builder : body_builder_id (text) , people_id (number) , snatch (number) , clean_jerk (number) , total (number) | people : people_id (text) , name (number) , height (number) , weight (number) , birth_date (number) , birth_place (number);
[Primary Keys]: body_builder : body_builder_id, people : people_id
[Foreign Keys]: body_builder : people_id = people : people_id
body_builder
SELECT Snatch , Clean_Jerk FROM body_builder ORDER BY Snatch ASC
List the snatch score and clean jerk score of body builders in ascending order of snatch score.
[Schema (values) (types)]: | body_builder | body_builder : body_builder_id (text) , people_id (number) , snatch (number) , clean_jerk (number) , total (number) | people : people_id (text) , name (number) , height (number) , weight (number) , birth_date (number) , birth_place (number);
[Primary Keys]: body_builder : body_builder_id, people : people_id
[Foreign Keys]: body_builder : people_id = people : people_id
body_builder
SELECT avg(Snatch) FROM body_builder
What is the average snatch score of body builders?
[Schema (values) (types)]: | body_builder | body_builder : body_builder_id (text) , people_id (number) , snatch (number) , clean_jerk (number) , total (number) | people : people_id (text) , name (number) , height (number) , weight (number) , birth_date (number) , birth_place (number);
[Primary Keys]: body_builder : body_builder_id, people : people_id
[Foreign Keys]: body_builder : people_id = people : people_id
body_builder
SELECT Clean_Jerk FROM body_builder ORDER BY Total DESC LIMIT 1
What are the clean and jerk score of the body builder with the highest total score?
[Schema (values) (types)]: | body_builder | body_builder : body_builder_id (text) , people_id (number) , snatch (number) , clean_jerk (number) , total (number) | people : people_id (text) , name (number) , height (number) , weight (number) , birth_date (number) , birth_place (number);
[Primary Keys]: body_builder : body_builder_id, people : people_id
[Foreign Keys]: body_builder : people_id = people : people_id
body_builder
SELECT Birth_Date FROM People ORDER BY Height ASC
What are the birthdays of people in ascending order of height?
[Schema (values) (types)]: | body_builder | body_builder : body_builder_id (text) , people_id (number) , snatch (number) , clean_jerk (number) , total (number) | people : people_id (text) , name (number) , height (number) , weight (number) , birth_date (number) , birth_place (number);
[Primary Keys]: body_builder : body_builder_id, people : people_id
[Foreign Keys]: body_builder : people_id = people : people_id
body_builder
SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID
What are the names of body builders?
[Schema (values) (types)]: | body_builder | body_builder : body_builder_id (text) , people_id (number) , snatch (number) , clean_jerk (number) , total (number) | people : people_id (text) , name (number) , height (number) , weight (number) , birth_date (number) , birth_place (number);
[Primary Keys]: body_builder : body_builder_id, people : people_id
[Foreign Keys]: body_builder : people_id = people : people_id
body_builder
SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Total > 300
What are the names of body builders whose total score is higher than 300?
[Schema (values) (types)]: | body_builder | body_builder : body_builder_id (text) , people_id (number) , snatch (number) , clean_jerk (number) , total (number) | people : people_id (text) , name (number) , height (number) , weight (number) , birth_date (number) , birth_place (number);
[Primary Keys]: body_builder : body_builder_id, people : people_id
[Foreign Keys]: body_builder : people_id = people : people_id
body_builder
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
What is the name of the body builder with the greatest body weight?
[Schema (values) (types)]: | body_builder | body_builder : body_builder_id (text) , people_id (number) , snatch (number) , clean_jerk (number) , total (number) | people : people_id (text) , name (number) , height (number) , weight (number) , birth_date (number) , birth_place (number);
[Primary Keys]: body_builder : body_builder_id, people : people_id
[Foreign Keys]: body_builder : people_id = people : people_id
body_builder
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
What are the birth date and birth place of the body builder with the highest total points?
[Schema (values) (types)]: | body_builder | body_builder : body_builder_id (text) , people_id (number) , snatch (number) , clean_jerk (number) , total (number) | people : people_id (text) , name (number) , height (number) , weight (number) , birth_date (number) , birth_place (number);
[Primary Keys]: body_builder : body_builder_id, people : people_id
[Foreign Keys]: body_builder : people_id = people : people_id
body_builder
SELECT T2.Height FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Total < 315
What are the heights of body builders with total score smaller than 315?
[Schema (values) (types)]: | body_builder | body_builder : body_builder_id (text) , people_id (number) , snatch (number) , clean_jerk (number) , total (number) | people : people_id (text) , name (number) , height (number) , weight (number) , birth_date (number) , birth_place (number);
[Primary Keys]: body_builder : body_builder_id, people : people_id
[Foreign Keys]: body_builder : people_id = people : people_id
body_builder
SELECT avg(T1.Total) FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Height > 200
What is the average total score of body builders with height bigger than 200?
[Schema (values) (types)]: | body_builder | body_builder : body_builder_id (text) , people_id (number) , snatch (number) , clean_jerk (number) , total (number) | people : people_id (text) , name (number) , height (number) , weight (number) , birth_date (number) , birth_place (number);
[Primary Keys]: body_builder : body_builder_id, people : people_id
[Foreign Keys]: body_builder : people_id = people : people_id
body_builder
SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Total DESC
What are the names of body builders in descending order of total scores?
[Schema (values) (types)]: | body_builder | body_builder : body_builder_id (text) , people_id (number) , snatch (number) , clean_jerk (number) , total (number) | people : people_id (text) , name (number) , height (number) , weight (number) , birth_date (number) , birth_place (number);
[Primary Keys]: body_builder : body_builder_id, people : people_id
[Foreign Keys]: body_builder : people_id = people : people_id
body_builder
SELECT Birth_Place , COUNT(*) FROM people GROUP BY Birth_Place
List each birth place along with the number of people from there.
[Schema (values) (types)]: | body_builder | body_builder : body_builder_id (text) , people_id (number) , snatch (number) , clean_jerk (number) , total (number) | people : people_id (text) , name (number) , height (number) , weight (number) , birth_date (number) , birth_place (number);
[Primary Keys]: body_builder : body_builder_id, people : people_id
[Foreign Keys]: body_builder : people_id = people : people_id
body_builder
SELECT Birth_Place FROM people GROUP BY Birth_Place ORDER BY COUNT(*) DESC LIMIT 1
What is the most common birth place of people?
[Schema (values) (types)]: | body_builder | body_builder : body_builder_id (text) , people_id (number) , snatch (number) , clean_jerk (number) , total (number) | people : people_id (text) , name (number) , height (number) , weight (number) , birth_date (number) , birth_place (number);
[Primary Keys]: body_builder : body_builder_id, people : people_id
[Foreign Keys]: body_builder : people_id = people : people_id
body_builder
SELECT Birth_Place FROM people GROUP BY Birth_Place HAVING COUNT(*) >= 2
What are the birth places that are shared by at least two people?
[Schema (values) (types)]: | body_builder | body_builder : body_builder_id (text) , people_id (number) , snatch (number) , clean_jerk (number) , total (number) | people : people_id (text) , name (number) , height (number) , weight (number) , birth_date (number) , birth_place (number);
[Primary Keys]: body_builder : body_builder_id, people : people_id
[Foreign Keys]: body_builder : people_id = people : people_id
body_builder
SELECT Height , Weight FROM people ORDER BY Height DESC
List the height and weight of people in descending order of height.
[Schema (values) (types)]: | body_builder | body_builder : body_builder_id (text) , people_id (number) , snatch (number) , clean_jerk (number) , total (number) | people : people_id (text) , name (number) , height (number) , weight (number) , birth_date (number) , birth_place (number);
[Primary Keys]: body_builder : body_builder_id, people : people_id
[Foreign Keys]: body_builder : people_id = people : people_id
body_builder
SELECT * FROM body_builder
Show all information about each body builder.
[Schema (values) (types)]: | body_builder | body_builder : body_builder_id (text) , people_id (number) , snatch (number) , clean_jerk (number) , total (number) | people : people_id (text) , name (number) , height (number) , weight (number) , birth_date (number) , birth_place (number);
[Primary Keys]: body_builder : body_builder_id, people : people_id
[Foreign Keys]: body_builder : people_id = people : people_id
body_builder
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
List the names and origins of people who are not body builders.
[Schema (values) (types)]: | body_builder | body_builder : body_builder_id (text) , people_id (number) , snatch (number) , clean_jerk (number) , total (number) | people : people_id (text) , name (number) , height (number) , weight (number) , birth_date (number) , birth_place (number);
[Primary Keys]: body_builder : body_builder_id, people : people_id
[Foreign Keys]: body_builder : people_id = people : people_id
body_builder
SELECT count(DISTINCT Birth_Place) FROM people
How many distinct birth places are there?
[Schema (values) (types)]: | body_builder | body_builder : body_builder_id (text) , people_id (number) , snatch (number) , clean_jerk (number) , total (number) | people : people_id (text) , name (number) , height (number) , weight (number) , birth_date (number) , birth_place (number);
[Primary Keys]: body_builder : body_builder_id, people : people_id
[Foreign Keys]: body_builder : people_id = people : people_id
body_builder
SELECT count(*) FROM people WHERE people_id NOT IN (SELECT People_ID FROM body_builder)
How many persons are not body builders?
[Schema (values) (types)]: | body_builder | body_builder : body_builder_id (text) , people_id (number) , snatch (number) , clean_jerk (number) , total (number) | people : people_id (text) , name (number) , height (number) , weight (number) , birth_date (number) , birth_place (number);
[Primary Keys]: body_builder : body_builder_id, people : people_id
[Foreign Keys]: body_builder : people_id = people : people_id
body_builder
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;
List the weight of the body builders who have snatch score higher than 140 or have the height greater than 200.
[Schema (values) (types)]: | body_builder | body_builder : body_builder_id (text) , people_id (number) , snatch (number) , clean_jerk (number) , total (number) | people : people_id (text) , name (number) , height (number) , weight (number) , birth_date (number) , birth_place (number);
[Primary Keys]: body_builder : body_builder_id, people : people_id
[Foreign Keys]: body_builder : people_id = people : people_id
body_builder
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%";
What are the total scores of the body builders whose birthday contains the string "January" ?
[Schema (values) (types)]: | body_builder | body_builder : body_builder_id (text) , people_id (number) , snatch (number) , clean_jerk (number) , total (number) | people : people_id (text) , name (number) , height (number) , weight (number) , birth_date (number) , birth_place (number);
[Primary Keys]: body_builder : body_builder_id, people : people_id
[Foreign Keys]: body_builder : people_id = people : people_id
body_builder
SELECT min(snatch) FROM body_builder
What is the minimum snatch score?
[Schema (values) (types)]: | body_builder | body_builder : body_builder_id (text) , people_id (number) , snatch (number) , clean_jerk (number) , total (number) | people : people_id (text) , name (number) , height (number) , weight (number) , birth_date (number) , birth_place (number);
[Primary Keys]: body_builder : body_builder_id, people : people_id
[Foreign Keys]: body_builder : people_id = people : people_id
election_representative
SELECT count(*) FROM election
How many elections are there?
[Schema (values) (types)]: | election_representative | election : election_id (text) , representative_id (number) , date (number) , votes (text) , vote_percent (number) , seats (number) , place (number) | representative : representative_id (text) , name (number) , state (number) , party (text) , lifespan (number);
[Primary Keys]: election : election_id, representative : representative_id
[Foreign Keys]: election : representative_id = representative : representative_id
election_representative
SELECT Votes FROM election ORDER BY Votes DESC
List the votes of elections in descending order.
[Schema (values) (types)]: | election_representative | election : election_id (text) , representative_id (number) , date (number) , votes (text) , vote_percent (number) , seats (number) , place (number) | representative : representative_id (text) , name (number) , state (number) , party (text) , lifespan (number);
[Primary Keys]: election : election_id, representative : representative_id
[Foreign Keys]: election : representative_id = representative : representative_id
election_representative
SELECT Date , Vote_Percent FROM election
List the dates and vote percents of elections.
[Schema (values) (types)]: | election_representative | election : election_id (text) , representative_id (number) , date (number) , votes (text) , vote_percent (number) , seats (number) , place (number) | representative : representative_id (text) , name (number) , state (number) , party (text) , lifespan (number);
[Primary Keys]: election : election_id, representative : representative_id
[Foreign Keys]: election : representative_id = representative : representative_id
election_representative
SELECT min(Vote_Percent) , max(Vote_Percent) FROM election
What are the minimum and maximum vote percents of elections?
[Schema (values) (types)]: | election_representative | election : election_id (text) , representative_id (number) , date (number) , votes (text) , vote_percent (number) , seats (number) , place (number) | representative : representative_id (text) , name (number) , state (number) , party (text) , lifespan (number);
[Primary Keys]: election : election_id, representative : representative_id
[Foreign Keys]: election : representative_id = representative : representative_id
election_representative
SELECT Name , Party FROM representative
What are the names and parties of representatives?
[Schema (values) (types)]: | election_representative | election : election_id (text) , representative_id (number) , date (number) , votes (text) , vote_percent (number) , seats (number) , place (number) | representative : representative_id (text) , name (number) , state (number) , party (text) , lifespan (number);
[Primary Keys]: election : election_id, representative : representative_id
[Foreign Keys]: election : representative_id = representative : representative_id
election_representative
SELECT Name FROM Representative WHERE Party != "Republican"
What are the names of representatives whose party is not "Republican"?
[Schema (values) (types)]: | election_representative | election : election_id (text) , representative_id (number) , date (number) , votes (text) , vote_percent (number) , seats (number) , place (number) | representative : representative_id (text) , name (number) , state (number) , party (text) , lifespan (number);
[Primary Keys]: election : election_id, representative : representative_id
[Foreign Keys]: election : representative_id = representative : representative_id
election_representative
SELECT Lifespan FROM representative WHERE State = "New York" OR State = "Indiana"
What are the life spans of representatives from New York state or Indiana state?
[Schema (values) (types)]: | election_representative | election : election_id (text) , representative_id (number) , date (number) , votes (text) , vote_percent (number) , seats (number) , place (number) | representative : representative_id (text) , name (number) , state (number) , party (text) , lifespan (number);
[Primary Keys]: election : election_id, representative : representative_id
[Foreign Keys]: election : representative_id = representative : representative_id
election_representative
SELECT T2.Name , T1.Date FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID
What are the names of representatives and the dates of elections they participated in.
[Schema (values) (types)]: | election_representative | election : election_id (text) , representative_id (number) , date (number) , votes (text) , vote_percent (number) , seats (number) , place (number) | representative : representative_id (text) , name (number) , state (number) , party (text) , lifespan (number);
[Primary Keys]: election : election_id, representative : representative_id
[Foreign Keys]: election : representative_id = representative : representative_id
election_representative
SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID WHERE Votes > 10000
What are the names of representatives with more than 10000 votes in election?
[Schema (values) (types)]: | election_representative | election : election_id (text) , representative_id (number) , date (number) , votes (text) , vote_percent (number) , seats (number) , place (number) | representative : representative_id (text) , name (number) , state (number) , party (text) , lifespan (number);
[Primary Keys]: election : election_id, representative : representative_id
[Foreign Keys]: election : representative_id = representative : representative_id
election_representative
SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY votes DESC
What are the names of representatives in descending order of votes?
[Schema (values) (types)]: | election_representative | election : election_id (text) , representative_id (number) , date (number) , votes (text) , vote_percent (number) , seats (number) , place (number) | representative : representative_id (text) , name (number) , state (number) , party (text) , lifespan (number);
[Primary Keys]: election : election_id, representative : representative_id
[Foreign Keys]: election : representative_id = representative : representative_id
election_representative
SELECT T2.Party FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY votes ASC LIMIT 1
What is the party of the representative that has the smallest number of votes.
[Schema (values) (types)]: | election_representative | election : election_id (text) , representative_id (number) , date (number) , votes (text) , vote_percent (number) , seats (number) , place (number) | representative : representative_id (text) , name (number) , state (number) , party (text) , lifespan (number);
[Primary Keys]: election : election_id, representative : representative_id
[Foreign Keys]: election : representative_id = representative : representative_id
election_representative
SELECT T2.Lifespan FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY Vote_Percent DESC
What are the lifespans of representatives in descending order of vote percent?
[Schema (values) (types)]: | election_representative | election : election_id (text) , representative_id (number) , date (number) , votes (text) , vote_percent (number) , seats (number) , place (number) | representative : representative_id (text) , name (number) , state (number) , party (text) , lifespan (number);
[Primary Keys]: election : election_id, representative : representative_id
[Foreign Keys]: election : representative_id = representative : representative_id
election_representative
SELECT avg(T1.Votes) FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID WHERE T2.Party = "Republican"
What is the average number of votes of representatives from party "Republican"?
[Schema (values) (types)]: | election_representative | election : election_id (text) , representative_id (number) , date (number) , votes (text) , vote_percent (number) , seats (number) , place (number) | representative : representative_id (text) , name (number) , state (number) , party (text) , lifespan (number);
[Primary Keys]: election : election_id, representative : representative_id
[Foreign Keys]: election : representative_id = representative : representative_id
election_representative
SELECT Party , COUNT(*) FROM representative GROUP BY Party
What are the different parties of representative? Show the party name and the number of representatives in each party.
[Schema (values) (types)]: | election_representative | election : election_id (text) , representative_id (number) , date (number) , votes (text) , vote_percent (number) , seats (number) , place (number) | representative : representative_id (text) , name (number) , state (number) , party (text) , lifespan (number);
[Primary Keys]: election : election_id, representative : representative_id
[Foreign Keys]: election : representative_id = representative : representative_id
election_representative
SELECT Party , COUNT(*) FROM representative GROUP BY Party ORDER BY COUNT(*) DESC LIMIT 1
What is the party that has the largest number of representatives?
[Schema (values) (types)]: | election_representative | election : election_id (text) , representative_id (number) , date (number) , votes (text) , vote_percent (number) , seats (number) , place (number) | representative : representative_id (text) , name (number) , state (number) , party (text) , lifespan (number);
[Primary Keys]: election : election_id, representative : representative_id
[Foreign Keys]: election : representative_id = representative : representative_id
election_representative
SELECT Party FROM representative GROUP BY Party HAVING COUNT(*) >= 3
What parties have at least three representatives?
[Schema (values) (types)]: | election_representative | election : election_id (text) , representative_id (number) , date (number) , votes (text) , vote_percent (number) , seats (number) , place (number) | representative : representative_id (text) , name (number) , state (number) , party (text) , lifespan (number);
[Primary Keys]: election : election_id, representative : representative_id
[Foreign Keys]: election : representative_id = representative : representative_id
election_representative
SELECT State FROM representative GROUP BY State HAVING COUNT(*) >= 2
What states have at least two representatives?
[Schema (values) (types)]: | election_representative | election : election_id (text) , representative_id (number) , date (number) , votes (text) , vote_percent (number) , seats (number) , place (number) | representative : representative_id (text) , name (number) , state (number) , party (text) , lifespan (number);
[Primary Keys]: election : election_id, representative : representative_id
[Foreign Keys]: election : representative_id = representative : representative_id
election_representative
SELECT Name FROM representative WHERE Representative_ID NOT IN (SELECT Representative_ID FROM election)
List the names of representatives that have not participated in elections listed here.
[Schema (values) (types)]: | election_representative | election : election_id (text) , representative_id (number) , date (number) , votes (text) , vote_percent (number) , seats (number) , place (number) | representative : representative_id (text) , name (number) , state (number) , party (text) , lifespan (number);
[Primary Keys]: election : election_id, representative : representative_id
[Foreign Keys]: election : representative_id = representative : representative_id
election_representative
SELECT Party FROM representative WHERE State = "New York" INTERSECT SELECT Party FROM representative WHERE State = "Pennsylvania"
Show the parties that have both representatives in New York state and representatives in Pennsylvania state.
[Schema (values) (types)]: | election_representative | election : election_id (text) , representative_id (number) , date (number) , votes (text) , vote_percent (number) , seats (number) , place (number) | representative : representative_id (text) , name (number) , state (number) , party (text) , lifespan (number);
[Primary Keys]: election : election_id, representative : representative_id
[Foreign Keys]: election : representative_id = representative : representative_id
election_representative
SELECT count(DISTINCT Party) FROM representative
How many distinct parties are there for representatives?
[Schema (values) (types)]: | election_representative | election : election_id (text) , representative_id (number) , date (number) , votes (text) , vote_percent (number) , seats (number) , place (number) | representative : representative_id (text) , name (number) , state (number) , party (text) , lifespan (number);
[Primary Keys]: election : election_id, representative : representative_id
[Foreign Keys]: election : representative_id = representative : representative_id
apartment_rentals
SELECT count(*) FROM Apartment_Bookings
How many apartment bookings are there in total?
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
apartment_rentals
SELECT count(*) FROM Apartment_Bookings
Count the total number of apartment bookings.
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
apartment_rentals
SELECT booking_start_date , booking_end_date FROM Apartment_Bookings
Show the start dates and end dates of all the apartment bookings.
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
apartment_rentals
SELECT booking_start_date , booking_end_date FROM Apartment_Bookings
What are the start date and end date of each apartment booking?
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
apartment_rentals
SELECT DISTINCT building_description FROM Apartment_Buildings
Show all distinct building descriptions.
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id
apartment_rentals
SELECT DISTINCT building_description FROM Apartment_Buildings
Give me a list of all the distinct building descriptions.
[Schema (values) (types)]: | apartment_rentals | Apartment_Buildings : building_id (text) , building_short_name (number) , building_full_name (text) , building_description (text) , building_address (text) , building_manager (text) , building_phone (text) | Apartments : apt_id (text) , building_id (number) , apt_type_code (text) , apt_number (text) , bathroom_count (text) , bedroom_count (text) , room_count (text) | Apartment_Facilities : apt_id (text) , facility_code (number) | Guests : guest_id (text) , gender_code (number) , guest_first_name (text) , guest_last_name (text) , date_of_birth (text) | Apartment_Bookings : apt_booking_id (text) , apt_id (number) , guest_id (text) , booking_status_code (text) , booking_start_date (text) , booking_end_date (text) | View_Unit_Status : apt_id (text) , apt_booking_id (number) , status_date (text) , available_yn (text);
[Primary Keys]: apartment_buildings : building_id, apartments : apt_id, apartment_facilities : apt_id, guests : guest_id, apartment_bookings : apt_booking_id, view_unit_status : status_date
[Foreign Keys]: apartments : building_id = apartment_buildings : building_id | apartment_facilities : apt_id = apartments : apt_id | apartment_bookings : guest_id = guests : guest_id | apartment_bookings : apt_id = apartments : apt_id | view_unit_status : apt_booking_id = apartment_bookings : apt_booking_id | view_unit_status : apt_id = apartments : apt_id