db_id stringlengths 4 31 | SQL stringlengths 18 1.45k | input_sequence stringlengths 148 11k | question stringlengths 16 325 |
|---|---|---|---|
match_season | select college from match_season group by college having count(*) >= 2 | Question: show the name of colleges that have at least two players. | Tables: 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_... | show the name of colleges that have at least two players. |
match_season | select college from match_season group by college having count(*) >= 2 | Question: what are the names of all colleges that have two or more players? | Tables: 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... | what are the names of all colleges that have two or more players? |
match_season | select college from match_season group by college having count(*) >= 2 order by college desc | Question: show the name of colleges that have at least two players in descending alphabetical order. | Tables: 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... | show the name of colleges that have at least two players in descending alphabetical order. |
match_season | select college from match_season group by college having count(*) >= 2 order by college desc | Question: what are the names of colleges that have two or more players, listed in descending alphabetical order? | Tables: 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. play... | what are the names of colleges that have two or more players, listed in descending alphabetical order? |
match_season | select name from team where team_id not in (select team from match_season) | Question: what are the names of teams that do no have match season record? | Tables: 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,... | what are the names of teams that do no have match season record? |
match_season | select name from team where team_id not in (select team from match_season) | Question: return the names of teams that have no match season record. | Tables: 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, Tota... | return the names of teams that have no match season record. |
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' | Question: what are the names of countries that have both players with position forward and players with position defender? | Tables: 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, Col... | what are the names of countries that have both players with position forward and players with position defender? |
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' | Question: return the names of countries that have players that play the forward position, as well as players who play the defender position. | Tables: country -> Country_id, Country_name, Capital, Official_native_language. team -> Team_id, Name. match_season -> Season, Player, Position, Country, Team, Draft_Pick_Number... | return the names of countries that have players that play the forward position, as well as players who play the defender position. |
match_season | select college from match_season where position = 'midfielder' intersect select college from match_season where position = 'defender' | Question: which college have both players with position midfielder and players with position defender? | Tables: 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 -> Play... | which college have both players with position midfielder and players with position defender? |
match_season | select college from match_season where position = 'midfielder' intersect select college from match_season where position = 'defender' | Question: return the colleges that have players who play the midfielder position, as well as players who play the defender position. | Tables: country -> Country_id, Country_name, Capital, Official_native_language. team -> Team_id, Name. match_season -> Season, Player, Position, Country, Team, Draft_Pick_Number, Draft_... | return the colleges that have players who play the midfielder position, as well as players who play the defender position. |
climbing | select count(*) from climber | Question: how many climbers are there? | Tables: mountain -> Mountain_ID, Name, Height, Prominence, Range, Country. climber -> Climber_ID, Name, Country, Time, Points, Mountain_ID. | Joins: climber.Mountain_ID = mountain.Mountain_ID, | how many climbers are there? |
climbing | select count(*) from climber | Question: count the number of climbers. | Tables: mountain -> Mountain_ID, Name, Height, Prominence, Range, Country. climber -> Climber_ID, Name, Country, Time, Points, Mountain_ID. | Joins: climber.Mountain_ID = mountain.Mountain_ID, | count the number of climbers. |
climbing | select name from climber order by points desc | Question: list the names of climbers in descending order of points. | Tables: mountain -> Mountain_ID, Name, Height, Prominence, Range, Country. climber -> Climber_ID, Name, Country, Time, Points, Mountain_ID. | Joins: climber.Mountain_ID = mountain.Mountain_ID, | list the names of climbers in descending order of points. |
climbing | select name from climber order by points desc | Question: what are the names of the climbers, ordered by points descending? | Tables: mountain -> Mountain_ID, Name, Height, Prominence, Range, Country. climber -> Climber_ID, Name, Country, Time, Points, Mountain_ID. | Joins: climber.Mountain_ID = mountain.Mountain_ID, | what are the names of the climbers, ordered by points descending? |
climbing | select name from climber where country != 'switzerland' | Question: list the names of climbers whose country is not switzerland. | Tables: mountain -> Mountain_ID, Name, Height, Prominence, Range, Country. climber -> Climber_ID, Name, Country, Time, Points, Mountain_ID. | Joins: climber.Mountain_ID = mountain.Mountain_ID, | list the names of climbers whose country is not switzerland. |
climbing | select name from climber where country != 'switzerland' | Question: what are the names of climbers who are not from the country of switzerland? | Tables: mountain -> Mountain_ID, Name, Height, Prominence, Range, Country. climber -> Climber_ID, Name, Country, Time, Points, Mountain_ID. | Joins: climber.Mountain_ID = mountain.Mountain_ID, | what are the names of climbers who are not from the country of switzerland? |
climbing | select max(points) from climber where country = 'united kingdom' | Question: what is the maximum point for climbers whose country is united kingdom? | Tables: mountain -> Mountain_ID, Name, Height, Prominence, Range, Country. climber -> Climber_ID, Name, Country, Time, Points, Mountain_ID. | Joins: climber.Mountain_ID = mountain.Mountain_ID, | what is the maximum point for climbers whose country is united kingdom? |
climbing | select max(points) from climber where country = 'united kingdom' | Question: return the maximum number of points for climbers from the united kingdom. | Tables: mountain -> Mountain_ID, Name, Height, Prominence, Range, Country. climber -> Climber_ID, Name, Country, Time, Points, Mountain_ID. | Joins: climber.Mountain_ID = mountain.Mountain_ID, | return the maximum number of points for climbers from the united kingdom. |
climbing | select count(distinct country) from climber | Question: how many distinct countries are the climbers from? | Tables: mountain -> Mountain_ID, Name, Height, Prominence, Range, Country. climber -> Climber_ID, Name, Country, Time, Points, Mountain_ID. | Joins: climber.Mountain_ID = mountain.Mountain_ID, | how many distinct countries are the climbers from? |
climbing | select count(distinct country) from climber | Question: count the number of different countries that climbers are from. | Tables: mountain -> Mountain_ID, Name, Height, Prominence, Range, Country. climber -> Climber_ID, Name, Country, Time, Points, Mountain_ID. | Joins: climber.Mountain_ID = mountain.Mountain_ID, | count the number of different countries that climbers are from. |
climbing | select name from mountain order by name asc | Question: what are the names of mountains in ascending alphabetical order? | Tables: mountain -> Mountain_ID, Name, Height, Prominence, Range, Country. climber -> Climber_ID, Name, Country, Time, Points, Mountain_ID. | Joins: climber.Mountain_ID = mountain.Mountain_ID, | what are the names of mountains in ascending alphabetical order? |
climbing | select name from mountain order by name asc | Question: give the names of mountains in alphabetical order. | Tables: mountain -> Mountain_ID, Name, Height, Prominence, Range, Country. climber -> Climber_ID, Name, Country, Time, Points, Mountain_ID. | Joins: climber.Mountain_ID = mountain.Mountain_ID, | give the names of mountains in alphabetical order. |
climbing | select country from mountain where height > 5000 | Question: what are the countries of mountains with height bigger than 5000? | Tables: mountain -> Mountain_ID, Name, Height, Prominence, Range, Country. climber -> Climber_ID, Name, Country, Time, Points, Mountain_ID. | Joins: climber.Mountain_ID = mountain.Mountain_ID, | what are the countries of mountains with height bigger than 5000? |
climbing | select country from mountain where height > 5000 | Question: return the countries of the mountains that have a height larger than 5000. | Tables: mountain -> Mountain_ID, Name, Height, Prominence, Range, Country. climber -> Climber_ID, Name, Country, Time, Points, Mountain_ID. | Joins: climber.Mountain_ID = mountain.Mountain_ID, | return the countries of the mountains that have a height larger than 5000. |
climbing | select name from mountain order by height desc limit 1 | Question: what is the name of the highest mountain? | Tables: mountain -> Mountain_ID, Name, Height, Prominence, Range, Country. climber -> Climber_ID, Name, Country, Time, Points, Mountain_ID. | Joins: climber.Mountain_ID = mountain.Mountain_ID, | what is the name of the highest mountain? |
climbing | select name from mountain order by height desc limit 1 | Question: return the name of the mountain with the greatest height. | Tables: mountain -> Mountain_ID, Name, Height, Prominence, Range, Country. climber -> Climber_ID, Name, Country, Time, Points, Mountain_ID. | Joins: climber.Mountain_ID = mountain.Mountain_ID, | return the name of the mountain with the greatest height. |
climbing | select distinct range from mountain order by prominence desc limit 3 | Question: list the distinct ranges of the mountains with the top 3 prominence. | Tables: mountain -> Mountain_ID, Name, Height, Prominence, Range, Country. climber -> Climber_ID, Name, Country, Time, Points, Mountain_ID. | Joins: climber.Mountain_ID = mountain.Mountain_ID, | list the distinct ranges of the mountains with the top 3 prominence. |
climbing | select distinct range from mountain order by prominence desc limit 3 | Question: what are the different ranges of the 3 mountains with the highest prominence? | Tables: mountain -> Mountain_ID, Name, Height, Prominence, Range, Country. climber -> Climber_ID, Name, Country, Time, Points, Mountain_ID. | Joins: climber.Mountain_ID = mountain.Mountain_ID, | what are the different ranges of the 3 mountains with the highest prominence? |
climbing | select t1.name , t2.name from climber as t1 join mountain as t2 on t1.mountain_id = t2.mountain_id | Question: show names of climbers and the names of mountains they climb. | Tables: mountain -> Mountain_ID, Name, Height, Prominence, Range, Country. climber -> Climber_ID, Name, Country, Time, Points, Mountain_ID. | Joins: climber.Mountain_ID = mountain.Mountain_ID, | show names of climbers and the names of mountains they climb. |
climbing | select t1.name , t2.name from climber as t1 join mountain as t2 on t1.mountain_id = t2.mountain_id | Question: what are the names of climbers and the corresponding names of mountains that they climb? | Tables: mountain -> Mountain_ID, Name, Height, Prominence, Range, Country. climber -> Climber_ID, Name, Country, Time, Points, Mountain_ID. | Joins: climber.Mountain_ID = mountain.Mountain_ID, | what are the names of climbers and the corresponding names of mountains that they climb? |
climbing | select t1.name , t2.height from climber as t1 join mountain as t2 on t1.mountain_id = t2.mountain_id | Question: show the names of climbers and the heights of mountains they climb. | Tables: mountain -> Mountain_ID, Name, Height, Prominence, Range, Country. climber -> Climber_ID, Name, Country, Time, Points, Mountain_ID. | Joins: climber.Mountain_ID = mountain.Mountain_ID, | show the names of climbers and the heights of mountains they climb. |
climbing | select t1.name , t2.height from climber as t1 join mountain as t2 on t1.mountain_id = t2.mountain_id | Question: what are the names of climbers and the corresponding heights of the mountains that they climb? | Tables: mountain -> Mountain_ID, Name, Height, Prominence, Range, Country. climber -> Climber_ID, Name, Country, Time, Points, Mountain_ID. | Joins: climber.Mountain_ID = mountain.Mountain_ID, | what are the names of climbers and the corresponding heights of the mountains that they climb? |
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 | Question: show the height of the mountain climbed by the climber with the maximum points. | Tables: mountain -> Mountain_ID, Name, Height, Prominence, Range, Country. climber -> Climber_ID, Name, Country, Time, Points, Mountain_ID. | Joins: climber.Mountain_ID = mountain.Mountain_ID, | show the height of the mountain climbed by the climber with the maximum points. |
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 | Question: what is the height of the mountain climbined by the climbing who had the most points? | Tables: mountain -> Mountain_ID, Name, Height, Prominence, Range, Country. climber -> Climber_ID, Name, Country, Time, Points, Mountain_ID. | Joins: climber.Mountain_ID = mountain.Mountain_ID, | what is the height of the mountain climbined by the climbing who had the most points? |
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' | Question: show the distinct names of mountains climbed by climbers from country 'west germany'. | Tables: mountain -> Mountain_ID, Name, Height, Prominence, Range, Country. climber -> Climber_ID, Name, Country, Time, Points, Mountain_ID. | Joins: climber.Mountain_ID = mountain.Mountain_ID, | show the distinct names of mountains climbed by climbers from country 'west germany'. |
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' | Question: what are the different names of mountains ascended by climbers from the country of west germany? | Tables: mountain -> Mountain_ID, Name, Height, Prominence, Range, Country. climber -> Climber_ID, Name, Country, Time, Points, Mountain_ID. | Joins: climber.Mountain_ID = mountain.Mountain_ID, | what are the different names of mountains ascended by climbers from the country of west germany? |
climbing | select t1.time from climber as t1 join mountain as t2 on t1.mountain_id = t2.mountain_id where t2.country = 'uganda' | Question: show the times used by climbers to climb mountains in country uganda. | Tables: mountain -> Mountain_ID, Name, Height, Prominence, Range, Country. climber -> Climber_ID, Name, Country, Time, Points, Mountain_ID. | Joins: climber.Mountain_ID = mountain.Mountain_ID, | show the times used by climbers to climb mountains in country uganda. |
climbing | select t1.time from climber as t1 join mountain as t2 on t1.mountain_id = t2.mountain_id where t2.country = 'uganda' | Question: what are the times used by climbers who climbed mountains in the country of uganda? | Tables: mountain -> Mountain_ID, Name, Height, Prominence, Range, Country. climber -> Climber_ID, Name, Country, Time, Points, Mountain_ID. | Joins: climber.Mountain_ID = mountain.Mountain_ID, | what are the times used by climbers who climbed mountains in the country of uganda? |
climbing | select country , count(*) from climber group by country | Question: please show the countries and the number of climbers from each country. | Tables: mountain -> Mountain_ID, Name, Height, Prominence, Range, Country. climber -> Climber_ID, Name, Country, Time, Points, Mountain_ID. | Joins: climber.Mountain_ID = mountain.Mountain_ID, | please show the countries and the number of climbers from each country. |
climbing | select country , count(*) from climber group by country | Question: how many climbers are from each country? | Tables: mountain -> Mountain_ID, Name, Height, Prominence, Range, Country. climber -> Climber_ID, Name, Country, Time, Points, Mountain_ID. | Joins: climber.Mountain_ID = mountain.Mountain_ID, | how many climbers are from each country? |
climbing | select country from mountain group by country having count(*) > 1 | Question: list the countries that have more than one mountain. | Tables: mountain -> Mountain_ID, Name, Height, Prominence, Range, Country. climber -> Climber_ID, Name, Country, Time, Points, Mountain_ID. | Joins: climber.Mountain_ID = mountain.Mountain_ID, | list the countries that have more than one mountain. |
climbing | select country from mountain group by country having count(*) > 1 | Question: which countries have more than one mountain? | Tables: mountain -> Mountain_ID, Name, Height, Prominence, Range, Country. climber -> Climber_ID, Name, Country, Time, Points, Mountain_ID. | Joins: climber.Mountain_ID = mountain.Mountain_ID, | which countries have more than one mountain? |
climbing | select name from mountain where mountain_id not in (select mountain_id from climber) | Question: list the names of mountains that do not have any climber. | Tables: mountain -> Mountain_ID, Name, Height, Prominence, Range, Country. climber -> Climber_ID, Name, Country, Time, Points, Mountain_ID. | Joins: climber.Mountain_ID = mountain.Mountain_ID, | list the names of mountains that do not have any climber. |
climbing | select name from mountain where mountain_id not in (select mountain_id from climber) | Question: what are the names of countains that no climber has climbed? | Tables: mountain -> Mountain_ID, Name, Height, Prominence, Range, Country. climber -> Climber_ID, Name, Country, Time, Points, Mountain_ID. | Joins: climber.Mountain_ID = mountain.Mountain_ID, | what are the names of countains that no climber has climbed? |
climbing | select country from mountain where height > 5600 intersect select country from mountain where height < 5200 | Question: show the countries that have mountains with height more than 5600 stories and mountains with height less than 5200. | Tables: mountain -> Mountain_ID, Name, Height, Prominence, Range, Country. climber -> Climber_ID, Name, Country, Time, Points, Mountain_ID. | Joins: climber.Mountain_ID = mountain.Mountain_ID, | show the countries that have mountains with height more than 5600 stories and mountains with height less than 5200. |
climbing | select country from mountain where height > 5600 intersect select country from mountain where height < 5200 | Question: what are the countries that have both mountains that are higher than 5600 and lower than 5200? | Tables: mountain -> Mountain_ID, Name, Height, Prominence, Range, Country. climber -> Climber_ID, Name, Country, Time, Points, Mountain_ID. | Joins: climber.Mountain_ID = mountain.Mountain_ID, | what are the countries that have both mountains that are higher than 5600 and lower than 5200? |
climbing | select range from mountain group by range order by count(*) desc limit 1 | Question: show the range that has the most number of mountains. | Tables: mountain -> Mountain_ID, Name, Height, Prominence, Range, Country. climber -> Climber_ID, Name, Country, Time, Points, Mountain_ID. | Joins: climber.Mountain_ID = mountain.Mountain_ID, | show the range that has the most number of mountains. |
climbing | select range from mountain group by range order by count(*) desc limit 1 | Question: which range contains the most mountains? | Tables: mountain -> Mountain_ID, Name, Height, Prominence, Range, Country. climber -> Climber_ID, Name, Country, Time, Points, Mountain_ID. | Joins: climber.Mountain_ID = mountain.Mountain_ID, | which range contains the most mountains? |
climbing | select name from mountain where height > 5000 or prominence > 1000 | Question: show the names of mountains with height more than 5000 or prominence more than 1000. | Tables: mountain -> Mountain_ID, Name, Height, Prominence, Range, Country. climber -> Climber_ID, Name, Country, Time, Points, Mountain_ID. | Joins: climber.Mountain_ID = mountain.Mountain_ID, | show the names of mountains with height more than 5000 or prominence more than 1000. |
climbing | select name from mountain where height > 5000 or prominence > 1000 | Question: what are the names of mountains that have a height of over 5000 or a prominence of over 1000? | Tables: mountain -> Mountain_ID, Name, Height, Prominence, Range, Country. climber -> Climber_ID, Name, Country, Time, Points, Mountain_ID. | Joins: climber.Mountain_ID = mountain.Mountain_ID, | what are the names of mountains that have a height of over 5000 or a prominence of over 1000? |
body_builder | select count(*) from body_builder | Question: how many body builders are there? | Tables: body_builder -> Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total. people -> People_ID, Name, Height, Weight, Birth_Date, Birth_Place. | Joins: body_builder.People_ID = people.People_ID, | how many body builders are there? |
body_builder | select total from body_builder order by total asc | Question: list the total scores of body builders in ascending order. | Tables: body_builder -> Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total. people -> People_ID, Name, Height, Weight, Birth_Date, Birth_Place. | Joins: body_builder.People_ID = people.People_ID, | list the total scores of body builders in ascending order. |
body_builder | select snatch , clean_jerk from body_builder order by snatch asc | Question: list the snatch score and clean jerk score of body builders in ascending order of snatch score. | Tables: body_builder -> Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total. people -> People_ID, Name, Height, Weight, Birth_Date, Birth_Place. | Joins: body_builder.People_ID = people.People_ID, | list the snatch score and clean jerk score of body builders in ascending order of snatch score. |
body_builder | select avg(snatch) from body_builder | Question: what is the average snatch score of body builders? | Tables: body_builder -> Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total. people -> People_ID, Name, Height, Weight, Birth_Date, Birth_Place. | Joins: body_builder.People_ID = people.People_ID, | what is the average snatch score of body builders? |
body_builder | select clean_jerk from body_builder order by total desc limit 1 | Question: what are the clean and jerk score of the body builder with the highest total score? | Tables: body_builder -> Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total. people -> People_ID, Name, Height, Weight, Birth_Date, Birth_Place. | Joins: body_builder.People_ID = people.People_ID, | what are the clean and jerk score of the body builder with the highest total score? |
body_builder | select birth_date from people order by height asc | Question: what are the birthdays of people in ascending order of height? | Tables: body_builder -> Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total. people -> People_ID, Name, Height, Weight, Birth_Date, Birth_Place. | Joins: body_builder.People_ID = people.People_ID, | what are the birthdays of people in ascending order of height? |
body_builder | select t2.name from body_builder as t1 join people as t2 on t1.people_id = t2.people_id | Question: what are the names of body builders? | Tables: body_builder -> Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total. people -> People_ID, Name, Height, Weight, Birth_Date, Birth_Place. | Joins: body_builder.People_ID = people.People_ID, | what are the names of body builders? |
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 | Question: what are the names of body builders whose total score is higher than 300? | Tables: body_builder -> Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total. people -> People_ID, Name, Height, Weight, Birth_Date, Birth_Place. | Joins: body_builder.People_ID = people.People_ID, | what are the names of body builders whose total score is higher than 300? |
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 | Question: what is the name of the body builder with the greatest body weight? | Tables: body_builder -> Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total. people -> People_ID, Name, Height, Weight, Birth_Date, Birth_Place. | Joins: body_builder.People_ID = people.People_ID, | what is the name of the body builder with the greatest body weight? |
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 | Question: what are the birth date and birth place of the body builder with the highest total points? | Tables: body_builder -> Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total. people -> People_ID, Name, Height, Weight, Birth_Date, Birth_Place. | Joins: body_builder.People_ID = people.People_ID, | what are the birth date and birth place of the body builder with the highest total points? |
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 | Question: what are the heights of body builders with total score smaller than 315? | Tables: body_builder -> Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total. people -> People_ID, Name, Height, Weight, Birth_Date, Birth_Place. | Joins: body_builder.People_ID = people.People_ID, | what are the heights of body builders with total score smaller than 315? |
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 | Question: what is the average total score of body builders with height bigger than 200? | Tables: body_builder -> Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total. people -> People_ID, Name, Height, Weight, Birth_Date, Birth_Place. | Joins: body_builder.People_ID = people.People_ID, | what is the average total score of body builders with height bigger than 200? |
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 | Question: what are the names of body builders in descending order of total scores? | Tables: body_builder -> Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total. people -> People_ID, Name, Height, Weight, Birth_Date, Birth_Place. | Joins: body_builder.People_ID = people.People_ID, | what are the names of body builders in descending order of total scores? |
body_builder | select birth_place , count(*) from people group by birth_place | Question: list each birth place along with the number of people from there. | Tables: body_builder -> Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total. people -> People_ID, Name, Height, Weight, Birth_Date, Birth_Place. | Joins: body_builder.People_ID = people.People_ID, | list each birth place along with the number of people from there. |
body_builder | select birth_place from people group by birth_place order by count(*) desc limit 1 | Question: what is the most common birth place of people? | Tables: body_builder -> Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total. people -> People_ID, Name, Height, Weight, Birth_Date, Birth_Place. | Joins: body_builder.People_ID = people.People_ID, | what is the most common birth place of people? |
body_builder | select birth_place from people group by birth_place having count(*) >= 2 | Question: what are the birth places that are shared by at least two people? | Tables: body_builder -> Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total. people -> People_ID, Name, Height, Weight, Birth_Date, Birth_Place. | Joins: body_builder.People_ID = people.People_ID, | what are the birth places that are shared by at least two people? |
body_builder | select height , weight from people order by height desc | Question: list the height and weight of people in descending order of height. | Tables: body_builder -> Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total. people -> People_ID, Name, Height, Weight, Birth_Date, Birth_Place. | Joins: body_builder.People_ID = people.People_ID, | list the height and weight of people in descending order of height. |
body_builder | select * from body_builder | Question: show all information about each body builder. | Tables: body_builder -> Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total. people -> People_ID, Name, Height, Weight, Birth_Date, Birth_Place. | Joins: body_builder.People_ID = people.People_ID, | show all information about each body builder. |
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 | Question: list the names and origins of people who are not body builders. | Tables: body_builder -> Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total. people -> People_ID, Name, Height, Weight, Birth_Date, Birth_Place. | Joins: body_builder.People_ID = people.People_ID, | list the names and origins of people who are not body builders. |
body_builder | select count(distinct birth_place) from people | Question: how many distinct birth places are there? | Tables: body_builder -> Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total. people -> People_ID, Name, Height, Weight, Birth_Date, Birth_Place. | Joins: body_builder.People_ID = people.People_ID, | how many distinct birth places are there? |
body_builder | select count(*) from people where people_id not in (select people_id from body_builder) | Question: how many persons are not body builders? | Tables: body_builder -> Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total. people -> People_ID, Name, Height, Weight, Birth_Date, Birth_Place. | Joins: body_builder.People_ID = people.People_ID, | how many persons are not body builders? |
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; | Question: list the weight of the body builders who have snatch score higher than 140 or have the height greater than 200. | Tables: body_builder -> Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total. people -> People_ID, Name, Height, Weight, Birth_Date, Birth_Place. | Joins: body_builder.People_ID = people.People_I... | list the weight of the body builders who have snatch score higher than 140 or have the height greater than 200. |
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%'; | Question: what are the total scores of the body builders whose birthday contains the string 'january' ? | Tables: body_builder -> Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total. people -> People_ID, Name, Height, Weight, Birth_Date, Birth_Place. | Joins: body_builder.People_ID = people.People_ID, | what are the total scores of the body builders whose birthday contains the string 'january' ? |
body_builder | select min(snatch) from body_builder | Question: what is the minimum snatch score? | Tables: body_builder -> Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total. people -> People_ID, Name, Height, Weight, Birth_Date, Birth_Place. | Joins: body_builder.People_ID = people.People_ID, | what is the minimum snatch score? |
election_representative | select count(*) from election | Question: how many elections are there? | Tables: election -> Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place. representative -> Representative_ID, Name, State, Party, Lifespan. | Joins: election.Representative_ID = representative.Representative_ID, | how many elections are there? |
election_representative | select votes from election order by votes desc | Question: list the votes of elections in descending order. | Tables: election -> Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place. representative -> Representative_ID, Name, State, Party, Lifespan. | Joins: election.Representative_ID = representative.Representative_ID, | list the votes of elections in descending order. |
election_representative | select date , vote_percent from election | Question: list the dates and vote percents of elections. | Tables: election -> Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place. representative -> Representative_ID, Name, State, Party, Lifespan. | Joins: election.Representative_ID = representative.Representative_ID, | list the dates and vote percents of elections. |
election_representative | select min(vote_percent) , max(vote_percent) from election | Question: what are the minimum and maximum vote percents of elections? | Tables: election -> Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place. representative -> Representative_ID, Name, State, Party, Lifespan. | Joins: election.Representative_ID = representative.Representative_ID, | what are the minimum and maximum vote percents of elections? |
election_representative | select name , party from representative | Question: what are the names and parties of representatives? | Tables: election -> Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place. representative -> Representative_ID, Name, State, Party, Lifespan. | Joins: election.Representative_ID = representative.Representative_ID, | what are the names and parties of representatives? |
election_representative | select name from representative where party != 'republican' | Question: what are the names of representatives whose party is not 'republican'? | Tables: election -> Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place. representative -> Representative_ID, Name, State, Party, Lifespan. | Joins: election.Representative_ID = representative.Representative_ID, | what are the names of representatives whose party is not 'republican'? |
election_representative | select lifespan from representative where state = 'new york' or state = 'indiana' | Question: what are the life spans of representatives from new york state or indiana state? | Tables: election -> Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place. representative -> Representative_ID, Name, State, Party, Lifespan. | Joins: election.Representative_ID = representative.Representative... | what are the life spans of representatives from new york state or indiana state? |
election_representative | select t2.name , t1.date from election as t1 join representative as t2 on t1.representative_id = t2.representative_id | Question: what are the names of representatives and the dates of elections they participated in. | Tables: election -> Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place. representative -> Representative_ID, Name, State, Party, Lifespan. | Joins: election.Representative_ID = representative.Represen... | what are the names of representatives and the dates of elections they participated in. |
election_representative | select t2.name from election as t1 join representative as t2 on t1.representative_id = t2.representative_id where votes > 10000 | Question: what are the names of representatives with more than 10000 votes in election? | Tables: election -> Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place. representative -> Representative_ID, Name, State, Party, Lifespan. | Joins: election.Representative_ID = representative.Representative_ID... | what are the names of representatives with more than 10000 votes in election? |
election_representative | select t2.name from election as t1 join representative as t2 on t1.representative_id = t2.representative_id order by votes desc | Question: what are the names of representatives in descending order of votes? | Tables: election -> Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place. representative -> Representative_ID, Name, State, Party, Lifespan. | Joins: election.Representative_ID = representative.Representative_ID, | what are the names of representatives in descending order of votes? |
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 | Question: what is the party of the representative that has the smallest number of votes. | Tables: election -> Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place. representative -> Representative_ID, Name, State, Party, Lifespan. | Joins: election.Representative_ID = representative.Representative_I... | what is the party of the representative that has the smallest number of votes. |
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 | Question: what are the lifespans of representatives in descending order of vote percent? | Tables: election -> Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place. representative -> Representative_ID, Name, State, Party, Lifespan. | Joins: election.Representative_ID = representative.Representative_I... | what are the lifespans of representatives in descending order of vote percent? |
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' | Question: what is the average number of votes of representatives from party 'republican'? | Tables: election -> Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place. representative -> Representative_ID, Name, State, Party, Lifespan. | Joins: election.Representative_ID = representative.Representative_... | what is the average number of votes of representatives from party 'republican'? |
election_representative | select party , count(*) from representative group by party | Question: what are the different parties of representative? show the party name and the number of representatives in each party. | Tables: election -> Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place. representative -> Representative_ID, Name, State, Party, Lifespan. | Joins: election.Representat... | what are the different parties of representative? show the party name and the number of representatives in each party. |
election_representative | select party , count(*) from representative group by party order by count(*) desc limit 1 | Question: what is the party that has the largest number of representatives? | Tables: election -> Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place. representative -> Representative_ID, Name, State, Party, Lifespan. | Joins: election.Representative_ID = representative.Representative_ID, | what is the party that has the largest number of representatives? |
election_representative | select party from representative group by party having count(*) >= 3 | Question: what parties have at least three representatives? | Tables: election -> Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place. representative -> Representative_ID, Name, State, Party, Lifespan. | Joins: election.Representative_ID = representative.Representative_ID, | what parties have at least three representatives? |
election_representative | select state from representative group by state having count(*) >= 2 | Question: what states have at least two representatives? | Tables: election -> Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place. representative -> Representative_ID, Name, State, Party, Lifespan. | Joins: election.Representative_ID = representative.Representative_ID, | what states have at least two representatives? |
election_representative | select name from representative where representative_id not in (select representative_id from election) | Question: list the names of representatives that have not participated in elections listed here. | Tables: election -> Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place. representative -> Representative_ID, Name, State, Party, Lifespan. | Joins: election.Representative_ID = representative.Represen... | list the names of representatives that have not participated in elections listed here. |
election_representative | select party from representative where state = 'new york' intersect select party from representative where state = 'pennsylvania' | Question: show the parties that have both representatives in new york state and representatives in pennsylvania state. | Tables: election -> Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place. representative -> Representative_ID, Name, State, Party, Lifespan. | Joins: election.Representative_ID = r... | show the parties that have both representatives in new york state and representatives in pennsylvania state. |
election_representative | select count(distinct party) from representative | Question: how many distinct parties are there for representatives? | Tables: election -> Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place. representative -> Representative_ID, Name, State, Party, Lifespan. | Joins: election.Representative_ID = representative.Representative_ID, | how many distinct parties are there for representatives? |
apartment_rentals | select count(*) from apartment_bookings | Question: how many apartment bookings are there in total? | Tables: 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_cou... | how many apartment bookings are there in total? |
apartment_rentals | select count(*) from apartment_bookings | Question: count the total number of apartment bookings. | Tables: 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... | count the total number of apartment bookings. |
apartment_rentals | select booking_start_date , booking_end_date from apartment_bookings | Question: show the start dates and end dates of all the apartment bookings. | Tables: 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, bedro... | show the start dates and end dates of all the apartment bookings. |
apartment_rentals | select booking_start_date , booking_end_date from apartment_bookings | Question: what are the start date and end date of each apartment booking? | Tables: 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... | what are the start date and end date of each apartment booking? |
apartment_rentals | select distinct building_description from apartment_buildings | Question: show all distinct building descriptions. | Tables: 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. Apa... | show all distinct building descriptions. |
apartment_rentals | select distinct building_description from apartment_buildings | Question: give me a list of all the distinct building descriptions. | Tables: 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... | give me a list of all the distinct building descriptions. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.