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

Convert text to sql: What is the name of the customer that made the order with the largest quantity? | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.customer_id = customers.customer_id | customer_orders.customer_id = customers.customer_id | order_items.order_id = customer_orders.order_id | order_items.product_id = products.product_id | 

### Response:

select customers.customer_name from customers join customer_orders on customers.customer_id = customer_orders.customer_id join order_items on customer_orders.order_id = order_items.order_id where order_items.order_quantity = ( select max ( order_quantity ) from order_items )

### Instruction:

Convert text to sql: Find the name of the customer who made the order of the largest amount of goods. | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.customer_id = customers.customer_id | customer_orders.customer_id = customers.customer_id | order_items.order_id = customer_orders.order_id | order_items.product_id = products.product_id | 

### Response:

select customers.customer_name from customers join customer_orders on customers.customer_id = customer_orders.customer_id join order_items on customer_orders.order_id = order_items.order_id where order_items.order_quantity = ( select max ( order_quantity ) from order_items )
### Instruction:

Convert text to sql: What is the name of the customer that has purchased the most items? | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.customer_id = customers.customer_id | customer_orders.customer_id = customers.customer_id | order_items.order_id = customer_orders.order_id | order_items.product_id = products.product_id | 

### Response:

select customers.customer_name from customers join customer_orders on customers.customer_id = customer_orders.customer_id join order_items on customer_orders.order_id = order_items.order_id group by customers.customer_name order by sum ( order_items.order_quantity ) desc limit 1

### Instruction:

Convert text to sql: Give me the name of the customer who ordered the most items in total. | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.customer_id = customers.customer_id | customer_orders.customer_id = customers.customer_id | order_items.order_id = customer_orders.order_id | order_items.product_id = products.product_id | 

### Response:

select customers.customer_name from customers join customer_orders on customers.customer_id = customer_orders.customer_id join order_items on customer_orders.order_id = order_items.order_id group by customers.customer_name order by sum ( order_items.order_quantity ) desc limit 1
### Instruction:

Convert text to sql: What is the payment method of the customer that has purchased the least quantity of items? | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.customer_id = customers.customer_id | customer_orders.customer_id = customers.customer_id | order_items.order_id = customer_orders.order_id | order_items.product_id = products.product_id | 

### Response:

select customers.payment_method from customers join customer_orders on customers.customer_id = customer_orders.customer_id join order_items on customer_orders.order_id = order_items.order_id group by customers.customer_name order by sum ( order_items.order_quantity ) asc limit 1

### Instruction:

Convert text to sql: Tell me the payment method used by the customer who ordered the least amount of goods in total. | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.customer_id = customers.customer_id | customer_orders.customer_id = customers.customer_id | order_items.order_id = customer_orders.order_id | order_items.product_id = products.product_id | 

### Response:

select customers.payment_method from customers join customer_orders on customers.customer_id = customer_orders.customer_id join order_items on customer_orders.order_id = order_items.order_id group by customers.customer_name order by sum ( order_items.order_quantity ) asc limit 1
### Instruction:

Convert text to sql: How many types of products have Rodrick Heaney bought in total? | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.customer_id = customers.customer_id | customer_orders.customer_id = customers.customer_id | order_items.order_id = customer_orders.order_id | order_items.product_id = products.product_id | 

### Response:

select count ( distinct order_items.product_id ) from customers join customer_orders on customers.customer_id = customer_orders.customer_id join order_items on customer_orders.order_id = order_items.order_id where customers.customer_name = 'Rodrick Heaney'

### Instruction:

Convert text to sql: Find the number of distinct products Rodrick Heaney has bought so far. | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.customer_id = customers.customer_id | customer_orders.customer_id = customers.customer_id | order_items.order_id = customer_orders.order_id | order_items.product_id = products.product_id | 

### Response:

select count ( distinct order_items.product_id ) from customers join customer_orders on customers.customer_id = customer_orders.customer_id join order_items on customer_orders.order_id = order_items.order_id where customers.customer_name = 'Rodrick Heaney'
### Instruction:

Convert text to sql: What is the total quantity of products purchased by "Rodrick Heaney"? | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.customer_id = customers.customer_id | customer_orders.customer_id = customers.customer_id | order_items.order_id = customer_orders.order_id | order_items.product_id = products.product_id | 

### Response:

select sum ( order_items.order_quantity ) from customers join customer_orders on customers.customer_id = customer_orders.customer_id join order_items on customer_orders.order_id = order_items.order_id where customers.customer_name = 'Rodrick Heaney'

### Instruction:

Convert text to sql: Tell me the total quantity of products bought by the customer called "Rodrick Heaney". | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.customer_id = customers.customer_id | customer_orders.customer_id = customers.customer_id | order_items.order_id = customer_orders.order_id | order_items.product_id = products.product_id | 

### Response:

select sum ( order_items.order_quantity ) from customers join customer_orders on customers.customer_id = customer_orders.customer_id join order_items on customer_orders.order_id = order_items.order_id where customers.customer_name = 'Rodrick Heaney'
### Instruction:

Convert text to sql: How many customers have at least one order with status "Cancelled"? | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.customer_id = customers.customer_id | customer_orders.customer_id = customers.customer_id | order_items.order_id = customer_orders.order_id | order_items.product_id = products.product_id | 

### Response:

select count ( distinct customer_id ) from customer_orders where order_status = 'Cancelled'

### Instruction:

Convert text to sql: Return the number of customers who have at least one order with "Cancelled" status. | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.customer_id = customers.customer_id | customer_orders.customer_id = customers.customer_id | order_items.order_id = customer_orders.order_id | order_items.product_id = products.product_id | 

### Response:

select count ( distinct customer_id ) from customer_orders where order_status = 'Cancelled'
### Instruction:

Convert text to sql: How many orders have detail "Second time"? | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.customer_id = customers.customer_id | customer_orders.customer_id = customers.customer_id | order_items.order_id = customer_orders.order_id | order_items.product_id = products.product_id | 

### Response:

select count ( * ) from customer_orders where order_details = 'Second time'

### Instruction:

Convert text to sql: Tell me the number of orders with "Second time" as order detail. | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.customer_id = customers.customer_id | customer_orders.customer_id = customers.customer_id | order_items.order_id = customer_orders.order_id | order_items.product_id = products.product_id | 

### Response:

select count ( * ) from customer_orders where order_details = 'Second time'
### Instruction:

Convert text to sql: Find the customer name and date of the orders that have the status "Delivered". | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.customer_id = customers.customer_id | customer_orders.customer_id = customers.customer_id | order_items.order_id = customer_orders.order_id | order_items.product_id = products.product_id | 

### Response:

select customers.customer_name , customer_orders.order_date from customers join customer_orders on customers.customer_id = customer_orders.customer_id where order_status = 'Delivered'

### Instruction:

Convert text to sql: What are the customer name and date of the orders whose status is "Delivered". | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.customer_id = customers.customer_id | customer_orders.customer_id = customers.customer_id | order_items.order_id = customer_orders.order_id | order_items.product_id = products.product_id | 

### Response:

select customers.customer_name , customer_orders.order_date from customers join customer_orders on customers.customer_id = customer_orders.customer_id where order_status = 'Delivered'
### Instruction:

Convert text to sql: What is the total number of products that are in orders with status "Cancelled"? | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.customer_id = customers.customer_id | customer_orders.customer_id = customers.customer_id | order_items.order_id = customer_orders.order_id | order_items.product_id = products.product_id | 

### Response:

select sum ( order_items.order_quantity ) from customer_orders join order_items on customer_orders.order_id = order_items.order_id where customer_orders.order_status = 'Cancelled'

### Instruction:

Convert text to sql: Find the total quantity of products associated with the orders in the "Cancelled" status. | addresses : address_id , address_content , city , zip_postcode , state_province_county , country , other_address_details | products : product_id , product_details | customers : customer_id , payment_method , customer_name , date_became_customer , other_customer_details | customer_addresses : customer_id , address_id , date_address_from , address_type , date_address_to | customer_contact_channels : customer_id , channel_code , active_from_date , active_to_date , contact_number | customer_orders : order_id , customer_id , order_status , order_date , order_details | order_items : order_id , product_id , order_quantity | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_contact_channels.customer_id = customers.customer_id | customer_orders.customer_id = customers.customer_id | order_items.order_id = customer_orders.order_id | order_items.product_id = products.product_id | 

### Response:

select sum ( order_items.order_quantity ) from customer_orders join order_items on customer_orders.order_id = order_items.order_id where customer_orders.order_status = 'Cancelled'