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

Convert text to sql: Find the id and last name of the teacher that has the most detentions with detention type code "AFTER"? | 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 detention.teacher_id , teachers.last_name from detention join teachers on detention.teacher_id = teachers.teacher_id where detention.detention_type_code = 'AFTER' group by detention.teacher_id order by count ( * ) desc limit 1
### Instruction:

Convert text to sql: What are the id and first name of the student whose addresses have the highest average 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 student_addresses.student_id , students.first_name from student_addresses join students on student_addresses.student_id = students.student_id group by student_addresses.student_id order by avg ( monthly_rental ) desc limit 1
### Instruction:

Convert text to sql: Find the id and city of the student address with the highest average 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 student_addresses.address_id , addresses.city from addresses join student_addresses on addresses.address_id = student_addresses.address_id group by student_addresses.address_id order by avg ( monthly_rental ) desc limit 1
### Instruction:

Convert text to sql: What are the code and description of the most frequent behavior incident type? | 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 behavior_incident.incident_type_code , ref_incident_type.incident_type_description from behavior_incident join ref_incident_type on behavior_incident.incident_type_code = ref_incident_type.incident_type_code group by behavior_incident.incident_type_code order by count ( * ) desc limit 1
### Instruction:

Convert text to sql: What are the code and description of the least frequent detention type ? | 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 detention.detention_type_code , ref_detention_type.detention_type_description from detention join ref_detention_type on detention.detention_type_code = ref_detention_type.detention_type_code group by detention.detention_type_code order by count ( * ) asc limit 1
### Instruction:

Convert text to sql: Find the dates of assessment notes for students with first name "Fanny". | 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 assessment_notes.date_of_notes from assessment_notes join students on assessment_notes.student_id = students.student_id where students.first_name = 'Fanny'
### Instruction:

Convert text to sql: Find the texts of assessment notes for teachers with last name "Schuster". | 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 assessment_notes.text_of_notes from assessment_notes join teachers on assessment_notes.teacher_id = teachers.teacher_id where teachers.last_name = 'Schuster'
### Instruction:

Convert text to sql: Find the start and end dates of behavior incidents of students with last name "Fahey". | 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 behavior_incident.date_incident_start , date_incident_end from behavior_incident join students on behavior_incident.student_id = students.student_id where students.last_name = 'Fahey'
### Instruction:

Convert text to sql: Find the start and end dates of detentions of teachers with last name "Schultz". | 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 detention.datetime_detention_start , datetime_detention_end from detention join teachers on detention.teacher_id = teachers.teacher_id where teachers.last_name = 'Schultz'
### Instruction:

Convert text to sql: What are the id and zip code of the address with the highest 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 student_addresses.address_id , addresses.zip_postcode from addresses join student_addresses on addresses.address_id = student_addresses.address_id order by monthly_rental desc limit 1