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

Convert text to sql: What is the most popular payment method? | customers : customer_id , customer_details | customer_policies : policy_id , customer_id , policy_type_code , start_date , end_date | claims : claim_id , policy_id , date_claim_made , date_claim_settled , amount_claimed , amount_settled | settlements : settlement_id , claim_id , date_claim_made , date_claim_settled , amount_claimed , amount_settled , customer_policy_id | payments : payment_id , settlement_id , payment_method_code , date_payment_made , amount_payment | customer_policies.customer_id = customers.customer_id | claims.policy_id = customer_policies.policy_id | settlements.claim_id = claims.claim_id | payments.settlement_id = settlements.settlement_id | 

### Response:

select payment_method_code from payments group by payment_method_code order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: Which payment method is used the most often? | customers : customer_id , customer_details | customer_policies : policy_id , customer_id , policy_type_code , start_date , end_date | claims : claim_id , policy_id , date_claim_made , date_claim_settled , amount_claimed , amount_settled | settlements : settlement_id , claim_id , date_claim_made , date_claim_settled , amount_claimed , amount_settled , customer_policy_id | payments : payment_id , settlement_id , payment_method_code , date_payment_made , amount_payment | customer_policies.customer_id = customers.customer_id | claims.policy_id = customer_policies.policy_id | settlements.claim_id = claims.claim_id | payments.settlement_id = settlements.settlement_id | 

### Response:

select payment_method_code from payments group by payment_method_code order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: With which kind of payment method were the least number of payments processed? | customers : customer_id , customer_details | customer_policies : policy_id , customer_id , policy_type_code , start_date , end_date | claims : claim_id , policy_id , date_claim_made , date_claim_settled , amount_claimed , amount_settled | settlements : settlement_id , claim_id , date_claim_made , date_claim_settled , amount_claimed , amount_settled , customer_policy_id | payments : payment_id , settlement_id , payment_method_code , date_payment_made , amount_payment | customer_policies.customer_id = customers.customer_id | claims.policy_id = customer_policies.policy_id | settlements.claim_id = claims.claim_id | payments.settlement_id = settlements.settlement_id | 

### Response:

select payment_method_code from payments group by payment_method_code order by count ( * ) asc limit 1
### Instruction:

Convert text to sql: What is the payment method that were used the least often? | customers : customer_id , customer_details | customer_policies : policy_id , customer_id , policy_type_code , start_date , end_date | claims : claim_id , policy_id , date_claim_made , date_claim_settled , amount_claimed , amount_settled | settlements : settlement_id , claim_id , date_claim_made , date_claim_settled , amount_claimed , amount_settled , customer_policy_id | payments : payment_id , settlement_id , payment_method_code , date_payment_made , amount_payment | customer_policies.customer_id = customers.customer_id | claims.policy_id = customer_policies.policy_id | settlements.claim_id = claims.claim_id | payments.settlement_id = settlements.settlement_id | 

### Response:

select payment_method_code from payments group by payment_method_code order by count ( * ) asc limit 1

### Instruction:

Convert text to sql: What is the total amount of payment? | customers : customer_id , customer_details | customer_policies : policy_id , customer_id , policy_type_code , start_date , end_date | claims : claim_id , policy_id , date_claim_made , date_claim_settled , amount_claimed , amount_settled | settlements : settlement_id , claim_id , date_claim_made , date_claim_settled , amount_claimed , amount_settled , customer_policy_id | payments : payment_id , settlement_id , payment_method_code , date_payment_made , amount_payment | customer_policies.customer_id = customers.customer_id | claims.policy_id = customer_policies.policy_id | settlements.claim_id = claims.claim_id | payments.settlement_id = settlements.settlement_id | 

### Response:

select sum ( amount_payment ) from payments

### Instruction:

Convert text to sql: Compute the total amount of payment processed. | customers : customer_id , customer_details | customer_policies : policy_id , customer_id , policy_type_code , start_date , end_date | claims : claim_id , policy_id , date_claim_made , date_claim_settled , amount_claimed , amount_settled | settlements : settlement_id , claim_id , date_claim_made , date_claim_settled , amount_claimed , amount_settled , customer_policy_id | payments : payment_id , settlement_id , payment_method_code , date_payment_made , amount_payment | customer_policies.customer_id = customers.customer_id | claims.policy_id = customer_policies.policy_id | settlements.claim_id = claims.claim_id | payments.settlement_id = settlements.settlement_id | 

### Response:

select sum ( amount_payment ) from payments
### Instruction:

Convert text to sql: What are all the distinct details of the customers? | customers : customer_id , customer_details | customer_policies : policy_id , customer_id , policy_type_code , start_date , end_date | claims : claim_id , policy_id , date_claim_made , date_claim_settled , amount_claimed , amount_settled | settlements : settlement_id , claim_id , date_claim_made , date_claim_settled , amount_claimed , amount_settled , customer_policy_id | payments : payment_id , settlement_id , payment_method_code , date_payment_made , amount_payment | customer_policies.customer_id = customers.customer_id | claims.policy_id = customer_policies.policy_id | settlements.claim_id = claims.claim_id | payments.settlement_id = settlements.settlement_id | 

### Response:

select distinct customer_details from customers

### Instruction:

Convert text to sql: Return the distinct customer details. | customers : customer_id , customer_details | customer_policies : policy_id , customer_id , policy_type_code , start_date , end_date | claims : claim_id , policy_id , date_claim_made , date_claim_settled , amount_claimed , amount_settled | settlements : settlement_id , claim_id , date_claim_made , date_claim_settled , amount_claimed , amount_settled , customer_policy_id | payments : payment_id , settlement_id , payment_method_code , date_payment_made , amount_payment | customer_policies.customer_id = customers.customer_id | claims.policy_id = customer_policies.policy_id | settlements.claim_id = claims.claim_id | payments.settlement_id = settlements.settlement_id | 

### Response:

select distinct customer_details from customers

### Instruction:

Convert text to sql: Which kind of policy type was chosen by the most customers? | customers : customer_id , customer_details | customer_policies : policy_id , customer_id , policy_type_code , start_date , end_date | claims : claim_id , policy_id , date_claim_made , date_claim_settled , amount_claimed , amount_settled | settlements : settlement_id , claim_id , date_claim_made , date_claim_settled , amount_claimed , amount_settled , customer_policy_id | payments : payment_id , settlement_id , payment_method_code , date_payment_made , amount_payment | customer_policies.customer_id = customers.customer_id | claims.policy_id = customer_policies.policy_id | settlements.claim_id = claims.claim_id | payments.settlement_id = settlements.settlement_id | 

### Response:

select policy_type_code from customer_policies group by policy_type_code order by count ( * ) desc limit 1
### Instruction:

Convert text to sql: Find the policy type the most customers choose. | customers : customer_id , customer_details | customer_policies : policy_id , customer_id , policy_type_code , start_date , end_date | claims : claim_id , policy_id , date_claim_made , date_claim_settled , amount_claimed , amount_settled | settlements : settlement_id , claim_id , date_claim_made , date_claim_settled , amount_claimed , amount_settled , customer_policy_id | payments : payment_id , settlement_id , payment_method_code , date_payment_made , amount_payment | customer_policies.customer_id = customers.customer_id | claims.policy_id = customer_policies.policy_id | settlements.claim_id = claims.claim_id | payments.settlement_id = settlements.settlement_id | 

### Response:

select policy_type_code from customer_policies group by policy_type_code order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: How many settlements are there in total? | customers : customer_id , customer_details | customer_policies : policy_id , customer_id , policy_type_code , start_date , end_date | claims : claim_id , policy_id , date_claim_made , date_claim_settled , amount_claimed , amount_settled | settlements : settlement_id , claim_id , date_claim_made , date_claim_settled , amount_claimed , amount_settled , customer_policy_id | payments : payment_id , settlement_id , payment_method_code , date_payment_made , amount_payment | customer_policies.customer_id = customers.customer_id | claims.policy_id = customer_policies.policy_id | settlements.claim_id = claims.claim_id | payments.settlement_id = settlements.settlement_id | 

### Response:

select count ( * ) from settlements

### Instruction:

Convert text to sql: Count the total number of settlements made. | customers : customer_id , customer_details | customer_policies : policy_id , customer_id , policy_type_code , start_date , end_date | claims : claim_id , policy_id , date_claim_made , date_claim_settled , amount_claimed , amount_settled | settlements : settlement_id , claim_id , date_claim_made , date_claim_settled , amount_claimed , amount_settled , customer_policy_id | payments : payment_id , settlement_id , payment_method_code , date_payment_made , amount_payment | customer_policies.customer_id = customers.customer_id | claims.policy_id = customer_policies.policy_id | settlements.claim_id = claims.claim_id | payments.settlement_id = settlements.settlement_id | 

### Response:

select count ( * ) from settlements
### Instruction:

Convert text to sql: Which Payments were processed with Visa? List the payment Id, the date and the amount. | customers : customer_id , customer_details | customer_policies : policy_id , customer_id , policy_type_code , start_date , end_date | claims : claim_id , policy_id , date_claim_made , date_claim_settled , amount_claimed , amount_settled | settlements : settlement_id , claim_id , date_claim_made , date_claim_settled , amount_claimed , amount_settled , customer_policy_id | payments : payment_id , settlement_id , payment_method_code , date_payment_made , amount_payment | customer_policies.customer_id = customers.customer_id | claims.policy_id = customer_policies.policy_id | settlements.claim_id = claims.claim_id | payments.settlement_id = settlements.settlement_id | 

### Response:

select payment_id , date_payment_made , amount_payment from payments where payment_method_code = 'Visa'

### Instruction:

Convert text to sql: Give me the payment Id, the date and the amount for all the payments processed with Visa. | customers : customer_id , customer_details | customer_policies : policy_id , customer_id , policy_type_code , start_date , end_date | claims : claim_id , policy_id , date_claim_made , date_claim_settled , amount_claimed , amount_settled | settlements : settlement_id , claim_id , date_claim_made , date_claim_settled , amount_claimed , amount_settled , customer_policy_id | payments : payment_id , settlement_id , payment_method_code , date_payment_made , amount_payment | customer_policies.customer_id = customers.customer_id | claims.policy_id = customer_policies.policy_id | settlements.claim_id = claims.claim_id | payments.settlement_id = settlements.settlement_id | 

### Response:

select payment_id , date_payment_made , amount_payment from payments where payment_method_code = 'Visa'

### Instruction:

Convert text to sql: List the details of the customers who do not have any policies. | customers : customer_id , customer_details | customer_policies : policy_id , customer_id , policy_type_code , start_date , end_date | claims : claim_id , policy_id , date_claim_made , date_claim_settled , amount_claimed , amount_settled | settlements : settlement_id , claim_id , date_claim_made , date_claim_settled , amount_claimed , amount_settled , customer_policy_id | payments : payment_id , settlement_id , payment_method_code , date_payment_made , amount_payment | customer_policies.customer_id = customers.customer_id | claims.policy_id = customer_policies.policy_id | settlements.claim_id = claims.claim_id | payments.settlement_id = settlements.settlement_id | 

### Response:

select customer_details from customers except select customers.customer_details from customers join customer_policies on customers.customer_id = customer_policies.customer_id
### Instruction:

Convert text to sql: Which customers do not have any policies? Find the details of these customers. | customers : customer_id , customer_details | customer_policies : policy_id , customer_id , policy_type_code , start_date , end_date | claims : claim_id , policy_id , date_claim_made , date_claim_settled , amount_claimed , amount_settled | settlements : settlement_id , claim_id , date_claim_made , date_claim_settled , amount_claimed , amount_settled , customer_policy_id | payments : payment_id , settlement_id , payment_method_code , date_payment_made , amount_payment | customer_policies.customer_id = customers.customer_id | claims.policy_id = customer_policies.policy_id | settlements.claim_id = claims.claim_id | payments.settlement_id = settlements.settlement_id | 

### Response:

select customer_details from customers except select customers.customer_details from customers join customer_policies on customers.customer_id = customer_policies.customer_id

### Instruction:

Convert text to sql: List the date the claim was made, the date it was settled and the amount settled for all the claims which had exactly one settlement. | customers : customer_id , customer_details | customer_policies : policy_id , customer_id , policy_type_code , start_date , end_date | claims : claim_id , policy_id , date_claim_made , date_claim_settled , amount_claimed , amount_settled | settlements : settlement_id , claim_id , date_claim_made , date_claim_settled , amount_claimed , amount_settled , customer_policy_id | payments : payment_id , settlement_id , payment_method_code , date_payment_made , amount_payment | customer_policies.customer_id = customers.customer_id | claims.policy_id = customer_policies.policy_id | settlements.claim_id = claims.claim_id | payments.settlement_id = settlements.settlement_id | 

### Response:

select claims.claim_id , claims.date_claim_made , claims.date_claim_settled from claims join settlements on claims.claim_id = settlements.claim_id group by claims.claim_id having count ( * ) = 1

### Instruction:

Convert text to sql: Which claims had exactly one settlement? For each, tell me the the date the claim was made, the date it was settled and the amount settled. | customers : customer_id , customer_details | customer_policies : policy_id , customer_id , policy_type_code , start_date , end_date | claims : claim_id , policy_id , date_claim_made , date_claim_settled , amount_claimed , amount_settled | settlements : settlement_id , claim_id , date_claim_made , date_claim_settled , amount_claimed , amount_settled , customer_policy_id | payments : payment_id , settlement_id , payment_method_code , date_payment_made , amount_payment | customer_policies.customer_id = customers.customer_id | claims.policy_id = customer_policies.policy_id | settlements.claim_id = claims.claim_id | payments.settlement_id = settlements.settlement_id | 

### Response:

select claims.claim_id , claims.date_claim_made , claims.date_claim_settled from claims join settlements on claims.claim_id = settlements.claim_id group by claims.claim_id having count ( * ) = 1
### Instruction:

Convert text to sql: Find the total claimed amount of all the claims. | customers : customer_id , customer_details | customer_policies : policy_id , customer_id , policy_type_code , start_date , end_date | claims : claim_id , policy_id , date_claim_made , date_claim_settled , amount_claimed , amount_settled | settlements : settlement_id , claim_id , date_claim_made , date_claim_settled , amount_claimed , amount_settled , customer_policy_id | payments : payment_id , settlement_id , payment_method_code , date_payment_made , amount_payment | customer_policies.customer_id = customers.customer_id | claims.policy_id = customer_policies.policy_id | settlements.claim_id = claims.claim_id | payments.settlement_id = settlements.settlement_id | 

### Response:

select sum ( amount_claimed ) from claims

### Instruction:

Convert text to sql: What is total amount claimed summed across all the claims? | customers : customer_id , customer_details | customer_policies : policy_id , customer_id , policy_type_code , start_date , end_date | claims : claim_id , policy_id , date_claim_made , date_claim_settled , amount_claimed , amount_settled | settlements : settlement_id , claim_id , date_claim_made , date_claim_settled , amount_claimed , amount_settled , customer_policy_id | payments : payment_id , settlement_id , payment_method_code , date_payment_made , amount_payment | customer_policies.customer_id = customers.customer_id | claims.policy_id = customer_policies.policy_id | settlements.claim_id = claims.claim_id | payments.settlement_id = settlements.settlement_id | 

### Response:

select sum ( amount_claimed ) from claims
### Instruction:

Convert text to sql: Which department has the largest number of employees? | 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 department group by departmentid order by count ( departmentid ) desc limit 1
### Instruction:

Convert text to sql: Find the department with the most employees. | 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 department group by departmentid order by count ( departmentid ) desc limit 1
### Instruction:

Convert text to sql: What is the employee id of the head whose department has the least number of employees? | 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 head from department group by departmentid order by count ( departmentid ) asc limit 1