richardr1126/spider-context-instruct huggingface dataset:
### Instruction:

Convert text to sql: Return the hometown that is most common among gymnasts. | 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 | gymnast.gymnast_id = people.people_id | 

### Response:

select people.hometown from gymnast join people on gymnast.gymnast_id = people.people_id group by people.hometown order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: What are the hometowns that are shared by at least two gymnasts? | 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 | gymnast.gymnast_id = people.people_id | 

### Response:

select people.hometown from gymnast join people on gymnast.gymnast_id = people.people_id group by people.hometown having count ( * ) >= 2

### Instruction:

Convert text to sql: Give the hometowns from which two or more gymnasts are from. | 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 | gymnast.gymnast_id = people.people_id | 

### Response:

select people.hometown from gymnast join people on gymnast.gymnast_id = people.people_id group by people.hometown having count ( * ) >= 2

### Instruction:

Convert text to sql: List the names of gymnasts in ascending order by their heights. | 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 | gymnast.gymnast_id = people.people_id | 

### Response:

select people.name from gymnast join people on gymnast.gymnast_id = people.people_id order by people.height asc

### Instruction:

Convert text to sql: What are the names of gymnasts, ordered by their heights ascending? | 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 | gymnast.gymnast_id = people.people_id | 

### Response:

select people.name from gymnast join people on gymnast.gymnast_id = people.people_id order by people.height asc

### Instruction:

Convert text to sql: List the distinct hometowns that are not associated with any gymnast. | 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 | gymnast.gymnast_id = people.people_id | 

### Response:

select distinct hometown from people except select distinct people.hometown from gymnast join people on gymnast.gymnast_id = people.people_id
### Instruction:

Convert text to sql: From which hometowns did no gymnasts come from? | 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 | gymnast.gymnast_id = people.people_id | 

### Response:

select distinct hometown from people except select distinct people.hometown from gymnast join people on gymnast.gymnast_id = people.people_id

### Instruction:

Convert text to sql: Show the hometowns shared by people older than 23 and younger than 20. | 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 | gymnast.gymnast_id = people.people_id | 

### Response:

select hometown from people where age > 23 intersect select hometown from people where age < 20

### Instruction:

Convert text to sql: From which hometowns did both people older than 23 and younger than 20 come from? | 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 | gymnast.gymnast_id = people.people_id | 

### Response:

select hometown from people where age > 23 intersect select hometown from people where age < 20

### Instruction:

Convert text to sql: How many distinct hometowns did these people have? | 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 | gymnast.gymnast_id = people.people_id | 

### Response:

select count ( distinct hometown ) from people

### Instruction:

Convert text to sql: Count the number of different hometowns of these people. | 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 | gymnast.gymnast_id = people.people_id | 

### Response:

select count ( distinct hometown ) from people

### Instruction:

Convert text to sql: Show the ages of gymnasts in descending order of total points. | 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 | gymnast.gymnast_id = people.people_id | 

### Response:

select people.age from gymnast join people on gymnast.gymnast_id = people.people_id order by gymnast.total_points desc
### Instruction:

Convert text to sql: What are the ages of the gymnasts, ordered descending by their total points? | 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 | gymnast.gymnast_id = people.people_id | 

### Response:

select people.age from gymnast join people on gymnast.gymnast_id = people.people_id order by gymnast.total_points desc
### Instruction:

Convert text to sql: Find the total savings balance of all accounts except the account with name 'Brown'. | accounts : custid , name | savings : custid , balance | checking : custid , balance | savings.custid = accounts.custid | checking.custid = accounts.custid | 

### Response:

select sum ( savings.balance ) from accounts join savings on accounts.custid = savings.custid where accounts.name != 'Brown'

### Instruction:

Convert text to sql: What is the total balance of savings accounts not belonging to someone with the name Brown? | accounts : custid , name | savings : custid , balance | checking : custid , balance | savings.custid = accounts.custid | checking.custid = accounts.custid | 

### Response:

select sum ( savings.balance ) from accounts join savings on accounts.custid = savings.custid where accounts.name != 'Brown'

### Instruction:

Convert text to sql: How many accounts are there in total? | accounts : custid , name | savings : custid , balance | checking : custid , balance | savings.custid = accounts.custid | checking.custid = accounts.custid | 

### Response:

select count ( * ) from accounts

### Instruction:

Convert text to sql: Count the number of accounts. | accounts : custid , name | savings : custid , balance | checking : custid , balance | savings.custid = accounts.custid | checking.custid = accounts.custid | 

### Response:

select count ( * ) from accounts

### Instruction:

Convert text to sql: What is the total checking balance in all accounts? | accounts : custid , name | savings : custid , balance | checking : custid , balance | savings.custid = accounts.custid | checking.custid = accounts.custid | 

### Response:

select sum ( balance ) from checking

### Instruction:

Convert text to sql: Find the total balance across checking accounts. | accounts : custid , name | savings : custid , balance | checking : custid , balance | savings.custid = accounts.custid | checking.custid = accounts.custid | 

### Response:

select sum ( balance ) from checking

### Instruction:

Convert text to sql: Find the average checking balance. | accounts : custid , name | savings : custid , balance | checking : custid , balance | savings.custid = accounts.custid | checking.custid = accounts.custid | 

### Response:

select avg ( balance ) from checking

### Instruction:

Convert text to sql: What is the average balance in checking accounts? | accounts : custid , name | savings : custid , balance | checking : custid , balance | savings.custid = accounts.custid | checking.custid = accounts.custid | 

### Response:

select avg ( balance ) from checking

### Instruction:

Convert text to sql: How many accounts have a savings balance above the average savings balance? | accounts : custid , name | savings : custid , balance | checking : custid , balance | savings.custid = accounts.custid | checking.custid = accounts.custid | 

### Response:

select count ( * ) from savings where balance > ( select avg ( balance ) from savings )
### Instruction:

Convert text to sql: Find the number of accounts with a savings balance that is higher than the average savings balance. | accounts : custid , name | savings : custid , balance | checking : custid , balance | savings.custid = accounts.custid | checking.custid = accounts.custid | 

### Response:

select count ( * ) from savings where balance > ( select avg ( balance ) from savings )

### Instruction:

Convert text to sql: Find the name and id of accounts whose checking balance is below the maximum checking balance. | accounts : custid , name | savings : custid , balance | checking : custid , balance | savings.custid = accounts.custid | checking.custid = accounts.custid | 

### Response:

select accounts.custid , accounts.name from accounts join checking on accounts.custid = checking.custid where checking.balance < ( select max ( balance ) from checking )

### Instruction:

Convert text to sql: What are the customer id and name corresponding to accounts with a checking balance less than the largest checking balance? | accounts : custid , name | savings : custid , balance | checking : custid , balance | savings.custid = accounts.custid | checking.custid = accounts.custid | 

### Response:

select accounts.custid , accounts.name from accounts join checking on accounts.custid = checking.custid where checking.balance < ( select max ( balance ) from checking )

### Instruction:

Convert text to sql: What is the checking balance of the account whose owner's name contains the substring 'ee'? | accounts : custid , name | savings : custid , balance | checking : custid , balance | savings.custid = accounts.custid | checking.custid = accounts.custid | 

### Response:

select checking.balance from accounts join checking on accounts.custid = checking.custid where accounts.name like '%ee%'

### Instruction:

Convert text to sql: Find the balance of the checking account belonging to an owner whose name contains 'ee'. | accounts : custid , name | savings : custid , balance | checking : custid , balance | savings.custid = accounts.custid | checking.custid = accounts.custid | 

### Response:

select checking.balance from accounts join checking on accounts.custid = checking.custid where accounts.name like '%ee%'

### Instruction:

Convert text to sql: Find the checking balance and saving balance in the Brown's account. | accounts : custid , name | savings : custid , balance | checking : custid , balance | savings.custid = accounts.custid | checking.custid = accounts.custid | 

### Response:

select checking.balance , savings.balance from accounts join checking on accounts.custid = checking.custid join savings on accounts.custid = savings.custid where accounts.name = 'Brown'

### Instruction:

Convert text to sql: What are the checking and savings balances in accounts belonging to Brown? | accounts : custid , name | savings : custid , balance | checking : custid , balance | savings.custid = accounts.custid | checking.custid = accounts.custid | 

### Response:

select checking.balance , savings.balance from accounts join checking on accounts.custid = checking.custid join savings on accounts.custid = savings.custid where accounts.name = 'Brown'
### Instruction:

Convert text to sql: Find the names of accounts whose checking balance is above the average checking balance, but savings balance is below the average savings balance. | accounts : custid , name | savings : custid , balance | checking : custid , balance | savings.custid = accounts.custid | checking.custid = accounts.custid | 

### Response:

select accounts.name from accounts join checking on accounts.custid = savings.custid where savings.balance > ( select avg ( balance ) from checking ) intersect select accounts.name from accounts join savings on accounts.custid = savings.custid where savings.balance < ( select avg ( balance ) from savings )

### Instruction:

Convert text to sql: What are the names of accounts with checking balances greater than the average checking balance and savings balances below the average savings balance? | accounts : custid , name | savings : custid , balance | checking : custid , balance | savings.custid = accounts.custid | checking.custid = accounts.custid | 

### Response:

select accounts.name from accounts join checking on accounts.custid = savings.custid where savings.balance > ( select avg ( balance ) from checking ) intersect select accounts.name from accounts join savings on accounts.custid = savings.custid where savings.balance < ( select avg ( balance ) from savings )

### Instruction:

Convert text to sql: Find the checking balance of the accounts whose savings balance is higher than the average savings balance. | accounts : custid , name | savings : custid , balance | checking : custid , balance | savings.custid = accounts.custid | checking.custid = accounts.custid | 

### Response:

select savings.balance from accounts join checking on accounts.custid = savings.custid where accounts.name in ( select accounts.name from accounts join savings on accounts.custid = savings.custid where savings.balance > ( select avg ( balance ) from savings ) )

### Instruction:

Convert text to sql: What are the balances of checking accounts belonging to people with savings balances greater than the average savings balance? | accounts : custid , name | savings : custid , balance | checking : custid , balance | savings.custid = accounts.custid | checking.custid = accounts.custid | 

### Response:

select savings.balance from accounts join checking on accounts.custid = savings.custid where accounts.name in ( select accounts.name from accounts join savings on accounts.custid = savings.custid where savings.balance > ( select avg ( balance ) from savings ) )

### Instruction:

Convert text to sql: List all customers' names in the alphabetical order. | accounts : custid , name | savings : custid , balance | checking : custid , balance | savings.custid = accounts.custid | checking.custid = accounts.custid | 

### Response:

select name from accounts order by name asc

### Instruction:

Convert text to sql: What are the names of all the customers in alphabetical order? | accounts : custid , name | savings : custid , balance | checking : custid , balance | savings.custid = accounts.custid | checking.custid = accounts.custid | 

### Response:

select name from accounts order by name asc
### Instruction:

Convert text to sql: Find the name of account that has the lowest total checking and saving balance. | accounts : custid , name | savings : custid , balance | checking : custid , balance | savings.custid = accounts.custid | checking.custid = accounts.custid | 

### Response:

select accounts.name from accounts join checking on accounts.custid = checking.custid join savings on accounts.custid = savings.custid order by checking.balance + savings.balance asc limit 1

### Instruction:

Convert text to sql: What is the name corresponding to the accoung with the lowest sum of checking and savings balances? | accounts : custid , name | savings : custid , balance | checking : custid , balance | savings.custid = accounts.custid | checking.custid = accounts.custid | 

### Response:

select accounts.name from accounts join checking on accounts.custid = checking.custid join savings on accounts.custid = savings.custid order by checking.balance + savings.balance asc limit 1

### Instruction:

Convert text to sql: Find the names and total checking and savings balances of accounts whose savings balance is higher than the average savings balance. | accounts : custid , name | savings : custid , balance | checking : custid , balance | savings.custid = accounts.custid | checking.custid = accounts.custid | 

### Response:

select accounts.name , checking.balance + savings.balance from accounts join checking on accounts.custid = checking.custid join savings on accounts.custid = savings.custid where savings.balance > ( select avg ( balance ) from savings )

### Instruction:

Convert text to sql: What are the names and sum of checking and savings balances for accounts with savings balances higher than the average savings balance? | accounts : custid , name | savings : custid , balance | checking : custid , balance | savings.custid = accounts.custid | checking.custid = accounts.custid | 

### Response:

select accounts.name , checking.balance + savings.balance from accounts join checking on accounts.custid = checking.custid join savings on accounts.custid = savings.custid where savings.balance > ( select avg ( balance ) from savings )

### Instruction:

Convert text to sql: Find the name and checking balance of the account with the lowest savings balance. | accounts : custid , name | savings : custid , balance | checking : custid , balance | savings.custid = accounts.custid | checking.custid = accounts.custid | 

### Response:

select accounts.name , checking.balance from accounts join checking on accounts.custid = checking.custid join savings on accounts.custid = savings.custid order by savings.balance asc limit 1

### Instruction:

Convert text to sql: What are the names and balances of checking accounts belonging to the customer with the lowest savings balance? | accounts : custid , name | savings : custid , balance | checking : custid , balance | savings.custid = accounts.custid | checking.custid = accounts.custid | 

### Response:

select accounts.name , checking.balance from accounts join checking on accounts.custid = checking.custid join savings on accounts.custid = savings.custid order by savings.balance asc limit 1
### Instruction:

Convert text to sql: Find the number of checking accounts for each account name. | accounts : custid , name | savings : custid , balance | checking : custid , balance | savings.custid = accounts.custid | checking.custid = accounts.custid | 

### Response:

select count ( * ) , accounts.name from accounts join checking on accounts.custid = checking.custid group by accounts.name

### Instruction:

Convert text to sql: What are the names of customers with accounts, and how many checking accounts do each of them have? | accounts : custid , name | savings : custid , balance | checking : custid , balance | savings.custid = accounts.custid | checking.custid = accounts.custid | 

### Response:

select count ( * ) , accounts.name from accounts join checking on accounts.custid = checking.custid group by accounts.name

### Instruction:

Convert text to sql: Find the total saving balance for each account name. | accounts : custid , name | savings : custid , balance | checking : custid , balance | savings.custid = accounts.custid | checking.custid = accounts.custid | 

### Response:

select sum ( savings.balance ) , accounts.name from accounts join savings on accounts.custid = savings.custid group by accounts.name

### Instruction:

Convert text to sql: What are the names of customers with accounts, and what are the total savings balances for each? | accounts : custid , name | savings : custid , balance | checking : custid , balance | savings.custid = accounts.custid | checking.custid = accounts.custid | 

### Response:

select sum ( savings.balance ) , accounts.name from accounts join savings on accounts.custid = savings.custid group by accounts.name

### Instruction:

Convert text to sql: Find the name of accounts whose checking balance is below the average checking balance. | accounts : custid , name | savings : custid , balance | checking : custid , balance | savings.custid = accounts.custid | checking.custid = accounts.custid | 

### Response:

select accounts.name from accounts join checking on accounts.custid = checking.custid where checking.balance < ( select avg ( balance ) from checking )

### Instruction:

Convert text to sql: What are the names of customers with checking balances lower than the average checking balance? | accounts : custid , name | savings : custid , balance | checking : custid , balance | savings.custid = accounts.custid | checking.custid = accounts.custid | 

### Response:

select accounts.name from accounts join checking on accounts.custid = checking.custid where checking.balance < ( select avg ( balance ) from checking )

### Instruction:

Convert text to sql: Find the saving balance of the account with the highest checking balance. | accounts : custid , name | savings : custid , balance | checking : custid , balance | savings.custid = accounts.custid | checking.custid = accounts.custid | 

### Response:

select savings.balance from accounts join checking on accounts.custid = checking.custid join savings on accounts.custid = savings.custid order by checking.balance desc limit 1