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

Convert text to sql: Tell me the highest, lowest, and average cost of procedures. | physician : employeeid , name , position , ssn | department : departmentid , name , head | affiliated_with : physician , department , primaryaffiliation | procedures : code , name , cost | trained_in : physician , treatment , certificationdate , certificationexpires | patient : ssn , name , address , phone , insuranceid , pcp | nurse : employeeid , name , position , registered , ssn | appointment : appointmentid , patient , prepnurse , physician , start , end , examinationroom | medication : code , name , brand , description | prescribes : physician , patient , medication , date , appointment , dose | block : blockfloor , blockcode | room : roomnumber , roomtype , blockfloor , blockcode , unavailable | on_call : nurse , blockfloor , blockcode , oncallstart , oncallend | stay : stayid , patient , room , staystart , stayend | undergoes : patient , procedures , stay , dateundergoes , physician , assistingnurse | department.head = physician.employeeid | affiliated_with.department = department.departmentid | affiliated_with.physician = physician.employeeid | trained_in.treatment = procedures.code | trained_in.physician = physician.employeeid | patient.pcp = physician.employeeid | appointment.physician = physician.employeeid | appointment.prepnurse = nurse.employeeid | appointment.patient = patient.ssn | prescribes.appointment = appointment.appointmentid | prescribes.medication = medication.code | prescribes.patient = patient.ssn | prescribes.physician = physician.employeeid | room.blockfloor = block.blockfloor | room.blockcode = block.blockcode | on_call.blockfloor = block.blockfloor | on_call.blockcode = block.blockcode | on_call.nurse = nurse.employeeid | stay.room = room.roomnumber | stay.patient = patient.ssn | undergoes.assistingnurse = nurse.employeeid | undergoes.physician = physician.employeeid | undergoes.stay = stay.stayid | undergoes.procedures = procedures.code | undergoes.patient = patient.ssn | 

### Response:

select max ( cost ) , min ( cost ) , avg ( cost ) from procedures
### Instruction:

Convert text to sql: List the name and cost of all procedures sorted by the cost from the highest to the lowest. | physician : employeeid , name , position , ssn | department : departmentid , name , head | affiliated_with : physician , department , primaryaffiliation | procedures : code , name , cost | trained_in : physician , treatment , certificationdate , certificationexpires | patient : ssn , name , address , phone , insuranceid , pcp | nurse : employeeid , name , position , registered , ssn | appointment : appointmentid , patient , prepnurse , physician , start , end , examinationroom | medication : code , name , brand , description | prescribes : physician , patient , medication , date , appointment , dose | block : blockfloor , blockcode | room : roomnumber , roomtype , blockfloor , blockcode , unavailable | on_call : nurse , blockfloor , blockcode , oncallstart , oncallend | stay : stayid , patient , room , staystart , stayend | undergoes : patient , procedures , stay , dateundergoes , physician , assistingnurse | department.head = physician.employeeid | affiliated_with.department = department.departmentid | affiliated_with.physician = physician.employeeid | trained_in.treatment = procedures.code | trained_in.physician = physician.employeeid | patient.pcp = physician.employeeid | appointment.physician = physician.employeeid | appointment.prepnurse = nurse.employeeid | appointment.patient = patient.ssn | prescribes.appointment = appointment.appointmentid | prescribes.medication = medication.code | prescribes.patient = patient.ssn | prescribes.physician = physician.employeeid | room.blockfloor = block.blockfloor | room.blockcode = block.blockcode | on_call.blockfloor = block.blockfloor | on_call.blockcode = block.blockcode | on_call.nurse = nurse.employeeid | stay.room = room.roomnumber | stay.patient = patient.ssn | undergoes.assistingnurse = nurse.employeeid | undergoes.physician = physician.employeeid | undergoes.stay = stay.stayid | undergoes.procedures = procedures.code | undergoes.patient = patient.ssn | 

### Response:

select name , cost from procedures order by cost desc
### Instruction:

Convert text to sql: Sort the list of names and costs of all procedures in the descending order of cost. | physician : employeeid , name , position , ssn | department : departmentid , name , head | affiliated_with : physician , department , primaryaffiliation | procedures : code , name , cost | trained_in : physician , treatment , certificationdate , certificationexpires | patient : ssn , name , address , phone , insuranceid , pcp | nurse : employeeid , name , position , registered , ssn | appointment : appointmentid , patient , prepnurse , physician , start , end , examinationroom | medication : code , name , brand , description | prescribes : physician , patient , medication , date , appointment , dose | block : blockfloor , blockcode | room : roomnumber , roomtype , blockfloor , blockcode , unavailable | on_call : nurse , blockfloor , blockcode , oncallstart , oncallend | stay : stayid , patient , room , staystart , stayend | undergoes : patient , procedures , stay , dateundergoes , physician , assistingnurse | department.head = physician.employeeid | affiliated_with.department = department.departmentid | affiliated_with.physician = physician.employeeid | trained_in.treatment = procedures.code | trained_in.physician = physician.employeeid | patient.pcp = physician.employeeid | appointment.physician = physician.employeeid | appointment.prepnurse = nurse.employeeid | appointment.patient = patient.ssn | prescribes.appointment = appointment.appointmentid | prescribes.medication = medication.code | prescribes.patient = patient.ssn | prescribes.physician = physician.employeeid | room.blockfloor = block.blockfloor | room.blockcode = block.blockcode | on_call.blockfloor = block.blockfloor | on_call.blockcode = block.blockcode | on_call.nurse = nurse.employeeid | stay.room = room.roomnumber | stay.patient = patient.ssn | undergoes.assistingnurse = nurse.employeeid | undergoes.physician = physician.employeeid | undergoes.stay = stay.stayid | undergoes.procedures = procedures.code | undergoes.patient = patient.ssn | 

### Response:

select name , cost from procedures order by cost desc
### Instruction:

Convert text to sql: Find the three most expensive procedures. | physician : employeeid , name , position , ssn | department : departmentid , name , head | affiliated_with : physician , department , primaryaffiliation | procedures : code , name , cost | trained_in : physician , treatment , certificationdate , certificationexpires | patient : ssn , name , address , phone , insuranceid , pcp | nurse : employeeid , name , position , registered , ssn | appointment : appointmentid , patient , prepnurse , physician , start , end , examinationroom | medication : code , name , brand , description | prescribes : physician , patient , medication , date , appointment , dose | block : blockfloor , blockcode | room : roomnumber , roomtype , blockfloor , blockcode , unavailable | on_call : nurse , blockfloor , blockcode , oncallstart , oncallend | stay : stayid , patient , room , staystart , stayend | undergoes : patient , procedures , stay , dateundergoes , physician , assistingnurse | department.head = physician.employeeid | affiliated_with.department = department.departmentid | affiliated_with.physician = physician.employeeid | trained_in.treatment = procedures.code | trained_in.physician = physician.employeeid | patient.pcp = physician.employeeid | appointment.physician = physician.employeeid | appointment.prepnurse = nurse.employeeid | appointment.patient = patient.ssn | prescribes.appointment = appointment.appointmentid | prescribes.medication = medication.code | prescribes.patient = patient.ssn | prescribes.physician = physician.employeeid | room.blockfloor = block.blockfloor | room.blockcode = block.blockcode | on_call.blockfloor = block.blockfloor | on_call.blockcode = block.blockcode | on_call.nurse = nurse.employeeid | stay.room = room.roomnumber | stay.patient = patient.ssn | undergoes.assistingnurse = nurse.employeeid | undergoes.physician = physician.employeeid | undergoes.stay = stay.stayid | undergoes.procedures = procedures.code | undergoes.patient = patient.ssn | 

### Response:

select name from procedures order by cost asc limit 3
### Instruction:

Convert text to sql: What are the three most costly procedures? | physician : employeeid , name , position , ssn | department : departmentid , name , head | affiliated_with : physician , department , primaryaffiliation | procedures : code , name , cost | trained_in : physician , treatment , certificationdate , certificationexpires | patient : ssn , name , address , phone , insuranceid , pcp | nurse : employeeid , name , position , registered , ssn | appointment : appointmentid , patient , prepnurse , physician , start , end , examinationroom | medication : code , name , brand , description | prescribes : physician , patient , medication , date , appointment , dose | block : blockfloor , blockcode | room : roomnumber , roomtype , blockfloor , blockcode , unavailable | on_call : nurse , blockfloor , blockcode , oncallstart , oncallend | stay : stayid , patient , room , staystart , stayend | undergoes : patient , procedures , stay , dateundergoes , physician , assistingnurse | department.head = physician.employeeid | affiliated_with.department = department.departmentid | affiliated_with.physician = physician.employeeid | trained_in.treatment = procedures.code | trained_in.physician = physician.employeeid | patient.pcp = physician.employeeid | appointment.physician = physician.employeeid | appointment.prepnurse = nurse.employeeid | appointment.patient = patient.ssn | prescribes.appointment = appointment.appointmentid | prescribes.medication = medication.code | prescribes.patient = patient.ssn | prescribes.physician = physician.employeeid | room.blockfloor = block.blockfloor | room.blockcode = block.blockcode | on_call.blockfloor = block.blockfloor | on_call.blockcode = block.blockcode | on_call.nurse = nurse.employeeid | stay.room = room.roomnumber | stay.patient = patient.ssn | undergoes.assistingnurse = nurse.employeeid | undergoes.physician = physician.employeeid | undergoes.stay = stay.stayid | undergoes.procedures = procedures.code | undergoes.patient = patient.ssn | 

### Response:

select name from procedures order by cost asc limit 3
### Instruction:

Convert text to sql: Find the physicians who are trained in a procedure that costs more than 5000. | physician : employeeid , name , position , ssn | department : departmentid , name , head | affiliated_with : physician , department , primaryaffiliation | procedures : code , name , cost | trained_in : physician , treatment , certificationdate , certificationexpires | patient : ssn , name , address , phone , insuranceid , pcp | nurse : employeeid , name , position , registered , ssn | appointment : appointmentid , patient , prepnurse , physician , start , end , examinationroom | medication : code , name , brand , description | prescribes : physician , patient , medication , date , appointment , dose | block : blockfloor , blockcode | room : roomnumber , roomtype , blockfloor , blockcode , unavailable | on_call : nurse , blockfloor , blockcode , oncallstart , oncallend | stay : stayid , patient , room , staystart , stayend | undergoes : patient , procedures , stay , dateundergoes , physician , assistingnurse | department.head = physician.employeeid | affiliated_with.department = department.departmentid | affiliated_with.physician = physician.employeeid | trained_in.treatment = procedures.code | trained_in.physician = physician.employeeid | patient.pcp = physician.employeeid | appointment.physician = physician.employeeid | appointment.prepnurse = nurse.employeeid | appointment.patient = patient.ssn | prescribes.appointment = appointment.appointmentid | prescribes.medication = medication.code | prescribes.patient = patient.ssn | prescribes.physician = physician.employeeid | room.blockfloor = block.blockfloor | room.blockcode = block.blockcode | on_call.blockfloor = block.blockfloor | on_call.blockcode = block.blockcode | on_call.nurse = nurse.employeeid | stay.room = room.roomnumber | stay.patient = patient.ssn | undergoes.assistingnurse = nurse.employeeid | undergoes.physician = physician.employeeid | undergoes.stay = stay.stayid | undergoes.procedures = procedures.code | undergoes.patient = patient.ssn | 

### Response:

select physician.name from physician join trained_in on physician.employeeid = trained_in.physician join procedures on procedures.code = trained_in.treatment where procedures.cost > 5000
### Instruction:

Convert text to sql: Which physicians are trained in procedures that are more expensive than 5000? | physician : employeeid , name , position , ssn | department : departmentid , name , head | affiliated_with : physician , department , primaryaffiliation | procedures : code , name , cost | trained_in : physician , treatment , certificationdate , certificationexpires | patient : ssn , name , address , phone , insuranceid , pcp | nurse : employeeid , name , position , registered , ssn | appointment : appointmentid , patient , prepnurse , physician , start , end , examinationroom | medication : code , name , brand , description | prescribes : physician , patient , medication , date , appointment , dose | block : blockfloor , blockcode | room : roomnumber , roomtype , blockfloor , blockcode , unavailable | on_call : nurse , blockfloor , blockcode , oncallstart , oncallend | stay : stayid , patient , room , staystart , stayend | undergoes : patient , procedures , stay , dateundergoes , physician , assistingnurse | department.head = physician.employeeid | affiliated_with.department = department.departmentid | affiliated_with.physician = physician.employeeid | trained_in.treatment = procedures.code | trained_in.physician = physician.employeeid | patient.pcp = physician.employeeid | appointment.physician = physician.employeeid | appointment.prepnurse = nurse.employeeid | appointment.patient = patient.ssn | prescribes.appointment = appointment.appointmentid | prescribes.medication = medication.code | prescribes.patient = patient.ssn | prescribes.physician = physician.employeeid | room.blockfloor = block.blockfloor | room.blockcode = block.blockcode | on_call.blockfloor = block.blockfloor | on_call.blockcode = block.blockcode | on_call.nurse = nurse.employeeid | stay.room = room.roomnumber | stay.patient = patient.ssn | undergoes.assistingnurse = nurse.employeeid | undergoes.physician = physician.employeeid | undergoes.stay = stay.stayid | undergoes.procedures = procedures.code | undergoes.patient = patient.ssn | 

### Response:

select physician.name from physician join trained_in on physician.employeeid = trained_in.physician join procedures on procedures.code = trained_in.treatment where procedures.cost > 5000
### Instruction:

Convert text to sql: Find the physician who was trained in the most expensive procedure? | physician : employeeid , name , position , ssn | department : departmentid , name , head | affiliated_with : physician , department , primaryaffiliation | procedures : code , name , cost | trained_in : physician , treatment , certificationdate , certificationexpires | patient : ssn , name , address , phone , insuranceid , pcp | nurse : employeeid , name , position , registered , ssn | appointment : appointmentid , patient , prepnurse , physician , start , end , examinationroom | medication : code , name , brand , description | prescribes : physician , patient , medication , date , appointment , dose | block : blockfloor , blockcode | room : roomnumber , roomtype , blockfloor , blockcode , unavailable | on_call : nurse , blockfloor , blockcode , oncallstart , oncallend | stay : stayid , patient , room , staystart , stayend | undergoes : patient , procedures , stay , dateundergoes , physician , assistingnurse | department.head = physician.employeeid | affiliated_with.department = department.departmentid | affiliated_with.physician = physician.employeeid | trained_in.treatment = procedures.code | trained_in.physician = physician.employeeid | patient.pcp = physician.employeeid | appointment.physician = physician.employeeid | appointment.prepnurse = nurse.employeeid | appointment.patient = patient.ssn | prescribes.appointment = appointment.appointmentid | prescribes.medication = medication.code | prescribes.patient = patient.ssn | prescribes.physician = physician.employeeid | room.blockfloor = block.blockfloor | room.blockcode = block.blockcode | on_call.blockfloor = block.blockfloor | on_call.blockcode = block.blockcode | on_call.nurse = nurse.employeeid | stay.room = room.roomnumber | stay.patient = patient.ssn | undergoes.assistingnurse = nurse.employeeid | undergoes.physician = physician.employeeid | undergoes.stay = stay.stayid | undergoes.procedures = procedures.code | undergoes.patient = patient.ssn | 

### Response:

select physician.name from physician join trained_in on physician.employeeid = trained_in.physician join procedures on procedures.code = trained_in.treatment order by procedures.cost desc limit 1
### Instruction:

Convert text to sql: Which physician was trained in the procedure that costs the most. | physician : employeeid , name , position , ssn | department : departmentid , name , head | affiliated_with : physician , department , primaryaffiliation | procedures : code , name , cost | trained_in : physician , treatment , certificationdate , certificationexpires | patient : ssn , name , address , phone , insuranceid , pcp | nurse : employeeid , name , position , registered , ssn | appointment : appointmentid , patient , prepnurse , physician , start , end , examinationroom | medication : code , name , brand , description | prescribes : physician , patient , medication , date , appointment , dose | block : blockfloor , blockcode | room : roomnumber , roomtype , blockfloor , blockcode , unavailable | on_call : nurse , blockfloor , blockcode , oncallstart , oncallend | stay : stayid , patient , room , staystart , stayend | undergoes : patient , procedures , stay , dateundergoes , physician , assistingnurse | department.head = physician.employeeid | affiliated_with.department = department.departmentid | affiliated_with.physician = physician.employeeid | trained_in.treatment = procedures.code | trained_in.physician = physician.employeeid | patient.pcp = physician.employeeid | appointment.physician = physician.employeeid | appointment.prepnurse = nurse.employeeid | appointment.patient = patient.ssn | prescribes.appointment = appointment.appointmentid | prescribes.medication = medication.code | prescribes.patient = patient.ssn | prescribes.physician = physician.employeeid | room.blockfloor = block.blockfloor | room.blockcode = block.blockcode | on_call.blockfloor = block.blockfloor | on_call.blockcode = block.blockcode | on_call.nurse = nurse.employeeid | stay.room = room.roomnumber | stay.patient = patient.ssn | undergoes.assistingnurse = nurse.employeeid | undergoes.physician = physician.employeeid | undergoes.stay = stay.stayid | undergoes.procedures = procedures.code | undergoes.patient = patient.ssn | 

### Response:

select physician.name from physician join trained_in on physician.employeeid = trained_in.physician join procedures on procedures.code = trained_in.treatment order by procedures.cost desc limit 1
### Instruction:

Convert text to sql: What is the average cost of procedures that physician John Wen was trained in? | physician : employeeid , name , position , ssn | department : departmentid , name , head | affiliated_with : physician , department , primaryaffiliation | procedures : code , name , cost | trained_in : physician , treatment , certificationdate , certificationexpires | patient : ssn , name , address , phone , insuranceid , pcp | nurse : employeeid , name , position , registered , ssn | appointment : appointmentid , patient , prepnurse , physician , start , end , examinationroom | medication : code , name , brand , description | prescribes : physician , patient , medication , date , appointment , dose | block : blockfloor , blockcode | room : roomnumber , roomtype , blockfloor , blockcode , unavailable | on_call : nurse , blockfloor , blockcode , oncallstart , oncallend | stay : stayid , patient , room , staystart , stayend | undergoes : patient , procedures , stay , dateundergoes , physician , assistingnurse | department.head = physician.employeeid | affiliated_with.department = department.departmentid | affiliated_with.physician = physician.employeeid | trained_in.treatment = procedures.code | trained_in.physician = physician.employeeid | patient.pcp = physician.employeeid | appointment.physician = physician.employeeid | appointment.prepnurse = nurse.employeeid | appointment.patient = patient.ssn | prescribes.appointment = appointment.appointmentid | prescribes.medication = medication.code | prescribes.patient = patient.ssn | prescribes.physician = physician.employeeid | room.blockfloor = block.blockfloor | room.blockcode = block.blockcode | on_call.blockfloor = block.blockfloor | on_call.blockcode = block.blockcode | on_call.nurse = nurse.employeeid | stay.room = room.roomnumber | stay.patient = patient.ssn | undergoes.assistingnurse = nurse.employeeid | undergoes.physician = physician.employeeid | undergoes.stay = stay.stayid | undergoes.procedures = procedures.code | undergoes.patient = patient.ssn | 

### Response:

select avg ( procedures.cost ) from physician join trained_in on physician.employeeid = trained_in.physician join procedures on procedures.code = trained_in.treatment where physician.name = 'John Wen'
### Instruction:

Convert text to sql: Compute the mean price of procedures physician John Wen was trained in. | physician : employeeid , name , position , ssn | department : departmentid , name , head | affiliated_with : physician , department , primaryaffiliation | procedures : code , name , cost | trained_in : physician , treatment , certificationdate , certificationexpires | patient : ssn , name , address , phone , insuranceid , pcp | nurse : employeeid , name , position , registered , ssn | appointment : appointmentid , patient , prepnurse , physician , start , end , examinationroom | medication : code , name , brand , description | prescribes : physician , patient , medication , date , appointment , dose | block : blockfloor , blockcode | room : roomnumber , roomtype , blockfloor , blockcode , unavailable | on_call : nurse , blockfloor , blockcode , oncallstart , oncallend | stay : stayid , patient , room , staystart , stayend | undergoes : patient , procedures , stay , dateundergoes , physician , assistingnurse | department.head = physician.employeeid | affiliated_with.department = department.departmentid | affiliated_with.physician = physician.employeeid | trained_in.treatment = procedures.code | trained_in.physician = physician.employeeid | patient.pcp = physician.employeeid | appointment.physician = physician.employeeid | appointment.prepnurse = nurse.employeeid | appointment.patient = patient.ssn | prescribes.appointment = appointment.appointmentid | prescribes.medication = medication.code | prescribes.patient = patient.ssn | prescribes.physician = physician.employeeid | room.blockfloor = block.blockfloor | room.blockcode = block.blockcode | on_call.blockfloor = block.blockfloor | on_call.blockcode = block.blockcode | on_call.nurse = nurse.employeeid | stay.room = room.roomnumber | stay.patient = patient.ssn | undergoes.assistingnurse = nurse.employeeid | undergoes.physician = physician.employeeid | undergoes.stay = stay.stayid | undergoes.procedures = procedures.code | undergoes.patient = patient.ssn | 

### Response:

select avg ( procedures.cost ) from physician join trained_in on physician.employeeid = trained_in.physician join procedures on procedures.code = trained_in.treatment where physician.name = 'John Wen'