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

Convert text to sql: Find the total amount of loans offered by each bank branch. | bank : branch_id , bname , no_of_customers , city , state | customer : cust_id , cust_name , acc_type , acc_bal , no_of_loans , credit_score , branch_id , state | loan : loan_id , loan_type , cust_id , branch_id , amount | customer.branch_id = bank.branch_id | loan.branch_id = bank.branch_id | 

### Response:

select sum ( _ ) , _ from _ group by _ | select sum ( amount ) , bank.bname from bank join loan on bank.branch_id = loan.branch_id group by bank.bname
### Instruction:

Convert text to sql: What are the names of the different bank branches, and what are their total loan amounts? | bank : branch_id , bname , no_of_customers , city , state | customer : cust_id , cust_name , acc_type , acc_bal , no_of_loans , credit_score , branch_id , state | loan : loan_id , loan_type , cust_id , branch_id , amount | customer.branch_id = bank.branch_id | loan.branch_id = bank.branch_id | 

### Response:

select sum ( _ ) , _ from _ group by _ | select sum ( amount ) , bank.bname from bank join loan on bank.branch_id = loan.branch_id group by bank.bname
### Instruction:

Convert text to sql: Find the name of customers who have more than one loan. | bank : branch_id , bname , no_of_customers , city , state | customer : cust_id , cust_name , acc_type , acc_bal , no_of_loans , credit_score , branch_id , state | loan : loan_id , loan_type , cust_id , branch_id , amount | customer.branch_id = bank.branch_id | loan.branch_id = bank.branch_id | 

### Response:

select _ from _ group by _ having count ( _ ) > _ | select customer.cust_name from customer join loan on customer.cust_id = loan.cust_id group by customer.cust_name having count ( * ) > 1
### Instruction:

Convert text to sql: What are the names of customers who have taken out more than one loan? | bank : branch_id , bname , no_of_customers , city , state | customer : cust_id , cust_name , acc_type , acc_bal , no_of_loans , credit_score , branch_id , state | loan : loan_id , loan_type , cust_id , branch_id , amount | customer.branch_id = bank.branch_id | loan.branch_id = bank.branch_id | 

### Response:

select _ from _ group by _ having count ( _ ) > _ | select customer.cust_name from customer join loan on customer.cust_id = loan.cust_id group by customer.cust_name having count ( * ) > 1
### Instruction:

Convert text to sql: Find the name and account balance of the customers who have loans with a total amount of more than 5000. | bank : branch_id , bname , no_of_customers , city , state | customer : cust_id , cust_name , acc_type , acc_bal , no_of_loans , credit_score , branch_id , state | loan : loan_id , loan_type , cust_id , branch_id , amount | customer.branch_id = bank.branch_id | loan.branch_id = bank.branch_id | 

### Response:

select _ from _ group by _ having sum ( _ ) > _ | select customer.cust_name , customer.acc_type from customer join loan on customer.cust_id = loan.cust_id group by customer.cust_name having sum ( loan.amount ) > 5000
### Instruction:

Convert text to sql: What are the names and account balances for customers who have taken a total amount of more than 5000 in loans? | bank : branch_id , bname , no_of_customers , city , state | customer : cust_id , cust_name , acc_type , acc_bal , no_of_loans , credit_score , branch_id , state | loan : loan_id , loan_type , cust_id , branch_id , amount | customer.branch_id = bank.branch_id | loan.branch_id = bank.branch_id | 

### Response:

select _ from _ group by _ having sum ( _ ) > _ | select customer.cust_name , customer.acc_type from customer join loan on customer.cust_id = loan.cust_id group by customer.cust_name having sum ( loan.amount ) > 5000
### Instruction:

Convert text to sql: Find the name of bank branch that provided the greatest total amount of loans. | bank : branch_id , bname , no_of_customers , city , state | customer : cust_id , cust_name , acc_type , acc_bal , no_of_loans , credit_score , branch_id , state | loan : loan_id , loan_type , cust_id , branch_id , amount | customer.branch_id = bank.branch_id | loan.branch_id = bank.branch_id | 

### Response:

select _ from _ group by _ order by sum ( _ ) desc limit _ | select bank.bname from bank join loan on bank.branch_id = loan.branch_id group by bank.bname order by sum ( loan.amount ) desc limit 1
### Instruction:

Convert text to sql: What is the name of the bank branch that has lent the greatest amount? | bank : branch_id , bname , no_of_customers , city , state | customer : cust_id , cust_name , acc_type , acc_bal , no_of_loans , credit_score , branch_id , state | loan : loan_id , loan_type , cust_id , branch_id , amount | customer.branch_id = bank.branch_id | loan.branch_id = bank.branch_id | 

### Response:

select _ from _ group by _ order by sum ( _ ) desc limit _ | select bank.bname from bank join loan on bank.branch_id = loan.branch_id group by bank.bname order by sum ( loan.amount ) desc limit 1
### Instruction:

Convert text to sql: Find the name of bank branch that provided the greatest total amount of loans to customers with credit score is less than 100. | bank : branch_id , bname , no_of_customers , city , state | customer : cust_id , cust_name , acc_type , acc_bal , no_of_loans , credit_score , branch_id , state | loan : loan_id , loan_type , cust_id , branch_id , amount | customer.branch_id = bank.branch_id | loan.branch_id = bank.branch_id | 

### Response:

select _ from _ where _ group by _ order by sum ( _ ) desc limit _ | select bank.bname from loan join bank on loan.branch_id = bank.branch_id join customer on loan.cust_id = customer.cust_id where customer.credit_score < 100 group by bank.bname order by sum ( loan.amount ) desc limit 1
### Instruction:

Convert text to sql: What is the name of the bank branch that has lended the largest total amount in loans, specifically to customers with credit scores below 100? | bank : branch_id , bname , no_of_customers , city , state | customer : cust_id , cust_name , acc_type , acc_bal , no_of_loans , credit_score , branch_id , state | loan : loan_id , loan_type , cust_id , branch_id , amount | customer.branch_id = bank.branch_id | loan.branch_id = bank.branch_id | 

### Response:

select _ from _ where _ group by _ order by sum ( _ ) desc limit _ | select bank.bname from loan join bank on loan.branch_id = bank.branch_id join customer on loan.cust_id = customer.cust_id where customer.credit_score < 100 group by bank.bname order by sum ( loan.amount ) desc limit 1
### Instruction:

Convert text to sql: Find the name of bank branches that provided some loans. | bank : branch_id , bname , no_of_customers , city , state | customer : cust_id , cust_name , acc_type , acc_bal , no_of_loans , credit_score , branch_id , state | loan : loan_id , loan_type , cust_id , branch_id , amount | customer.branch_id = bank.branch_id | loan.branch_id = bank.branch_id | 

### Response:

select distinct _ from _ | select distinct bank.bname from bank join loan on bank.branch_id = loan.branch_id
### Instruction:

Convert text to sql: What are the names of the different banks that have provided loans? | bank : branch_id , bname , no_of_customers , city , state | customer : cust_id , cust_name , acc_type , acc_bal , no_of_loans , credit_score , branch_id , state | loan : loan_id , loan_type , cust_id , branch_id , amount | customer.branch_id = bank.branch_id | loan.branch_id = bank.branch_id | 

### Response:

select distinct _ from _ | select distinct bank.bname from bank join loan on bank.branch_id = loan.branch_id
### Instruction:

Convert text to sql: Find the name and credit score of the customers who have some loans. | bank : branch_id , bname , no_of_customers , city , state | customer : cust_id , cust_name , acc_type , acc_bal , no_of_loans , credit_score , branch_id , state | loan : loan_id , loan_type , cust_id , branch_id , amount | customer.branch_id = bank.branch_id | loan.branch_id = bank.branch_id | 

### Response:

select distinct _ from _ | select distinct customer.cust_name , customer.credit_score from customer join loan on customer.cust_id = loan.cust_id
### Instruction:

Convert text to sql: What are the different names and credit scores of customers who have taken a loan? | bank : branch_id , bname , no_of_customers , city , state | customer : cust_id , cust_name , acc_type , acc_bal , no_of_loans , credit_score , branch_id , state | loan : loan_id , loan_type , cust_id , branch_id , amount | customer.branch_id = bank.branch_id | loan.branch_id = bank.branch_id | 

### Response:

select distinct _ from _ | select distinct customer.cust_name , customer.credit_score from customer join loan on customer.cust_id = loan.cust_id
### Instruction:

Convert text to sql: Find the the name of the customers who have a loan with amount more than 3000. | bank : branch_id , bname , no_of_customers , city , state | customer : cust_id , cust_name , acc_type , acc_bal , no_of_loans , credit_score , branch_id , state | loan : loan_id , loan_type , cust_id , branch_id , amount | customer.branch_id = bank.branch_id | loan.branch_id = bank.branch_id | 

### Response:

select _ from _ where _ | select customer.cust_name from customer join loan on customer.cust_id = loan.cust_id where amount > 3000
### Instruction:

Convert text to sql: What are the names of customers who have a loan of more than 3000 in amount? | bank : branch_id , bname , no_of_customers , city , state | customer : cust_id , cust_name , acc_type , acc_bal , no_of_loans , credit_score , branch_id , state | loan : loan_id , loan_type , cust_id , branch_id , amount | customer.branch_id = bank.branch_id | loan.branch_id = bank.branch_id | 

### Response:

select _ from _ where _ | select customer.cust_name from customer join loan on customer.cust_id = loan.cust_id where amount > 3000
### Instruction:

Convert text to sql: Find the city and name of bank branches that provide business loans. | bank : branch_id , bname , no_of_customers , city , state | customer : cust_id , cust_name , acc_type , acc_bal , no_of_loans , credit_score , branch_id , state | loan : loan_id , loan_type , cust_id , branch_id , amount | customer.branch_id = bank.branch_id | loan.branch_id = bank.branch_id | 

### Response:

select _ from _ where _ | select bank.bname , bank.city from bank join loan on bank.branch_id = loan.branch_id where loan.loan_type = 'Business'
### Instruction:

Convert text to sql: What are the names and cities of bank branches that offer loans for business? | bank : branch_id , bname , no_of_customers , city , state | customer : cust_id , cust_name , acc_type , acc_bal , no_of_loans , credit_score , branch_id , state | loan : loan_id , loan_type , cust_id , branch_id , amount | customer.branch_id = bank.branch_id | loan.branch_id = bank.branch_id | 

### Response:

select _ from _ where _ | select bank.bname , bank.city from bank join loan on bank.branch_id = loan.branch_id where loan.loan_type = 'Business'
### Instruction:

Convert text to sql: Find the names of bank branches that have provided a loan to any customer whose credit score is below 100. | bank : branch_id , bname , no_of_customers , city , state | customer : cust_id , cust_name , acc_type , acc_bal , no_of_loans , credit_score , branch_id , state | loan : loan_id , loan_type , cust_id , branch_id , amount | customer.branch_id = bank.branch_id | loan.branch_id = bank.branch_id | 

### Response:

select _ from _ where _ | select bank.bname from loan join bank on loan.branch_id = bank.branch_id join customer on loan.cust_id = customer.cust_id where customer.credit_score < 100
### Instruction:

Convert text to sql: What are the names of banks that have loaned money to customers with credit scores below 100? | bank : branch_id , bname , no_of_customers , city , state | customer : cust_id , cust_name , acc_type , acc_bal , no_of_loans , credit_score , branch_id , state | loan : loan_id , loan_type , cust_id , branch_id , amount | customer.branch_id = bank.branch_id | loan.branch_id = bank.branch_id | 

### Response:

select _ from _ where _ | select bank.bname from loan join bank on loan.branch_id = bank.branch_id join customer on loan.cust_id = customer.cust_id where customer.credit_score < 100
### Instruction:

Convert text to sql: Find the total amount of loans provided by bank branches in the state of New York. | bank : branch_id , bname , no_of_customers , city , state | customer : cust_id , cust_name , acc_type , acc_bal , no_of_loans , credit_score , branch_id , state | loan : loan_id , loan_type , cust_id , branch_id , amount | customer.branch_id = bank.branch_id | loan.branch_id = bank.branch_id | 

### Response:

select sum ( _ ) from _ where _ | select sum ( loan.amount ) from bank join loan on bank.branch_id = loan.branch_id where bank.state = 'New York'
### Instruction:

Convert text to sql: What is the total amount of money loaned by banks in New York state? | bank : branch_id , bname , no_of_customers , city , state | customer : cust_id , cust_name , acc_type , acc_bal , no_of_loans , credit_score , branch_id , state | loan : loan_id , loan_type , cust_id , branch_id , amount | customer.branch_id = bank.branch_id | loan.branch_id = bank.branch_id | 

### Response:

select sum ( _ ) from _ where _ | select sum ( loan.amount ) from bank join loan on bank.branch_id = loan.branch_id where bank.state = 'New York'
### Instruction:

Convert text to sql: Find the average credit score of the customers who have some loan. | bank : branch_id , bname , no_of_customers , city , state | customer : cust_id , cust_name , acc_type , acc_bal , no_of_loans , credit_score , branch_id , state | loan : loan_id , loan_type , cust_id , branch_id , amount | customer.branch_id = bank.branch_id | loan.branch_id = bank.branch_id | 

### Response:

select avg ( _ ) from _ where _ in ( select _ from _ ) | select avg ( credit_score ) from customer where cust_id in ( select cust_id from loan )
### Instruction:

Convert text to sql: What is the average credit score for customers who have taken a loan? | bank : branch_id , bname , no_of_customers , city , state | customer : cust_id , cust_name , acc_type , acc_bal , no_of_loans , credit_score , branch_id , state | loan : loan_id , loan_type , cust_id , branch_id , amount | customer.branch_id = bank.branch_id | loan.branch_id = bank.branch_id | 

### Response:

select avg ( _ ) from _ where _ in ( select _ from _ ) | select avg ( credit_score ) from customer where cust_id in ( select cust_id from loan )
### Instruction:

Convert text to sql: Find the average credit score of the customers who do not have any loan. | bank : branch_id , bname , no_of_customers , city , state | customer : cust_id , cust_name , acc_type , acc_bal , no_of_loans , credit_score , branch_id , state | loan : loan_id , loan_type , cust_id , branch_id , amount | customer.branch_id = bank.branch_id | loan.branch_id = bank.branch_id | 

### Response:

select avg ( _ ) from _ where _ not in ( select _ from _ ) | select avg ( credit_score ) from customer where cust_id not in ( select cust_id from loan )
### Instruction:

Convert text to sql: What is the average credit score for customers who have never taken a loan? | bank : branch_id , bname , no_of_customers , city , state | customer : cust_id , cust_name , acc_type , acc_bal , no_of_loans , credit_score , branch_id , state | loan : loan_id , loan_type , cust_id , branch_id , amount | customer.branch_id = bank.branch_id | loan.branch_id = bank.branch_id | 

### Response:

select avg ( _ ) from _ where _ not in ( select _ from _ ) | select avg ( credit_score ) from customer where cust_id not in ( select cust_id from loan )
### Instruction:

Convert text to sql: How many assessment notes are there in total? | ref_address_types : address_type_code , address_type_description | ref_detention_type : detention_type_code , detention_type_description | ref_incident_type : incident_type_code , incident_type_description | addresses : address_id , line_1 , line_2 , line_3 , city , zip_postcode , state_province_county , country , other_address_details | students : student_id , address_id , first_name , middle_name , last_name , cell_mobile_number , email_address , date_first_rental , date_left_university , other_student_details | teachers : teacher_id , address_id , first_name , middle_name , last_name , gender , cell_mobile_number , email_address , other_details | assessment_notes : notes_id , student_id , teacher_id , date_of_notes , text_of_notes , other_details | behavior_incident : incident_id , incident_type_code , student_id , date_incident_start , date_incident_end , incident_summary , recommendations , other_details | detention : detention_id , detention_type_code , teacher_id , datetime_detention_start , datetime_detention_end , detention_summary , other_details | student_addresses : student_id , address_id , date_address_from , date_address_to , monthly_rental , other_details | students_in_detention : student_id , detention_id , incident_id | students.address_id = addresses.address_id | teachers.address_id = addresses.address_id | assessment_notes.teacher_id = teachers.teacher_id | assessment_notes.student_id = students.student_id | behavior_incident.student_id = students.student_id | behavior_incident.incident_type_code = ref_incident_type.incident_type_code | detention.teacher_id = teachers.teacher_id | detention.detention_type_code = ref_detention_type.detention_type_code | student_addresses.student_id = students.student_id | student_addresses.address_id = addresses.address_id | students_in_detention.student_id = students.student_id | students_in_detention.detention_id = detention.detention_id | students_in_detention.incident_id = behavior_incident.incident_id | 

### Response:

select count ( _ ) from _ | select count ( * ) from assessment_notes
### Instruction:

Convert text to sql: What are the dates of the assessment notes? | ref_address_types : address_type_code , address_type_description | ref_detention_type : detention_type_code , detention_type_description | ref_incident_type : incident_type_code , incident_type_description | addresses : address_id , line_1 , line_2 , line_3 , city , zip_postcode , state_province_county , country , other_address_details | students : student_id , address_id , first_name , middle_name , last_name , cell_mobile_number , email_address , date_first_rental , date_left_university , other_student_details | teachers : teacher_id , address_id , first_name , middle_name , last_name , gender , cell_mobile_number , email_address , other_details | assessment_notes : notes_id , student_id , teacher_id , date_of_notes , text_of_notes , other_details | behavior_incident : incident_id , incident_type_code , student_id , date_incident_start , date_incident_end , incident_summary , recommendations , other_details | detention : detention_id , detention_type_code , teacher_id , datetime_detention_start , datetime_detention_end , detention_summary , other_details | student_addresses : student_id , address_id , date_address_from , date_address_to , monthly_rental , other_details | students_in_detention : student_id , detention_id , incident_id | students.address_id = addresses.address_id | teachers.address_id = addresses.address_id | assessment_notes.teacher_id = teachers.teacher_id | assessment_notes.student_id = students.student_id | behavior_incident.student_id = students.student_id | behavior_incident.incident_type_code = ref_incident_type.incident_type_code | detention.teacher_id = teachers.teacher_id | detention.detention_type_code = ref_detention_type.detention_type_code | student_addresses.student_id = students.student_id | student_addresses.address_id = addresses.address_id | students_in_detention.student_id = students.student_id | students_in_detention.detention_id = detention.detention_id | students_in_detention.incident_id = behavior_incident.incident_id | 

### Response:

select _ from _ | select date_of_notes from assessment_notes
### Instruction:

Convert text to sql: How many addresses have zip code 197? | ref_address_types : address_type_code , address_type_description | ref_detention_type : detention_type_code , detention_type_description | ref_incident_type : incident_type_code , incident_type_description | addresses : address_id , line_1 , line_2 , line_3 , city , zip_postcode , state_province_county , country , other_address_details | students : student_id , address_id , first_name , middle_name , last_name , cell_mobile_number , email_address , date_first_rental , date_left_university , other_student_details | teachers : teacher_id , address_id , first_name , middle_name , last_name , gender , cell_mobile_number , email_address , other_details | assessment_notes : notes_id , student_id , teacher_id , date_of_notes , text_of_notes , other_details | behavior_incident : incident_id , incident_type_code , student_id , date_incident_start , date_incident_end , incident_summary , recommendations , other_details | detention : detention_id , detention_type_code , teacher_id , datetime_detention_start , datetime_detention_end , detention_summary , other_details | student_addresses : student_id , address_id , date_address_from , date_address_to , monthly_rental , other_details | students_in_detention : student_id , detention_id , incident_id | students.address_id = addresses.address_id | teachers.address_id = addresses.address_id | assessment_notes.teacher_id = teachers.teacher_id | assessment_notes.student_id = students.student_id | behavior_incident.student_id = students.student_id | behavior_incident.incident_type_code = ref_incident_type.incident_type_code | detention.teacher_id = teachers.teacher_id | detention.detention_type_code = ref_detention_type.detention_type_code | student_addresses.student_id = students.student_id | student_addresses.address_id = addresses.address_id | students_in_detention.student_id = students.student_id | students_in_detention.detention_id = detention.detention_id | students_in_detention.incident_id = behavior_incident.incident_id | 

### Response:

select count ( _ ) from _ where _ | select count ( * ) from addresses where zip_postcode = '197'
### Instruction:

Convert text to sql: How many distinct incident type codes are there? | ref_address_types : address_type_code , address_type_description | ref_detention_type : detention_type_code , detention_type_description | ref_incident_type : incident_type_code , incident_type_description | addresses : address_id , line_1 , line_2 , line_3 , city , zip_postcode , state_province_county , country , other_address_details | students : student_id , address_id , first_name , middle_name , last_name , cell_mobile_number , email_address , date_first_rental , date_left_university , other_student_details | teachers : teacher_id , address_id , first_name , middle_name , last_name , gender , cell_mobile_number , email_address , other_details | assessment_notes : notes_id , student_id , teacher_id , date_of_notes , text_of_notes , other_details | behavior_incident : incident_id , incident_type_code , student_id , date_incident_start , date_incident_end , incident_summary , recommendations , other_details | detention : detention_id , detention_type_code , teacher_id , datetime_detention_start , datetime_detention_end , detention_summary , other_details | student_addresses : student_id , address_id , date_address_from , date_address_to , monthly_rental , other_details | students_in_detention : student_id , detention_id , incident_id | students.address_id = addresses.address_id | teachers.address_id = addresses.address_id | assessment_notes.teacher_id = teachers.teacher_id | assessment_notes.student_id = students.student_id | behavior_incident.student_id = students.student_id | behavior_incident.incident_type_code = ref_incident_type.incident_type_code | detention.teacher_id = teachers.teacher_id | detention.detention_type_code = ref_detention_type.detention_type_code | student_addresses.student_id = students.student_id | student_addresses.address_id = addresses.address_id | students_in_detention.student_id = students.student_id | students_in_detention.detention_id = detention.detention_id | students_in_detention.incident_id = behavior_incident.incident_id | 

### Response:

select count ( distinct _ ) from _ | select count ( distinct incident_type_code ) from behavior_incident