db_id stringlengths 4 31 | SQL stringlengths 18 1.45k | input_sequence stringlengths 148 11k | question stringlengths 16 325 |
|---|---|---|---|
epinions_1 | select t1.title from item as t1 join review as t2 on t1.i_id = t2.i_id where t2.rating > (select avg(rating) from review) | Question: find the titles of items whose rating is higher than the average review rating of all items. | Tables: item -> i_id, title. review -> a_id, u_id, i_id, rating, rank. useracct -> u_id, name. trust -> source_u_id, target_u_id, trust. | Joins: review.i_id = item.i_id, review.u_id = useracct.u_id, trust.target_u_... | find the titles of items whose rating is higher than the average review rating of all items. |
epinions_1 | select t1.title from item as t1 join review as t2 on t1.i_id = t2.i_id where t2.rating < 5 | Question: find the titles of items that received any rating below 5. | Tables: item -> i_id, title. review -> a_id, u_id, i_id, rating, rank. useracct -> u_id, name. trust -> source_u_id, target_u_id, trust. | Joins: review.i_id = item.i_id, review.u_id = useracct.u_id, trust.target_u_id = useracct.u_id, trust.source_u... | find the titles of items that received any rating below 5. |
epinions_1 | select t1.title from item as t1 join review as t2 on t1.i_id = t2.i_id where t2.rating > 8 intersect select t1.title from item as t1 join review as t2 on t1.i_id = t2.i_id where t2.rating < 5 | Question: find the titles of items that received both a rating higher than 8 and a rating below 5. | Tables: item -> i_id, title. review -> a_id, u_id, i_id, rating, rank. useracct -> u_id, name. trust -> source_u_id, target_u_id, trust. | Joins: review.i_id = item.i_id, review.u_id = useracct.u_id, trust.target_u_id =... | find the titles of items that received both a rating higher than 8 and a rating below 5. |
epinions_1 | select t1.title from item as t1 join review as t2 on t1.i_id = t2.i_id where t2.rank > 3 intersect select t1.title from item as t1 join review as t2 on t1.i_id = t2.i_id group by t2.i_id having avg(t2.rating) > 5 | Question: find the names of items whose rank is higher than 3 and whose average rating is above 5. | Tables: item -> i_id, title. review -> a_id, u_id, i_id, rating, rank. useracct -> u_id, name. trust -> source_u_id, target_u_id, trust. | Joins: review.i_id = item.i_id, review.u_id = useracct.u_id, trust.target_u_id =... | find the names of items whose rank is higher than 3 and whose average rating is above 5. |
epinions_1 | select t1.title from item as t1 join review as t2 on t1.i_id = t2.i_id group by t2.i_id order by avg(t2.rating) limit 1 | Question: find the name of the item with the lowest average rating. | Tables: item -> i_id, title. review -> a_id, u_id, i_id, rating, rank. useracct -> u_id, name. trust -> source_u_id, target_u_id, trust. | Joins: review.i_id = item.i_id, review.u_id = useracct.u_id, trust.target_u_id = useracct.u_id, trust.source_u_... | find the name of the item with the lowest average rating. |
epinions_1 | select title from item order by title | Question: list the titles of all items in alphabetic order . | Tables: item -> i_id, title. review -> a_id, u_id, i_id, rating, rank. useracct -> u_id, name. trust -> source_u_id, target_u_id, trust. | Joins: review.i_id = item.i_id, review.u_id = useracct.u_id, trust.target_u_id = useracct.u_id, trust.source_u_id = us... | list the titles of all items in alphabetic order . |
epinions_1 | select t1.name from useracct as t1 join review as t2 on t1.u_id = t2.u_id group by t2.u_id order by count(*) desc limit 1 | Question: find the name of the user who gives the most reviews. | Tables: item -> i_id, title. review -> a_id, u_id, i_id, rating, rank. useracct -> u_id, name. trust -> source_u_id, target_u_id, trust. | Joins: review.i_id = item.i_id, review.u_id = useracct.u_id, trust.target_u_id = useracct.u_id, trust.source_u_id =... | find the name of the user who gives the most reviews. |
epinions_1 | select t1.title , t1.i_id from item as t1 join review as t2 on t1.i_id = t2.i_id group by t2.i_id order by avg(t2.rating) desc limit 1 | Question: find the name and id of the item with the highest average rating. | Tables: item -> i_id, title. review -> a_id, u_id, i_id, rating, rank. useracct -> u_id, name. trust -> source_u_id, target_u_id, trust. | Joins: review.i_id = item.i_id, review.u_id = useracct.u_id, trust.target_u_id = useracct.u_id, trust.s... | find the name and id of the item with the highest average rating. |
epinions_1 | select t1.title , t1.i_id from item as t1 join review as t2 on t1.i_id = t2.i_id group by t2.i_id order by avg(t2.rank) desc limit 1 | Question: find the name and id of the good with the highest average rank. | Tables: item -> i_id, title. review -> a_id, u_id, i_id, rating, rank. useracct -> u_id, name. trust -> source_u_id, target_u_id, trust. | Joins: review.i_id = item.i_id, review.u_id = useracct.u_id, trust.target_u_id = useracct.u_id, trust.sou... | find the name and id of the good with the highest average rank. |
epinions_1 | select t1.name , avg(t2.rating) from useracct as t1 join review as t2 on t1.u_id = t2.u_id group by t2.u_id | Question: for each user, return the name and the average rating of reviews given by them. | Tables: item -> i_id, title. review -> a_id, u_id, i_id, rating, rank. useracct -> u_id, name. trust -> source_u_id, target_u_id, trust. | Joins: review.i_id = item.i_id, review.u_id = useracct.u_id, trust.target_u_id = useracct... | for each user, return the name and the average rating of reviews given by them. |
epinions_1 | select t1.name , count(*) from useracct as t1 join review as t2 on t1.u_id = t2.u_id group by t2.u_id | Question: for each user, find their name and the number of reviews written by them. | Tables: item -> i_id, title. review -> a_id, u_id, i_id, rating, rank. useracct -> u_id, name. trust -> source_u_id, target_u_id, trust. | Joins: review.i_id = item.i_id, review.u_id = useracct.u_id, trust.target_u_id = useracct.u_id,... | for each user, find their name and the number of reviews written by them. |
epinions_1 | select t1.name from useracct as t1 join review as t2 on t1.u_id = t2.u_id order by t2.rating desc limit 1 | Question: find the name of the user who gave the highest rating. | Tables: item -> i_id, title. review -> a_id, u_id, i_id, rating, rank. useracct -> u_id, name. trust -> source_u_id, target_u_id, trust. | Joins: review.i_id = item.i_id, review.u_id = useracct.u_id, trust.target_u_id = useracct.u_id, trust.source_u_id ... | find the name of the user who gave the highest rating. |
epinions_1 | select t1.name from useracct as t1 join trust as t2 on t1.u_id = t2.source_u_id group by t2.source_u_id order by avg(trust) desc limit 1 | Question: find the name of the source user with the highest average trust score. | Tables: item -> i_id, title. review -> a_id, u_id, i_id, rating, rank. useracct -> u_id, name. trust -> source_u_id, target_u_id, trust. | Joins: review.i_id = item.i_id, review.u_id = useracct.u_id, trust.target_u_id = useracct.u_id, tr... | find the name of the source user with the highest average trust score. |
epinions_1 | select t1.name , avg(trust) from useracct as t1 join trust as t2 on t1.u_id = t2.target_u_id group by t2.target_u_id | Question: find each target user's name and average trust score. | Tables: item -> i_id, title. review -> a_id, u_id, i_id, rating, rank. useracct -> u_id, name. trust -> source_u_id, target_u_id, trust. | Joins: review.i_id = item.i_id, review.u_id = useracct.u_id, trust.target_u_id = useracct.u_id, trust.source_u_id =... | find each target user's name and average trust score. |
epinions_1 | select t1.name from useracct as t1 join trust as t2 on t1.u_id = t2.target_u_id order by trust limit 1 | Question: find the name of the target user with the lowest trust score. | Tables: item -> i_id, title. review -> a_id, u_id, i_id, rating, rank. useracct -> u_id, name. trust -> source_u_id, target_u_id, trust. | Joins: review.i_id = item.i_id, review.u_id = useracct.u_id, trust.target_u_id = useracct.u_id, trust.sourc... | find the name of the target user with the lowest trust score. |
epinions_1 | select title from item where i_id not in (select i_id from review) | Question: find the names of the items that did not receive any review. | Tables: item -> i_id, title. review -> a_id, u_id, i_id, rating, rank. useracct -> u_id, name. trust -> source_u_id, target_u_id, trust. | Joins: review.i_id = item.i_id, review.u_id = useracct.u_id, trust.target_u_id = useracct.u_id, trust.source... | find the names of the items that did not receive any review. |
epinions_1 | select name from useracct where u_id not in (select u_id from review) | Question: find the names of users who did not leave any review. | Tables: item -> i_id, title. review -> a_id, u_id, i_id, rating, rank. useracct -> u_id, name. trust -> source_u_id, target_u_id, trust. | Joins: review.i_id = item.i_id, review.u_id = useracct.u_id, trust.target_u_id = useracct.u_id, trust.source_u_id =... | find the names of users who did not leave any review. |
epinions_1 | select count(*) from useracct where u_id not in (select u_id from review) | Question: find the number of users who did not write any review. | Tables: item -> i_id, title. review -> a_id, u_id, i_id, rating, rank. useracct -> u_id, name. trust -> source_u_id, target_u_id, trust. | Joins: review.i_id = item.i_id, review.u_id = useracct.u_id, trust.target_u_id = useracct.u_id, trust.source_u_id ... | find the number of users who did not write any review. |
epinions_1 | select count(*) from item where i_id not in (select i_id from review) | Question: find the number of items without any review. | Tables: item -> i_id, title. review -> a_id, u_id, i_id, rating, rank. useracct -> u_id, name. trust -> source_u_id, target_u_id, trust. | Joins: review.i_id = item.i_id, review.u_id = useracct.u_id, trust.target_u_id = useracct.u_id, trust.source_u_id = useracct... | find the number of items without any review. |
riding_club | select count(*) from player | Question: how many players are there? | Tables: player -> Player_ID, Sponsor_name, Player_name, Gender, Residence, Occupation, Votes, Rank. club -> Club_ID, Club_name, Region, Start_year. coach -> Coach_ID, Coach_name, Gender, Club_ID, Rank. player_coach -> Player_ID, Coach_ID, Starting_year. match_result -> Rank, Club... | how many players are there? |
riding_club | select player_name from player order by votes asc | Question: list the names of players in ascending order of votes. | Tables: player -> Player_ID, Sponsor_name, Player_name, Gender, Residence, Occupation, Votes, Rank. club -> Club_ID, Club_name, Region, Start_year. coach -> Coach_ID, Coach_name, Gender, Club_ID, Rank. player_coach -> Player_ID, Coach_ID, Starting_year.... | list the names of players in ascending order of votes. |
riding_club | select gender , occupation from player | Question: what are the gender and occupation of players? | Tables: player -> Player_ID, Sponsor_name, Player_name, Gender, Residence, Occupation, Votes, Rank. club -> Club_ID, Club_name, Region, Start_year. coach -> Coach_ID, Coach_name, Gender, Club_ID, Rank. player_coach -> Player_ID, Coach_ID, Starting_year. match_r... | what are the gender and occupation of players? |
riding_club | select player_name , residence from player where occupation != 'researcher' | Question: list the name and residence for players whose occupation is not 'researcher'. | Tables: player -> Player_ID, Sponsor_name, Player_name, Gender, Residence, Occupation, Votes, Rank. club -> Club_ID, Club_name, Region, Start_year. coach -> Coach_ID, Coach_name, Gender, Club_ID, Rank. player_coach -> Player_ID, C... | list the name and residence for players whose occupation is not 'researcher'. |
riding_club | select sponsor_name from player where residence = 'brandon' or residence = 'birtle' | Question: show the names of sponsors of players whose residence is either 'brandon' or 'birtle'. | Tables: player -> Player_ID, Sponsor_name, Player_name, Gender, Residence, Occupation, Votes, Rank. club -> Club_ID, Club_name, Region, Start_year. coach -> Coach_ID, Coach_name, Gender, Club_ID, Rank. player_coach -> Pla... | show the names of sponsors of players whose residence is either 'brandon' or 'birtle'. |
riding_club | select player_name from player order by votes desc limit 1 | Question: what is the name of the player with the largest number of votes? | Tables: player -> Player_ID, Sponsor_name, Player_name, Gender, Residence, Occupation, Votes, Rank. club -> Club_ID, Club_name, Region, Start_year. coach -> Coach_ID, Coach_name, Gender, Club_ID, Rank. player_coach -> Player_ID, Coach_ID, Star... | what is the name of the player with the largest number of votes? |
riding_club | select occupation , count(*) from player group by occupation | Question: show different occupations along with the number of players in each occupation. | Tables: player -> Player_ID, Sponsor_name, Player_name, Gender, Residence, Occupation, Votes, Rank. club -> Club_ID, Club_name, Region, Start_year. coach -> Coach_ID, Coach_name, Gender, Club_ID, Rank. player_coach -> Player_ID,... | show different occupations along with the number of players in each occupation. |
riding_club | select occupation from player group by occupation order by count(*) desc limit 1 | Question: please show the most common occupation of players. | Tables: player -> Player_ID, Sponsor_name, Player_name, Gender, Residence, Occupation, Votes, Rank. club -> Club_ID, Club_name, Region, Start_year. coach -> Coach_ID, Coach_name, Gender, Club_ID, Rank. player_coach -> Player_ID, Coach_ID, Starting_year. mat... | please show the most common occupation of players. |
riding_club | select residence from player group by residence having count(*) >= 2 | Question: show the residences that have at least two players. | Tables: player -> Player_ID, Sponsor_name, Player_name, Gender, Residence, Occupation, Votes, Rank. club -> Club_ID, Club_name, Region, Start_year. coach -> Coach_ID, Coach_name, Gender, Club_ID, Rank. player_coach -> Player_ID, Coach_ID, Starting_year. ma... | show the residences that have at least two players. |
riding_club | select t3.player_name , t2.coach_name from player_coach as t1 join coach as t2 on t1.coach_id = t2.coach_id join player as t3 on t1.player_id = t3.player_id | Question: show the names of players and names of their coaches. | Tables: player -> Player_ID, Sponsor_name, Player_name, Gender, Residence, Occupation, Votes, Rank. club -> Club_ID, Club_name, Region, Start_year. coach -> Coach_ID, Coach_name, Gender, Club_ID, Rank. player_coach -> Player_ID, Coach_ID, Starting_year. ... | show the names of players and names of their coaches. |
riding_club | select t3.player_name from player_coach as t1 join coach as t2 on t1.coach_id = t2.coach_id join player as t3 on t1.player_id = t3.player_id where t2.rank = 1 | Question: show the names of players coached by the rank 1 coach. | Tables: player -> Player_ID, Sponsor_name, Player_name, Gender, Residence, Occupation, Votes, Rank. club -> Club_ID, Club_name, Region, Start_year. coach -> Coach_ID, Coach_name, Gender, Club_ID, Rank. player_coach -> Player_ID, Coach_ID, Starting_year.... | show the names of players coached by the rank 1 coach. |
riding_club | select t3.player_name , t3.gender from player_coach as t1 join coach as t2 on t1.coach_id = t2.coach_id join player as t3 on t1.player_id = t3.player_id where t1.starting_year > 2011 | Question: show the names and genders of players with a coach starting after 2011. | Tables: player -> Player_ID, Sponsor_name, Player_name, Gender, Residence, Occupation, Votes, Rank. club -> Club_ID, Club_name, Region, Start_year. coach -> Coach_ID, Coach_name, Gender, Club_ID, Rank. player_coach -> Player_ID, Coach_I... | show the names and genders of players with a coach starting after 2011. |
riding_club | select t3.player_name , t2.coach_name from player_coach as t1 join coach as t2 on t1.coach_id = t2.coach_id join player as t3 on t1.player_id = t3.player_id order by t3.votes desc | Question: show the names of players and names of their coaches in descending order of the votes of players. | Tables: player -> Player_ID, Sponsor_name, Player_name, Gender, Residence, Occupation, Votes, Rank. club -> Club_ID, Club_name, Region, Start_year. coach -> Coach_ID, Coach_name, Gender, Club_ID, Rank. player_c... | show the names of players and names of their coaches in descending order of the votes of players. |
riding_club | select player_name from player where player_id not in (select player_id from player_coach) | Question: list the names of players that do not have coaches. | Tables: player -> Player_ID, Sponsor_name, Player_name, Gender, Residence, Occupation, Votes, Rank. club -> Club_ID, Club_name, Region, Start_year. coach -> Coach_ID, Coach_name, Gender, Club_ID, Rank. player_coach -> Player_ID, Coach_ID, Starting_year. ma... | list the names of players that do not have coaches. |
riding_club | select residence from player where gender = 'm' intersect select residence from player where gender = 'f' | Question: show the residences that have both a player of gender 'm' and a player of gender 'f'. | Tables: player -> Player_ID, Sponsor_name, Player_name, Gender, Residence, Occupation, Votes, Rank. club -> Club_ID, Club_name, Region, Start_year. coach -> Coach_ID, Coach_name, Gender, Club_ID, Rank. player_coach -> Play... | show the residences that have both a player of gender 'm' and a player of gender 'f'. |
riding_club | select t1.club_id , t1.club_name, count(*) from club as t1 join coach as t2 on t1.club_id = t2.club_id group by t1.club_id | Question: how many coaches does each club has? list the club id, name and the number of coaches. | Tables: player -> Player_ID, Sponsor_name, Player_name, Gender, Residence, Occupation, Votes, Rank. club -> Club_ID, Club_name, Region, Start_year. coach -> Coach_ID, Coach_name, Gender, Club_ID, Rank. player_coach -> Pla... | how many coaches does each club has? list the club id, name and the number of coaches. |
riding_club | select t1.club_id , t1.gold from match_result as t1 join coach as t2 on t1.club_id = t2.club_id group by t1.club_id order by count(*) desc limit 1 | Question: how many gold medals has the club with the most coaches won? | Tables: player -> Player_ID, Sponsor_name, Player_name, Gender, Residence, Occupation, Votes, Rank. club -> Club_ID, Club_name, Region, Start_year. coach -> Coach_ID, Coach_name, Gender, Club_ID, Rank. player_coach -> Player_ID, Coach_ID, Starting... | how many gold medals has the club with the most coaches won? |
gymnast | select count(*) from gymnast | Question: how many gymnasts are there? | Tables: gymnast -> Gymnast_ID, Floor_Exercise_Points, Pommel_Horse_Points, Rings_Points, Vault_Points, Parallel_Bars_Points, Horizontal_Bar_Points, Total_Points. people -> People_ID, Name, Age, Height, Hometown. | Joins: gymnast.Gymnast_ID = people.People_ID, | how many gymnasts are there? |
gymnast | select count(*) from gymnast | Question: count the number of gymnasts. | Tables: gymnast -> Gymnast_ID, Floor_Exercise_Points, Pommel_Horse_Points, Rings_Points, Vault_Points, Parallel_Bars_Points, Horizontal_Bar_Points, Total_Points. people -> People_ID, Name, Age, Height, Hometown. | Joins: gymnast.Gymnast_ID = people.People_ID, | count the number of gymnasts. |
gymnast | select total_points from gymnast order by total_points desc | Question: list the total points of gymnasts in descending order. | Tables: gymnast -> Gymnast_ID, Floor_Exercise_Points, Pommel_Horse_Points, Rings_Points, Vault_Points, Parallel_Bars_Points, Horizontal_Bar_Points, Total_Points. people -> People_ID, Name, Age, Height, Hometown. | Joins: gymnast.Gymnast_ID = people.Peop... | list the total points of gymnasts in descending order. |
gymnast | select total_points from gymnast order by total_points desc | Question: what are the total points for all gymnasts, ordered by total points descending? | Tables: gymnast -> Gymnast_ID, Floor_Exercise_Points, Pommel_Horse_Points, Rings_Points, Vault_Points, Parallel_Bars_Points, Horizontal_Bar_Points, Total_Points. people -> People_ID, Name, Age, Height, Hometown. | Joins: gymnast... | what are the total points for all gymnasts, ordered by total points descending? |
gymnast | select total_points from gymnast order by floor_exercise_points desc | Question: list the total points of gymnasts in descending order of floor exercise points. | Tables: gymnast -> Gymnast_ID, Floor_Exercise_Points, Pommel_Horse_Points, Rings_Points, Vault_Points, Parallel_Bars_Points, Horizontal_Bar_Points, Total_Points. people -> People_ID, Name, Age, Height, Hometown. | Joins: gymnast... | list the total points of gymnasts in descending order of floor exercise points. |
gymnast | select total_points from gymnast order by floor_exercise_points desc | Question: what are the total points of gymnasts, ordered by their floor exercise points descending? | Tables: gymnast -> Gymnast_ID, Floor_Exercise_Points, Pommel_Horse_Points, Rings_Points, Vault_Points, Parallel_Bars_Points, Horizontal_Bar_Points, Total_Points. people -> People_ID, Name, Age, Height, Hometown. | Join... | what are the total points of gymnasts, ordered by their floor exercise points descending? |
gymnast | select avg(horizontal_bar_points) from gymnast | Question: what is the average horizontal bar points for all gymnasts? | Tables: gymnast -> Gymnast_ID, Floor_Exercise_Points, Pommel_Horse_Points, Rings_Points, Vault_Points, Parallel_Bars_Points, Horizontal_Bar_Points, Total_Points. people -> People_ID, Name, Age, Height, Hometown. | Joins: gymnast.Gymnast_ID = people... | what is the average horizontal bar points for all gymnasts? |
gymnast | select avg(horizontal_bar_points) from gymnast | Question: return the average horizontal bar points across all gymnasts. | Tables: gymnast -> Gymnast_ID, Floor_Exercise_Points, Pommel_Horse_Points, Rings_Points, Vault_Points, Parallel_Bars_Points, Horizontal_Bar_Points, Total_Points. people -> People_ID, Name, Age, Height, Hometown. | Joins: gymnast.Gymnast_ID = peop... | return the average horizontal bar points across all gymnasts. |
gymnast | select name from people order by name asc | Question: what are the names of people in ascending alphabetical order? | Tables: gymnast -> Gymnast_ID, Floor_Exercise_Points, Pommel_Horse_Points, Rings_Points, Vault_Points, Parallel_Bars_Points, Horizontal_Bar_Points, Total_Points. people -> People_ID, Name, Age, Height, Hometown. | Joins: gymnast.Gymnast_ID = peop... | what are the names of people in ascending alphabetical order? |
gymnast | select name from people order by name asc | Question: return the names of people, ordered alphabetically. | Tables: gymnast -> Gymnast_ID, Floor_Exercise_Points, Pommel_Horse_Points, Rings_Points, Vault_Points, Parallel_Bars_Points, Horizontal_Bar_Points, Total_Points. people -> People_ID, Name, Age, Height, Hometown. | Joins: gymnast.Gymnast_ID = people.People_... | return the names of people, ordered alphabetically. |
gymnast | select t2.name from gymnast as t1 join people as t2 on t1.gymnast_id = t2.people_id | Question: what are the names of gymnasts? | Tables: gymnast -> Gymnast_ID, Floor_Exercise_Points, Pommel_Horse_Points, Rings_Points, Vault_Points, Parallel_Bars_Points, Horizontal_Bar_Points, Total_Points. people -> People_ID, Name, Age, Height, Hometown. | Joins: gymnast.Gymnast_ID = people.People_ID, | what are the names of gymnasts? |
gymnast | select t2.name from gymnast as t1 join people as t2 on t1.gymnast_id = t2.people_id | Question: return the names of the gymnasts. | Tables: gymnast -> Gymnast_ID, Floor_Exercise_Points, Pommel_Horse_Points, Rings_Points, Vault_Points, Parallel_Bars_Points, Horizontal_Bar_Points, Total_Points. people -> People_ID, Name, Age, Height, Hometown. | Joins: gymnast.Gymnast_ID = people.People_ID, | return the names of the gymnasts. |
gymnast | select t2.name from gymnast as t1 join people as t2 on t1.gymnast_id = t2.people_id where t2.hometown != 'santo domingo' | Question: what are the names of gymnasts whose hometown is not 'santo domingo'? | Tables: gymnast -> Gymnast_ID, Floor_Exercise_Points, Pommel_Horse_Points, Rings_Points, Vault_Points, Parallel_Bars_Points, Horizontal_Bar_Points, Total_Points. people -> People_ID, Name, Age, Height, Hometown. | Joins: gymnast.Gymnast_I... | what are the names of gymnasts whose hometown is not 'santo domingo'? |
gymnast | select t2.name from gymnast as t1 join people as t2 on t1.gymnast_id = t2.people_id where t2.hometown != 'santo domingo' | Question: return the names of gymnasts who did not grow up in santo domingo. | Tables: gymnast -> Gymnast_ID, Floor_Exercise_Points, Pommel_Horse_Points, Rings_Points, Vault_Points, Parallel_Bars_Points, Horizontal_Bar_Points, Total_Points. people -> People_ID, Name, Age, Height, Hometown. | Joins: gymnast.Gymnast_ID =... | return the names of gymnasts who did not grow up in santo domingo. |
gymnast | select age from people order by height desc limit 1 | Question: what is the age of the tallest person? | Tables: gymnast -> Gymnast_ID, Floor_Exercise_Points, Pommel_Horse_Points, Rings_Points, Vault_Points, Parallel_Bars_Points, Horizontal_Bar_Points, Total_Points. people -> People_ID, Name, Age, Height, Hometown. | Joins: gymnast.Gymnast_ID = people.People_ID, | what is the age of the tallest person? |
gymnast | select age from people order by height desc limit 1 | Question: return the age of the person with the greatest height. | Tables: gymnast -> Gymnast_ID, Floor_Exercise_Points, Pommel_Horse_Points, Rings_Points, Vault_Points, Parallel_Bars_Points, Horizontal_Bar_Points, Total_Points. people -> People_ID, Name, Age, Height, Hometown. | Joins: gymnast.Gymnast_ID = people.Peop... | return the age of the person with the greatest height. |
gymnast | select name from people order by age desc limit 5 | Question: list the names of the top 5 oldest people. | Tables: gymnast -> Gymnast_ID, Floor_Exercise_Points, Pommel_Horse_Points, Rings_Points, Vault_Points, Parallel_Bars_Points, Horizontal_Bar_Points, Total_Points. people -> People_ID, Name, Age, Height, Hometown. | Joins: gymnast.Gymnast_ID = people.People_ID, | list the names of the top 5 oldest people. |
gymnast | select name from people order by age desc limit 5 | Question: what are the names of the five oldest people? | Tables: gymnast -> Gymnast_ID, Floor_Exercise_Points, Pommel_Horse_Points, Rings_Points, Vault_Points, Parallel_Bars_Points, Horizontal_Bar_Points, Total_Points. people -> People_ID, Name, Age, Height, Hometown. | Joins: gymnast.Gymnast_ID = people.People_ID, | what are the names of the five oldest people? |
gymnast | select t1.total_points from gymnast as t1 join people as t2 on t1.gymnast_id = t2.people_id order by t2.age asc limit 1 | Question: what is the total point count of the youngest gymnast? | Tables: gymnast -> Gymnast_ID, Floor_Exercise_Points, Pommel_Horse_Points, Rings_Points, Vault_Points, Parallel_Bars_Points, Horizontal_Bar_Points, Total_Points. people -> People_ID, Name, Age, Height, Hometown. | Joins: gymnast.Gymnast_ID = people.Peop... | what is the total point count of the youngest gymnast? |
gymnast | select t1.total_points from gymnast as t1 join people as t2 on t1.gymnast_id = t2.people_id order by t2.age asc limit 1 | Question: return the total points of the gymnast with the lowest age. | Tables: gymnast -> Gymnast_ID, Floor_Exercise_Points, Pommel_Horse_Points, Rings_Points, Vault_Points, Parallel_Bars_Points, Horizontal_Bar_Points, Total_Points. people -> People_ID, Name, Age, Height, Hometown. | Joins: gymnast.Gymnast_ID = people... | return the total points of the gymnast with the lowest age. |
gymnast | select avg(t2.age) from gymnast as t1 join people as t2 on t1.gymnast_id = t2.people_id | Question: what is the average age of all gymnasts? | Tables: gymnast -> Gymnast_ID, Floor_Exercise_Points, Pommel_Horse_Points, Rings_Points, Vault_Points, Parallel_Bars_Points, Horizontal_Bar_Points, Total_Points. people -> People_ID, Name, Age, Height, Hometown. | Joins: gymnast.Gymnast_ID = people.People_ID, | what is the average age of all gymnasts? |
gymnast | select avg(t2.age) from gymnast as t1 join people as t2 on t1.gymnast_id = t2.people_id | Question: return the average age across all gymnasts. | Tables: gymnast -> Gymnast_ID, Floor_Exercise_Points, Pommel_Horse_Points, Rings_Points, Vault_Points, Parallel_Bars_Points, Horizontal_Bar_Points, Total_Points. people -> People_ID, Name, Age, Height, Hometown. | Joins: gymnast.Gymnast_ID = people.People_ID, | return the average age across all gymnasts. |
gymnast | select distinct t2.hometown from gymnast as t1 join people as t2 on t1.gymnast_id = t2.people_id where t1.total_points > 57.5 | Question: what are the distinct hometowns of gymnasts with total points more than 57.5? | Tables: gymnast -> Gymnast_ID, Floor_Exercise_Points, Pommel_Horse_Points, Rings_Points, Vault_Points, Parallel_Bars_Points, Horizontal_Bar_Points, Total_Points. people -> People_ID, Name, Age, Height, Hometown. | Joins: gymnast.G... | what are the distinct hometowns of gymnasts with total points more than 57.5? |
gymnast | select distinct t2.hometown from gymnast as t1 join people as t2 on t1.gymnast_id = t2.people_id where t1.total_points > 57.5 | Question: give the different hometowns of gymnasts that have a total point score of above 57.5. | Tables: gymnast -> Gymnast_ID, Floor_Exercise_Points, Pommel_Horse_Points, Rings_Points, Vault_Points, Parallel_Bars_Points, Horizontal_Bar_Points, Total_Points. people -> People_ID, Name, Age, Height, Hometown. | Joins: g... | give the different hometowns of gymnasts that have a total point score of above 57.5. |
gymnast | select t2.hometown , count(*) from gymnast as t1 join people as t2 on t1.gymnast_id = t2.people_id group by t2.hometown | Question: what are the hometowns of gymnasts and the corresponding number of gymnasts? | Tables: gymnast -> Gymnast_ID, Floor_Exercise_Points, Pommel_Horse_Points, Rings_Points, Vault_Points, Parallel_Bars_Points, Horizontal_Bar_Points, Total_Points. people -> People_ID, Name, Age, Height, Hometown. | Joins: gymnast.Gy... | what are the hometowns of gymnasts and the corresponding number of gymnasts? |
gymnast | select t2.hometown , count(*) from gymnast as t1 join people as t2 on t1.gymnast_id = t2.people_id group by t2.hometown | Question: how many gymnasts are from each hometown? | Tables: gymnast -> Gymnast_ID, Floor_Exercise_Points, Pommel_Horse_Points, Rings_Points, Vault_Points, Parallel_Bars_Points, Horizontal_Bar_Points, Total_Points. people -> People_ID, Name, Age, Height, Hometown. | Joins: gymnast.Gymnast_ID = people.People_ID, | how many gymnasts are from each hometown? |
gymnast | select t2.hometown from gymnast as t1 join people as t2 on t1.gymnast_id = t2.people_id group by t2.hometown order by count(*) desc limit 1 | Question: what is the most common hometown of gymnasts? | Tables: gymnast -> Gymnast_ID, Floor_Exercise_Points, Pommel_Horse_Points, Rings_Points, Vault_Points, Parallel_Bars_Points, Horizontal_Bar_Points, Total_Points. people -> People_ID, Name, Age, Height, Hometown. | Joins: gymnast.Gymnast_ID = people.People_ID, | what is the most common hometown of gymnasts? |
gymnast | select t2.hometown from gymnast as t1 join people as t2 on t1.gymnast_id = t2.people_id group by t2.hometown order by count(*) desc limit 1 | Question: return the hometown that is most common among gymnasts. | Tables: gymnast -> Gymnast_ID, Floor_Exercise_Points, Pommel_Horse_Points, Rings_Points, Vault_Points, Parallel_Bars_Points, Horizontal_Bar_Points, Total_Points. people -> People_ID, Name, Age, Height, Hometown. | Joins: gymnast.Gymnast_ID = people.Peo... | return the hometown that is most common among gymnasts. |
gymnast | select t2.hometown from gymnast as t1 join people as t2 on t1.gymnast_id = t2.people_id group by t2.hometown having count(*) >= 2 | Question: what are the hometowns that are shared by at least two gymnasts? | Tables: gymnast -> Gymnast_ID, Floor_Exercise_Points, Pommel_Horse_Points, Rings_Points, Vault_Points, Parallel_Bars_Points, Horizontal_Bar_Points, Total_Points. people -> People_ID, Name, Age, Height, Hometown. | Joins: gymnast.Gymnast_ID = p... | what are the hometowns that are shared by at least two gymnasts? |
gymnast | select t2.hometown from gymnast as t1 join people as t2 on t1.gymnast_id = t2.people_id group by t2.hometown having count(*) >= 2 | Question: give the hometowns from which two or more gymnasts are from. | Tables: gymnast -> Gymnast_ID, Floor_Exercise_Points, Pommel_Horse_Points, Rings_Points, Vault_Points, Parallel_Bars_Points, Horizontal_Bar_Points, Total_Points. people -> People_ID, Name, Age, Height, Hometown. | Joins: gymnast.Gymnast_ID = peopl... | give the hometowns from which two or more gymnasts are from. |
gymnast | select t2.name from gymnast as t1 join people as t2 on t1.gymnast_id = t2.people_id order by t2.height asc | Question: list the names of gymnasts in ascending order by their heights. | Tables: gymnast -> Gymnast_ID, Floor_Exercise_Points, Pommel_Horse_Points, Rings_Points, Vault_Points, Parallel_Bars_Points, Horizontal_Bar_Points, Total_Points. people -> People_ID, Name, Age, Height, Hometown. | Joins: gymnast.Gymnast_ID = pe... | list the names of gymnasts in ascending order by their heights. |
gymnast | select t2.name from gymnast as t1 join people as t2 on t1.gymnast_id = t2.people_id order by t2.height asc | Question: what are the names of gymnasts, ordered by their heights ascending? | Tables: gymnast -> Gymnast_ID, Floor_Exercise_Points, Pommel_Horse_Points, Rings_Points, Vault_Points, Parallel_Bars_Points, Horizontal_Bar_Points, Total_Points. people -> People_ID, Name, Age, Height, Hometown. | Joins: gymnast.Gymnast_ID ... | what are the names of gymnasts, ordered by their heights ascending? |
gymnast | select distinct hometown from people except select distinct t2.hometown from gymnast as t1 join people as t2 on t1.gymnast_id = t2.people_id | Question: list the distinct hometowns that are not associated with any gymnast. | Tables: gymnast -> Gymnast_ID, Floor_Exercise_Points, Pommel_Horse_Points, Rings_Points, Vault_Points, Parallel_Bars_Points, Horizontal_Bar_Points, Total_Points. people -> People_ID, Name, Age, Height, Hometown. | Joins: gymnast.Gymnast_I... | list the distinct hometowns that are not associated with any gymnast. |
gymnast | select distinct hometown from people except select distinct t2.hometown from gymnast as t1 join people as t2 on t1.gymnast_id = t2.people_id | Question: from which hometowns did no gymnasts come from? | Tables: gymnast -> Gymnast_ID, Floor_Exercise_Points, Pommel_Horse_Points, Rings_Points, Vault_Points, Parallel_Bars_Points, Horizontal_Bar_Points, Total_Points. people -> People_ID, Name, Age, Height, Hometown. | Joins: gymnast.Gymnast_ID = people.People_ID, | from which hometowns did no gymnasts come from? |
gymnast | select hometown from people where age > 23 intersect select hometown from people where age < 20 | Question: show the hometowns shared by people older than 23 and younger than 20. | Tables: gymnast -> Gymnast_ID, Floor_Exercise_Points, Pommel_Horse_Points, Rings_Points, Vault_Points, Parallel_Bars_Points, Horizontal_Bar_Points, Total_Points. people -> People_ID, Name, Age, Height, Hometown. | Joins: gymnast.Gymnast_... | show the hometowns shared by people older than 23 and younger than 20. |
gymnast | select hometown from people where age > 23 intersect select hometown from people where age < 20 | Question: from which hometowns did both people older than 23 and younger than 20 come from? | Tables: gymnast -> Gymnast_ID, Floor_Exercise_Points, Pommel_Horse_Points, Rings_Points, Vault_Points, Parallel_Bars_Points, Horizontal_Bar_Points, Total_Points. people -> People_ID, Name, Age, Height, Hometown. | Joins: gymna... | from which hometowns did both people older than 23 and younger than 20 come from? |
gymnast | select count(distinct hometown) from people | Question: how many distinct hometowns did these people have? | Tables: gymnast -> Gymnast_ID, Floor_Exercise_Points, Pommel_Horse_Points, Rings_Points, Vault_Points, Parallel_Bars_Points, Horizontal_Bar_Points, Total_Points. people -> People_ID, Name, Age, Height, Hometown. | Joins: gymnast.Gymnast_ID = people.People_I... | how many distinct hometowns did these people have? |
gymnast | select count(distinct hometown) from people | Question: count the number of different hometowns of these people. | Tables: gymnast -> Gymnast_ID, Floor_Exercise_Points, Pommel_Horse_Points, Rings_Points, Vault_Points, Parallel_Bars_Points, Horizontal_Bar_Points, Total_Points. people -> People_ID, Name, Age, Height, Hometown. | Joins: gymnast.Gymnast_ID = people.Pe... | count the number of different hometowns of these people. |
gymnast | select t2.age from gymnast as t1 join people as t2 on t1.gymnast_id = t2.people_id order by t1.total_points desc | Question: show the ages of gymnasts in descending order of total points. | Tables: gymnast -> Gymnast_ID, Floor_Exercise_Points, Pommel_Horse_Points, Rings_Points, Vault_Points, Parallel_Bars_Points, Horizontal_Bar_Points, Total_Points. people -> People_ID, Name, Age, Height, Hometown. | Joins: gymnast.Gymnast_ID = peo... | show the ages of gymnasts in descending order of total points. |
gymnast | select t2.age from gymnast as t1 join people as t2 on t1.gymnast_id = t2.people_id order by t1.total_points desc | Question: what are the ages of the gymnasts, ordered descending by their total points? | Tables: gymnast -> Gymnast_ID, Floor_Exercise_Points, Pommel_Horse_Points, Rings_Points, Vault_Points, Parallel_Bars_Points, Horizontal_Bar_Points, Total_Points. people -> People_ID, Name, Age, Height, Hometown. | Joins: gymnast.Gy... | what are the ages of the gymnasts, ordered descending by their total points? |
small_bank_1 | select sum(t2.balance) from accounts as t1 join savings as t2 on t1.custid = t2.custid where t1.name != 'brown' | Question: find the total savings balance of all accounts except the account with name brown. | Tables: ACCOUNTS -> custid, name. SAVINGS -> custid, balance. CHECKING -> custid, balance. | Joins: SAVINGS.custid = ACCOUNTS.custid, CHECKING.custid = ACCOUNTS.custid, | find the total savings balance of all accounts except the account with name brown. |
small_bank_1 | select sum(t2.balance) from accounts as t1 join savings as t2 on t1.custid = t2.custid where t1.name != 'brown' | Question: what is the total balance of savings accounts not belonging to someone with the name brown? | Tables: ACCOUNTS -> custid, name. SAVINGS -> custid, balance. CHECKING -> custid, balance. | Joins: SAVINGS.custid = ACCOUNTS.custid, CHECKING.custid = ACCOUNTS.custid, | what is the total balance of savings accounts not belonging to someone with the name brown? |
small_bank_1 | select count(*) from accounts | Question: how many accounts are there in total? | Tables: ACCOUNTS -> custid, name. SAVINGS -> custid, balance. CHECKING -> custid, balance. | Joins: SAVINGS.custid = ACCOUNTS.custid, CHECKING.custid = ACCOUNTS.custid, | how many accounts are there in total? |
small_bank_1 | select count(*) from accounts | Question: count the number of accounts. | Tables: ACCOUNTS -> custid, name. SAVINGS -> custid, balance. CHECKING -> custid, balance. | Joins: SAVINGS.custid = ACCOUNTS.custid, CHECKING.custid = ACCOUNTS.custid, | count the number of accounts. |
small_bank_1 | select sum(balance) from checking | Question: what is the total checking balance in all accounts? | Tables: ACCOUNTS -> custid, name. SAVINGS -> custid, balance. CHECKING -> custid, balance. | Joins: SAVINGS.custid = ACCOUNTS.custid, CHECKING.custid = ACCOUNTS.custid, | what is the total checking balance in all accounts? |
small_bank_1 | select sum(balance) from checking | Question: find the total balance across checking accounts. | Tables: ACCOUNTS -> custid, name. SAVINGS -> custid, balance. CHECKING -> custid, balance. | Joins: SAVINGS.custid = ACCOUNTS.custid, CHECKING.custid = ACCOUNTS.custid, | find the total balance across checking accounts. |
small_bank_1 | select avg(balance) from checking | Question: find the average checking balance. | Tables: ACCOUNTS -> custid, name. SAVINGS -> custid, balance. CHECKING -> custid, balance. | Joins: SAVINGS.custid = ACCOUNTS.custid, CHECKING.custid = ACCOUNTS.custid, | find the average checking balance. |
small_bank_1 | select avg(balance) from checking | Question: what is the average balance in checking accounts? | Tables: ACCOUNTS -> custid, name. SAVINGS -> custid, balance. CHECKING -> custid, balance. | Joins: SAVINGS.custid = ACCOUNTS.custid, CHECKING.custid = ACCOUNTS.custid, | what is the average balance in checking accounts? |
small_bank_1 | select count(*) from savings where balance > (select avg(balance) from savings) | Question: how many accounts have a savings balance above the average savings balance? | Tables: ACCOUNTS -> custid, name. SAVINGS -> custid, balance. CHECKING -> custid, balance. | Joins: SAVINGS.custid = ACCOUNTS.custid, CHECKING.custid = ACCOUNTS.custid, | how many accounts have a savings balance above the average savings balance? |
small_bank_1 | select count(*) from savings where balance > (select avg(balance) from savings) | Question: find the number of accounts with a savings balance that is higher than the average savings balance. | Tables: ACCOUNTS -> custid, name. SAVINGS -> custid, balance. CHECKING -> custid, balance. | Joins: SAVINGS.custid = ACCOUNTS.custid, CHECKING.custid = ACCOUNTS.custid, | find the number of accounts with a savings balance that is higher than the average savings balance. |
small_bank_1 | select t1.custid , t1.name from accounts as t1 join checking as t2 on t1.custid = t2.custid where t2.balance < (select max(balance) from checking) | Question: find the name and id of accounts whose checking balance is below the maximum checking balance. | Tables: ACCOUNTS -> custid, name. SAVINGS -> custid, balance. CHECKING -> custid, balance. | Joins: SAVINGS.custid = ACCOUNTS.custid, CHECKING.custid = ACCOUNTS.custid, | find the name and id of accounts whose checking balance is below the maximum checking balance. |
small_bank_1 | select t1.custid , t1.name from accounts as t1 join checking as t2 on t1.custid = t2.custid where t2.balance < (select max(balance) from checking) | Question: what are the customer id and name corresponding to accounts with a checking balance less than the largest checking balance? | Tables: ACCOUNTS -> custid, name. SAVINGS -> custid, balance. CHECKING -> custid, balance. | Joins: SAVINGS.custid = ACCOUNTS.custid, CHECKING.custid = ACCOUNTS.custid, | what are the customer id and name corresponding to accounts with a checking balance less than the largest checking balance? |
small_bank_1 | select t2.balance from accounts as t1 join checking as t2 on t1.custid = t2.custid where t1.name like '%ee%' | Question: what is the checking balance of the account whose owners name contains the substring ee? | Tables: ACCOUNTS -> custid, name. SAVINGS -> custid, balance. CHECKING -> custid, balance. | Joins: SAVINGS.custid = ACCOUNTS.custid, CHECKING.custid = ACCOUNTS.custid, | what is the checking balance of the account whose owners name contains the substring ee? |
small_bank_1 | select t2.balance from accounts as t1 join checking as t2 on t1.custid = t2.custid where t1.name like '%ee%' | Question: find the balance of the checking account belonging to an owner whose name contains 'ee'. | Tables: ACCOUNTS -> custid, name. SAVINGS -> custid, balance. CHECKING -> custid, balance. | Joins: SAVINGS.custid = ACCOUNTS.custid, CHECKING.custid = ACCOUNTS.custid, | find the balance of the checking account belonging to an owner whose name contains 'ee'. |
small_bank_1 | select t2.balance , t3.balance from accounts as t1 join checking as t2 on t1.custid = t2.custid join savings as t3 on t1.custid = t3.custid where t1.name = 'brown' | Question: find the checking balance and saving balance in the browns account. | Tables: ACCOUNTS -> custid, name. SAVINGS -> custid, balance. CHECKING -> custid, balance. | Joins: SAVINGS.custid = ACCOUNTS.custid, CHECKING.custid = ACCOUNTS.custid, | find the checking balance and saving balance in the browns account. |
small_bank_1 | select t2.balance , t3.balance from accounts as t1 join checking as t2 on t1.custid = t2.custid join savings as t3 on t1.custid = t3.custid where t1.name = 'brown' | Question: what are the checking and savings balances in accounts belonging to brown? | Tables: ACCOUNTS -> custid, name. SAVINGS -> custid, balance. CHECKING -> custid, balance. | Joins: SAVINGS.custid = ACCOUNTS.custid, CHECKING.custid = ACCOUNTS.custid, | what are the checking and savings balances in accounts belonging to brown? |
small_bank_1 | select t1.name from accounts as t1 join checking as t2 on t1.custid = t2.custid where t2.balance > (select avg(balance) from checking) intersect select t1.name from accounts as t1 join savings as t2 on t1.custid = t2.custid where t2.balance < (select avg(balance) from savings) | Question: find the names of accounts whose checking balance is above the average checking balance, but savings balance is below the average savings balance. | Tables: ACCOUNTS -> custid, name. SAVINGS -> custid, balance. CHECKING -> custid, balance. | Joins: SAVINGS.custid = ACCOUNTS.custid, CHECKING.custid = ACCOUNTS.... | find the names of accounts whose checking balance is above the average checking balance, but savings balance is below the average savings balance. |
small_bank_1 | select t1.name from accounts as t1 join checking as t2 on t1.custid = t2.custid where t2.balance > (select avg(balance) from checking) intersect select t1.name from accounts as t1 join savings as t2 on t1.custid = t2.custid where t2.balance < (select avg(balance) from savings) | Question: what are the names of accounts with checking balances greater than the average checking balance and savings balances below the average savings balance? | Tables: ACCOUNTS -> custid, name. SAVINGS -> custid, balance. CHECKING -> custid, balance. | Joins: SAVINGS.custid = ACCOUNTS.custid, CHECKING.custid = ACCO... | what are the names of accounts with checking balances greater than the average checking balance and savings balances below the average savings balance? |
small_bank_1 | select t2.balance from accounts as t1 join checking as t2 on t1.custid = t2.custid where t1.name in (select t1.name from accounts as t1 join savings as t2 on t1.custid = t2.custid where t2.balance > (select avg(balance) from savings)) | Question: find the checking balance of the accounts whose savings balance is higher than the average savings balance. | Tables: ACCOUNTS -> custid, name. SAVINGS -> custid, balance. CHECKING -> custid, balance. | Joins: SAVINGS.custid = ACCOUNTS.custid, CHECKING.custid = ACCOUNTS.custid, | find the checking balance of the accounts whose savings balance is higher than the average savings balance. |
small_bank_1 | select t2.balance from accounts as t1 join checking as t2 on t1.custid = t2.custid where t1.name in (select t1.name from accounts as t1 join savings as t2 on t1.custid = t2.custid where t2.balance > (select avg(balance) from savings)) | Question: what are the balances of checking accounts belonging to people with savings balances greater than the average savings balance? | Tables: ACCOUNTS -> custid, name. SAVINGS -> custid, balance. CHECKING -> custid, balance. | Joins: SAVINGS.custid = ACCOUNTS.custid, CHECKING.custid = ACCOUNTS.custid, | what are the balances of checking accounts belonging to people with savings balances greater than the average savings balance? |
small_bank_1 | select name from accounts order by name | Question: list all customers names in the alphabetical order. | Tables: ACCOUNTS -> custid, name. SAVINGS -> custid, balance. CHECKING -> custid, balance. | Joins: SAVINGS.custid = ACCOUNTS.custid, CHECKING.custid = ACCOUNTS.custid, | list all customers names in the alphabetical order. |
small_bank_1 | select name from accounts order by name | Question: what are the names of all the customers in alphabetical order? | Tables: ACCOUNTS -> custid, name. SAVINGS -> custid, balance. CHECKING -> custid, balance. | Joins: SAVINGS.custid = ACCOUNTS.custid, CHECKING.custid = ACCOUNTS.custid, | what are the names of all the customers in alphabetical order? |
small_bank_1 | select t1.name from accounts as t1 join checking as t2 on t1.custid = t2.custid join savings as t3 on t1.custid = t3.custid order by t2.balance + t3.balance limit 1 | Question: find the name of account that has the lowest total checking and saving balance. | Tables: ACCOUNTS -> custid, name. SAVINGS -> custid, balance. CHECKING -> custid, balance. | Joins: SAVINGS.custid = ACCOUNTS.custid, CHECKING.custid = ACCOUNTS.custid, | find the name of account that has the lowest total checking and saving balance. |
small_bank_1 | select t1.name from accounts as t1 join checking as t2 on t1.custid = t2.custid join savings as t3 on t1.custid = t3.custid order by t2.balance + t3.balance limit 1 | Question: what is the name corresponding to the accoung with the lowest sum of checking and savings balances? | Tables: ACCOUNTS -> custid, name. SAVINGS -> custid, balance. CHECKING -> custid, balance. | Joins: SAVINGS.custid = ACCOUNTS.custid, CHECKING.custid = ACCOUNTS.custid, | what is the name corresponding to the accoung with the lowest sum of checking and savings balances? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.