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

Convert text to sql: List the method, date and amount of all the payments, in ascending order of date. | 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 , date_payment_made , amount_payment from payments order by date_payment_made asc

### Instruction:

Convert text to sql: What are the method, date and amount of each payment? Sort the list in ascending order of date. | 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 , date_payment_made , amount_payment from payments order by date_payment_made asc

### Instruction:

Convert text to sql: Among all the claims, what is the settlement amount of the claim with the largest claim amount? List both the settlement amount and claim 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 amount_settled , amount_claimed from claims order by amount_claimed desc limit 1
### Instruction:

Convert text to sql: Find the settlement amount of the claim with the largest claim amount. Show both the settlement amount and claim 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 amount_settled , amount_claimed from claims order by amount_claimed desc limit 1

### Instruction:

Convert text to sql: Among all the claims, what is the amount claimed in the claim with the least amount settled? List both the settlement amount and claim 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 amount_settled , amount_claimed from claims order by amount_settled asc limit 1

### Instruction:

Convert text to sql: Find the claimed amount in the claim with the least amount settled. Show both the settlement amount and claim 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 amount_settled , amount_claimed from claims order by amount_settled asc limit 1
### Instruction:

Convert text to sql: Among all the claims, which claims have a claimed amount larger than the average? List the date the claim was made and the date it was 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 date_claim_made , date_claim_settled from claims where amount_claimed > ( select avg ( amount_claimed ) from claims )

### Instruction:

Convert text to sql: Give me the claim date, settlement date for all the claims whose claimed amount is larger than the average. | 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 date_claim_made , date_claim_settled from claims where amount_claimed > ( select avg ( amount_claimed ) from claims )

### Instruction:

Convert text to sql: Among all the claims, which settlements have a claimed amount that is no more than the average? List the claim start date. | 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 date_claim_made from claims where amount_settled <= ( select avg ( amount_settled ) from claims )
### Instruction:

Convert text to sql: Return the claim start date for the claims whose claimed amount is no more than the average | 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 date_claim_made from claims where amount_settled <= ( select avg ( amount_settled ) from claims )

### Instruction:

Convert text to sql: How many settlements does each claim correspond to? List the claim id and the number of settlements. | 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 , count ( * ) from claims join settlements on claims.claim_id = settlements.claim_id group by claims.claim_id

### Instruction:

Convert text to sql: Find the number of settlements each claim corresponds to. Show the number together with the claim id. | 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 , count ( * ) from claims join settlements on claims.claim_id = settlements.claim_id group by claims.claim_id
### Instruction:

Convert text to sql: Which claim incurred the most number of settlements? List the claim id, the date the claim was made, and the number. | 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 , count ( * ) from claims join settlements on claims.claim_id = settlements.claim_id group by claims.claim_id order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: Find the claim id and claim date of the claim that incurred the most settlement count. Also tell me the count. | 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 , count ( * ) from claims join settlements on claims.claim_id = settlements.claim_id group by claims.claim_id order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: How many settlements were made on the claim with the most recent claim settlement date? List the number and the claim id. | 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 ( * ) , claims.claim_id from claims join settlements on claims.claim_id = settlements.claim_id group by claims.claim_id order by claims.date_claim_settled desc limit 1
### Instruction:

Convert text to sql: Find the claim id and the number of settlements made for the claim with the most recent settlement date. | 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 ( * ) , claims.claim_id from claims join settlements on claims.claim_id = settlements.claim_id group by claims.claim_id order by claims.date_claim_settled desc limit 1

### Instruction:

Convert text to sql: Of all the claims, what was the earliest date when any claim was 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 date_claim_made from claims order by date_claim_made asc limit 1

### Instruction:

Convert text to sql: Tell me the the date when the first claim was 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 date_claim_made from claims order by date_claim_made asc limit 1
### Instruction:

Convert text to sql: What is the total amount of settlement made for all the settlements? | 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_settled ) from settlements

### Instruction:

Convert text to sql: Compute the total amount of settlement across all the settlements. | 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_settled ) from settlements

### Instruction:

Convert text to sql: Who are the customers that had more than 1 policy? List the customer details and id. | 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 customers.customer_details , customers.customer_id from customers join customer_policies on customers.customer_id = customer_policies.customer_id group by customers.customer_id having count ( * ) > 1
### Instruction:

Convert text to sql: Find the the customer details and id for the customers who had more than one policy. | 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 customers.customer_details , customers.customer_id from customers join customer_policies on customers.customer_id = customer_policies.customer_id group by customers.customer_id having count ( * ) > 1

### Instruction:

Convert text to sql: What are the claim dates and settlement dates of all the settlements? | 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 date_claim_made , date_claim_settled from settlements

### Instruction:

Convert text to sql: Tell me the the claim date and settlement date for each settlement case. | 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 date_claim_made , date_claim_settled from settlements