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

Convert text to sql: Which policy type appears most frequently in the available policies? | customers : customer_id , customer_name | services : service_id , service_name | available_policies : policy_id , policy_type_code , customer_phone | customers_policies : customer_id , policy_id , date_opened , date_closed | first_notification_of_loss : fnol_id , customer_id , policy_id , service_id | claims : claim_id , fnol_id , effective_date | settlements : settlement_id , claim_id , effective_date , settlement_amount | customers_policies.policy_id = available_policies.policy_id | customers_policies.customer_id = customers.customer_id | first_notification_of_loss.customer_id = customers_policies.customer_id | first_notification_of_loss.policy_id = customers_policies.policy_id | first_notification_of_loss.service_id = services.service_id | claims.fnol_id = first_notification_of_loss.fnol_id | settlements.claim_id = claims.claim_id | 

### Response:

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

### Instruction:

Convert text to sql: What are all the customer phone numbers under the most popular policy type? | customers : customer_id , customer_name | services : service_id , service_name | available_policies : policy_id , policy_type_code , customer_phone | customers_policies : customer_id , policy_id , date_opened , date_closed | first_notification_of_loss : fnol_id , customer_id , policy_id , service_id | claims : claim_id , fnol_id , effective_date | settlements : settlement_id , claim_id , effective_date , settlement_amount | customers_policies.policy_id = available_policies.policy_id | customers_policies.customer_id = customers.customer_id | first_notification_of_loss.customer_id = customers_policies.customer_id | first_notification_of_loss.policy_id = customers_policies.policy_id | first_notification_of_loss.service_id = services.service_id | claims.fnol_id = first_notification_of_loss.fnol_id | settlements.claim_id = claims.claim_id | 

### Response:

select customer_phone from available_policies where policy_type_code = ( select policy_type_code from available_policies group by policy_type_code order by count ( * ) desc limit 1 )
### Instruction:

Convert text to sql: Find the phone numbers of customers using the most common policy type among the available policies. | customers : customer_id , customer_name | services : service_id , service_name | available_policies : policy_id , policy_type_code , customer_phone | customers_policies : customer_id , policy_id , date_opened , date_closed | first_notification_of_loss : fnol_id , customer_id , policy_id , service_id | claims : claim_id , fnol_id , effective_date | settlements : settlement_id , claim_id , effective_date , settlement_amount | customers_policies.policy_id = available_policies.policy_id | customers_policies.customer_id = customers.customer_id | first_notification_of_loss.customer_id = customers_policies.customer_id | first_notification_of_loss.policy_id = customers_policies.policy_id | first_notification_of_loss.service_id = services.service_id | claims.fnol_id = first_notification_of_loss.fnol_id | settlements.claim_id = claims.claim_id | 

### Response:

select customer_phone from available_policies where policy_type_code = ( select policy_type_code from available_policies group by policy_type_code order by count ( * ) desc limit 1 )

### Instruction:

Convert text to sql: Find the policy type used by more than 4 customers. | customers : customer_id , customer_name | services : service_id , service_name | available_policies : policy_id , policy_type_code , customer_phone | customers_policies : customer_id , policy_id , date_opened , date_closed | first_notification_of_loss : fnol_id , customer_id , policy_id , service_id | claims : claim_id , fnol_id , effective_date | settlements : settlement_id , claim_id , effective_date , settlement_amount | customers_policies.policy_id = available_policies.policy_id | customers_policies.customer_id = customers.customer_id | first_notification_of_loss.customer_id = customers_policies.customer_id | first_notification_of_loss.policy_id = customers_policies.policy_id | first_notification_of_loss.service_id = services.service_id | claims.fnol_id = first_notification_of_loss.fnol_id | settlements.claim_id = claims.claim_id | 

### Response:

select policy_type_code from available_policies group by policy_type_code having count ( * ) > 4
### Instruction:

Convert text to sql: Find the policy types more than 4 customers use. Show their type code. | customers : customer_id , customer_name | services : service_id , service_name | available_policies : policy_id , policy_type_code , customer_phone | customers_policies : customer_id , policy_id , date_opened , date_closed | first_notification_of_loss : fnol_id , customer_id , policy_id , service_id | claims : claim_id , fnol_id , effective_date | settlements : settlement_id , claim_id , effective_date , settlement_amount | customers_policies.policy_id = available_policies.policy_id | customers_policies.customer_id = customers.customer_id | first_notification_of_loss.customer_id = customers_policies.customer_id | first_notification_of_loss.policy_id = customers_policies.policy_id | first_notification_of_loss.service_id = services.service_id | claims.fnol_id = first_notification_of_loss.fnol_id | settlements.claim_id = claims.claim_id | 

### Response:

select policy_type_code from available_policies group by policy_type_code having count ( * ) > 4

### Instruction:

Convert text to sql: Find the total and average amount of settlements. | customers : customer_id , customer_name | services : service_id , service_name | available_policies : policy_id , policy_type_code , customer_phone | customers_policies : customer_id , policy_id , date_opened , date_closed | first_notification_of_loss : fnol_id , customer_id , policy_id , service_id | claims : claim_id , fnol_id , effective_date | settlements : settlement_id , claim_id , effective_date , settlement_amount | customers_policies.policy_id = available_policies.policy_id | customers_policies.customer_id = customers.customer_id | first_notification_of_loss.customer_id = customers_policies.customer_id | first_notification_of_loss.policy_id = customers_policies.policy_id | first_notification_of_loss.service_id = services.service_id | claims.fnol_id = first_notification_of_loss.fnol_id | settlements.claim_id = claims.claim_id | 

### Response:

select sum ( settlement_amount ) , avg ( settlement_amount ) from settlements

### Instruction:

Convert text to sql: Return the sum and average of all settlement amounts. | customers : customer_id , customer_name | services : service_id , service_name | available_policies : policy_id , policy_type_code , customer_phone | customers_policies : customer_id , policy_id , date_opened , date_closed | first_notification_of_loss : fnol_id , customer_id , policy_id , service_id | claims : claim_id , fnol_id , effective_date | settlements : settlement_id , claim_id , effective_date , settlement_amount | customers_policies.policy_id = available_policies.policy_id | customers_policies.customer_id = customers.customer_id | first_notification_of_loss.customer_id = customers_policies.customer_id | first_notification_of_loss.policy_id = customers_policies.policy_id | first_notification_of_loss.service_id = services.service_id | claims.fnol_id = first_notification_of_loss.fnol_id | settlements.claim_id = claims.claim_id | 

### Response:

select sum ( settlement_amount ) , avg ( settlement_amount ) from settlements
### Instruction:

Convert text to sql: Find the name of services that have been used for more than 2 times in first notification of loss. | customers : customer_id , customer_name | services : service_id , service_name | available_policies : policy_id , policy_type_code , customer_phone | customers_policies : customer_id , policy_id , date_opened , date_closed | first_notification_of_loss : fnol_id , customer_id , policy_id , service_id | claims : claim_id , fnol_id , effective_date | settlements : settlement_id , claim_id , effective_date , settlement_amount | customers_policies.policy_id = available_policies.policy_id | customers_policies.customer_id = customers.customer_id | first_notification_of_loss.customer_id = customers_policies.customer_id | first_notification_of_loss.policy_id = customers_policies.policy_id | first_notification_of_loss.service_id = services.service_id | claims.fnol_id = first_notification_of_loss.fnol_id | settlements.claim_id = claims.claim_id | 

### Response:

select services.service_name from first_notification_of_loss join services on first_notification_of_loss.service_id = services.service_id group by first_notification_of_loss.service_id having count ( * ) > 2

### Instruction:

Convert text to sql: Which services have been used more than twice in first notification of loss? Return the service name. | customers : customer_id , customer_name | services : service_id , service_name | available_policies : policy_id , policy_type_code , customer_phone | customers_policies : customer_id , policy_id , date_opened , date_closed | first_notification_of_loss : fnol_id , customer_id , policy_id , service_id | claims : claim_id , fnol_id , effective_date | settlements : settlement_id , claim_id , effective_date , settlement_amount | customers_policies.policy_id = available_policies.policy_id | customers_policies.customer_id = customers.customer_id | first_notification_of_loss.customer_id = customers_policies.customer_id | first_notification_of_loss.policy_id = customers_policies.policy_id | first_notification_of_loss.service_id = services.service_id | claims.fnol_id = first_notification_of_loss.fnol_id | settlements.claim_id = claims.claim_id | 

### Response:

select services.service_name from first_notification_of_loss join services on first_notification_of_loss.service_id = services.service_id group by first_notification_of_loss.service_id having count ( * ) > 2
### Instruction:

Convert text to sql: What is the effective date of the claim that has the largest amount of total settlement? | customers : customer_id , customer_name | services : service_id , service_name | available_policies : policy_id , policy_type_code , customer_phone | customers_policies : customer_id , policy_id , date_opened , date_closed | first_notification_of_loss : fnol_id , customer_id , policy_id , service_id | claims : claim_id , fnol_id , effective_date | settlements : settlement_id , claim_id , effective_date , settlement_amount | customers_policies.policy_id = available_policies.policy_id | customers_policies.customer_id = customers.customer_id | first_notification_of_loss.customer_id = customers_policies.customer_id | first_notification_of_loss.policy_id = customers_policies.policy_id | first_notification_of_loss.service_id = services.service_id | claims.fnol_id = first_notification_of_loss.fnol_id | settlements.claim_id = claims.claim_id | 

### Response:

select claims.effective_date from claims join settlements on claims.claim_id = settlements.claim_id group by claims.claim_id order by sum ( settlements.settlement_amount ) desc limit 1

### Instruction:

Convert text to sql: Find the claim that has the largest total settlement amount. Return the effective date of the claim. | customers : customer_id , customer_name | services : service_id , service_name | available_policies : policy_id , policy_type_code , customer_phone | customers_policies : customer_id , policy_id , date_opened , date_closed | first_notification_of_loss : fnol_id , customer_id , policy_id , service_id | claims : claim_id , fnol_id , effective_date | settlements : settlement_id , claim_id , effective_date , settlement_amount | customers_policies.policy_id = available_policies.policy_id | customers_policies.customer_id = customers.customer_id | first_notification_of_loss.customer_id = customers_policies.customer_id | first_notification_of_loss.policy_id = customers_policies.policy_id | first_notification_of_loss.service_id = services.service_id | claims.fnol_id = first_notification_of_loss.fnol_id | settlements.claim_id = claims.claim_id | 

### Response:

select claims.effective_date from claims join settlements on claims.claim_id = settlements.claim_id group by claims.claim_id order by sum ( settlements.settlement_amount ) desc limit 1
### Instruction:

Convert text to sql: How many policies are listed for the customer named "Dayana Robel"? | customers : customer_id , customer_name | services : service_id , service_name | available_policies : policy_id , policy_type_code , customer_phone | customers_policies : customer_id , policy_id , date_opened , date_closed | first_notification_of_loss : fnol_id , customer_id , policy_id , service_id | claims : claim_id , fnol_id , effective_date | settlements : settlement_id , claim_id , effective_date , settlement_amount | customers_policies.policy_id = available_policies.policy_id | customers_policies.customer_id = customers.customer_id | first_notification_of_loss.customer_id = customers_policies.customer_id | first_notification_of_loss.policy_id = customers_policies.policy_id | first_notification_of_loss.service_id = services.service_id | claims.fnol_id = first_notification_of_loss.fnol_id | settlements.claim_id = claims.claim_id | 

### Response:

select count ( * ) from customers join customers_policies on customers.customer_id = customers_policies.customer_id where customers.customer_name = 'Dayana Robel'

### Instruction:

Convert text to sql: Count the total number of policies used by the customer named "Dayana Robel". | customers : customer_id , customer_name | services : service_id , service_name | available_policies : policy_id , policy_type_code , customer_phone | customers_policies : customer_id , policy_id , date_opened , date_closed | first_notification_of_loss : fnol_id , customer_id , policy_id , service_id | claims : claim_id , fnol_id , effective_date | settlements : settlement_id , claim_id , effective_date , settlement_amount | customers_policies.policy_id = available_policies.policy_id | customers_policies.customer_id = customers.customer_id | first_notification_of_loss.customer_id = customers_policies.customer_id | first_notification_of_loss.policy_id = customers_policies.policy_id | first_notification_of_loss.service_id = services.service_id | claims.fnol_id = first_notification_of_loss.fnol_id | settlements.claim_id = claims.claim_id | 

### Response:

select count ( * ) from customers join customers_policies on customers.customer_id = customers_policies.customer_id where customers.customer_name = 'Dayana Robel'
### Instruction:

Convert text to sql: What is the name of the customer who has the most policies listed? | customers : customer_id , customer_name | services : service_id , service_name | available_policies : policy_id , policy_type_code , customer_phone | customers_policies : customer_id , policy_id , date_opened , date_closed | first_notification_of_loss : fnol_id , customer_id , policy_id , service_id | claims : claim_id , fnol_id , effective_date | settlements : settlement_id , claim_id , effective_date , settlement_amount | customers_policies.policy_id = available_policies.policy_id | customers_policies.customer_id = customers.customer_id | first_notification_of_loss.customer_id = customers_policies.customer_id | first_notification_of_loss.policy_id = customers_policies.policy_id | first_notification_of_loss.service_id = services.service_id | claims.fnol_id = first_notification_of_loss.fnol_id | settlements.claim_id = claims.claim_id | 

### Response:

select customers.customer_name from customers join customers_policies on customers.customer_id = customers_policies.customer_id group by customers.customer_name order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: Which customer uses the most policies? Give me the customer name. | customers : customer_id , customer_name | services : service_id , service_name | available_policies : policy_id , policy_type_code , customer_phone | customers_policies : customer_id , policy_id , date_opened , date_closed | first_notification_of_loss : fnol_id , customer_id , policy_id , service_id | claims : claim_id , fnol_id , effective_date | settlements : settlement_id , claim_id , effective_date , settlement_amount | customers_policies.policy_id = available_policies.policy_id | customers_policies.customer_id = customers.customer_id | first_notification_of_loss.customer_id = customers_policies.customer_id | first_notification_of_loss.policy_id = customers_policies.policy_id | first_notification_of_loss.service_id = services.service_id | claims.fnol_id = first_notification_of_loss.fnol_id | settlements.claim_id = claims.claim_id | 

### Response:

select customers.customer_name from customers join customers_policies on customers.customer_id = customers_policies.customer_id group by customers.customer_name order by count ( * ) desc limit 1
### Instruction:

Convert text to sql: What are all the policy types of the customer named "Dayana Robel"? | customers : customer_id , customer_name | services : service_id , service_name | available_policies : policy_id , policy_type_code , customer_phone | customers_policies : customer_id , policy_id , date_opened , date_closed | first_notification_of_loss : fnol_id , customer_id , policy_id , service_id | claims : claim_id , fnol_id , effective_date | settlements : settlement_id , claim_id , effective_date , settlement_amount | customers_policies.policy_id = available_policies.policy_id | customers_policies.customer_id = customers.customer_id | first_notification_of_loss.customer_id = customers_policies.customer_id | first_notification_of_loss.policy_id = customers_policies.policy_id | first_notification_of_loss.service_id = services.service_id | claims.fnol_id = first_notification_of_loss.fnol_id | settlements.claim_id = claims.claim_id | 

### Response:

select distinct available_policies.policy_type_code from customers join customers_policies on customers.customer_id = customers_policies.customer_id join available_policies on customers_policies.policy_id = available_policies.policy_id where customers.customer_name = 'Dayana Robel'

### Instruction:

Convert text to sql: Tell me the types of the policy used by the customer named "Dayana Robel". | customers : customer_id , customer_name | services : service_id , service_name | available_policies : policy_id , policy_type_code , customer_phone | customers_policies : customer_id , policy_id , date_opened , date_closed | first_notification_of_loss : fnol_id , customer_id , policy_id , service_id | claims : claim_id , fnol_id , effective_date | settlements : settlement_id , claim_id , effective_date , settlement_amount | customers_policies.policy_id = available_policies.policy_id | customers_policies.customer_id = customers.customer_id | first_notification_of_loss.customer_id = customers_policies.customer_id | first_notification_of_loss.policy_id = customers_policies.policy_id | first_notification_of_loss.service_id = services.service_id | claims.fnol_id = first_notification_of_loss.fnol_id | settlements.claim_id = claims.claim_id | 

### Response:

select distinct available_policies.policy_type_code from customers join customers_policies on customers.customer_id = customers_policies.customer_id join available_policies on customers_policies.policy_id = available_policies.policy_id where customers.customer_name = 'Dayana Robel'
### Instruction:

Convert text to sql: What are all the policy types of the customer that has the most policies listed? | customers : customer_id , customer_name | services : service_id , service_name | available_policies : policy_id , policy_type_code , customer_phone | customers_policies : customer_id , policy_id , date_opened , date_closed | first_notification_of_loss : fnol_id , customer_id , policy_id , service_id | claims : claim_id , fnol_id , effective_date | settlements : settlement_id , claim_id , effective_date , settlement_amount | customers_policies.policy_id = available_policies.policy_id | customers_policies.customer_id = customers.customer_id | first_notification_of_loss.customer_id = customers_policies.customer_id | first_notification_of_loss.policy_id = customers_policies.policy_id | first_notification_of_loss.service_id = services.service_id | claims.fnol_id = first_notification_of_loss.fnol_id | settlements.claim_id = claims.claim_id | 

### Response:

select distinct available_policies.policy_type_code from customers join customers_policies on customers.customer_id = customers_policies.customer_id join available_policies on customers_policies.policy_id = available_policies.policy_id where customers.customer_name = ( select customers.customer_name from customers join customers_policies on customers.customer_id = customers_policies.customer_id group by customers.customer_name order by count ( * ) desc limit 1 )

### Instruction:

Convert text to sql: List all the policy types used by the customer enrolled in the most policies. | customers : customer_id , customer_name | services : service_id , service_name | available_policies : policy_id , policy_type_code , customer_phone | customers_policies : customer_id , policy_id , date_opened , date_closed | first_notification_of_loss : fnol_id , customer_id , policy_id , service_id | claims : claim_id , fnol_id , effective_date | settlements : settlement_id , claim_id , effective_date , settlement_amount | customers_policies.policy_id = available_policies.policy_id | customers_policies.customer_id = customers.customer_id | first_notification_of_loss.customer_id = customers_policies.customer_id | first_notification_of_loss.policy_id = customers_policies.policy_id | first_notification_of_loss.service_id = services.service_id | claims.fnol_id = first_notification_of_loss.fnol_id | settlements.claim_id = claims.claim_id | 

### Response:

select distinct available_policies.policy_type_code from customers join customers_policies on customers.customer_id = customers_policies.customer_id join available_policies on customers_policies.policy_id = available_policies.policy_id where customers.customer_name = ( select customers.customer_name from customers join customers_policies on customers.customer_id = customers_policies.customer_id group by customers.customer_name order by count ( * ) desc limit 1 )