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

Convert text to sql: What is the cell phone number of the student whose address has the lowest monthly rental? | 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 students.cell_mobile_number from student_addresses join students on student_addresses.student_id = students.student_id order by student_addresses.monthly_rental asc limit 1
### Instruction:

Convert text to sql: What are the monthly rentals of student addresses in Texas state? | 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 student_addresses.monthly_rental from addresses join student_addresses on addresses.address_id = student_addresses.address_id where addresses.state_province_county = 'Texas'
### Instruction:

Convert text to sql: What are the first names and last names of students with address in Wisconsin state? | 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 students.first_name , students.last_name from addresses join students on addresses.address_id = students.address_id where addresses.state_province_county = 'Wisconsin'
### Instruction:

Convert text to sql: What are the line 1 and average monthly rentals of all student addresses? | 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 addresses.line_1 , avg ( student_addresses.monthly_rental ) from addresses join student_addresses on addresses.address_id = student_addresses.address_id group by student_addresses.address_id
### Instruction:

Convert text to sql: What is the zip code of the address where the teacher with first name "Lyla" lives? | 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 addresses.zip_postcode from addresses join teachers on addresses.address_id = teachers.address_id where teachers.first_name = 'Lyla'
### Instruction:

Convert text to sql: What are the email addresses of teachers whose address has zip code "918"? | 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 teachers.email_address from addresses join teachers on addresses.address_id = teachers.address_id where addresses.zip_postcode = '918'
### Instruction:

Convert text to sql: How many students are not involved in any behavior incident? | 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 students where student_id not in ( select student_id from behavior_incident )
### Instruction:

Convert text to sql: Find the last names of teachers who are not involved in any detention. | 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 last_name from teachers except select teachers.last_name from teachers join detention on teachers.teacher_id = detention.teacher_id
### Instruction:

Convert text to sql: What are the line 1 of addresses shared by some students and some teachers? | 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 addresses.line_1 from addresses join students on addresses.address_id = teachers.address_id intersect select addresses.line_1 from addresses join teachers on addresses.address_id = teachers.address_id
### Instruction:

Convert text to sql: Which assets have 2 parts and have less than 2 fault logs? List the asset id and detail. | third_party_companies : company_id , company_type , company_name , company_address , other_company_details | maintenance_contracts : maintenance_contract_id , maintenance_contract_company_id , contract_start_date , contract_end_date , other_contract_details | parts : part_id , part_name , chargeable_yn , chargeable_amount , other_part_details | skills : skill_id , skill_code , skill_description | staff : staff_id , staff_name , gender , other_staff_details | assets : asset_id , maintenance_contract_id , supplier_company_id , asset_details , asset_make , asset_model , asset_acquired_date , asset_disposed_date , other_asset_details | asset_parts : asset_id , part_id | maintenance_engineers : engineer_id , company_id , first_name , last_name , other_details | engineer_skills : engineer_id , skill_id | fault_log : fault_log_entry_id , asset_id , recorded_by_staff_id , fault_log_entry_datetime , fault_description , other_fault_details | engineer_visits : engineer_visit_id , contact_staff_id , engineer_id , fault_log_entry_id , fault_status , visit_start_datetime , visit_end_datetime , other_visit_details | part_faults : part_fault_id , part_id , fault_short_name , fault_description , other_fault_details | fault_log_parts : fault_log_entry_id , part_fault_id , fault_status | skills_required_to_fix : part_fault_id , skill_id | maintenance_contracts.maintenance_contract_company_id = third_party_companies.company_id | assets.supplier_company_id = third_party_companies.company_id | assets.maintenance_contract_id = maintenance_contracts.maintenance_contract_id | asset_parts.asset_id = assets.asset_id | asset_parts.part_id = parts.part_id | maintenance_engineers.company_id = third_party_companies.company_id | engineer_skills.skill_id = skills.skill_id | engineer_skills.engineer_id = maintenance_engineers.engineer_id | fault_log.recorded_by_staff_id = staff.staff_id | fault_log.asset_id = assets.asset_id | engineer_visits.contact_staff_id = staff.staff_id | engineer_visits.engineer_id = maintenance_engineers.engineer_id | engineer_visits.fault_log_entry_id = fault_log.fault_log_entry_id | part_faults.part_id = parts.part_id | fault_log_parts.fault_log_entry_id = fault_log.fault_log_entry_id | fault_log_parts.part_fault_id = part_faults.part_fault_id | skills_required_to_fix.skill_id = skills.skill_id | skills_required_to_fix.part_fault_id = part_faults.part_fault_id | 

### Response:

select assets.asset_id , assets.asset_details from assets join asset_parts on assets.asset_id = fault_log.asset_id group by assets.asset_id having count ( * ) = 2 intersect select assets.asset_id , assets.asset_details from assets join fault_log on assets.asset_id = fault_log.asset_id group by assets.asset_id having count ( * ) < 2