richardr1126/spider-skeleton-context-instruct huggingface dataset:
### 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 ( _ ) from _ where _ | 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 ( _ ) from _ where _ | 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 _ ) from _ where _ | 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 _ ) from _ where _ | 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 _ where _ | 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 _ where _ | 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 _ from _ where _ | 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 _ from _ where _ | 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 ( _ ) from _ where _ | 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 ( _ ) from _ where _ | 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 amount of products ordered before 2018-03-17 07:13:53. | 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 ( _ ) from _ where _ | 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_date < '2018-03-17 07:13:53'
### Instruction:

Convert text to sql: What is the total amount of products purchased before 2018-03-17 07:13:53? | 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 ( _ ) from _ where _ | 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_date < '2018-03-17 07:13:53'
### Instruction:

Convert text to sql: Who made the latest order? | 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 _ from _ order by _ desc limit _ | select customers.customer_name from customers join customer_orders on customers.customer_id = customer_orders.customer_id order by customer_orders.order_date desc limit 1
### Instruction:

Convert text to sql: Find the name of the customer who made an order most recently. | 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 _ from _ order by _ desc limit _ | select customers.customer_name from customers join customer_orders on customers.customer_id = customer_orders.customer_id order by customer_orders.order_date desc limit 1
### Instruction:

Convert text to sql: Which product has been ordered most number of times? | 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 _ from _ group by _ order by count ( _ ) desc limit _ | select products.product_details from order_items join products on order_items.product_id = products.product_id group by order_items.product_id order by count ( * ) desc limit 1
### Instruction:

Convert text to sql: What is the most frequently ordered product? Tell me the detail of the product | 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 _ from _ group by _ order by count ( _ ) desc limit _ | select products.product_details from order_items join products on order_items.product_id = products.product_id group by order_items.product_id order by count ( * ) desc limit 1
### Instruction:

Convert text to sql: Find the name and ID of the product whose total order quantity is the largest. | 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 _ from _ group by _ order by sum ( _ ) asc limit _ | select products.product_details , products.product_id from order_items join products on order_items.product_id = products.product_id group by order_items.product_id order by sum ( order_items.order_quantity ) asc limit 1
### Instruction:

Convert text to sql: What are the name and ID of the product bought the most. | 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 _ from _ group by _ order by sum ( _ ) asc limit _ | select products.product_details , products.product_id from order_items join products on order_items.product_id = products.product_id group by order_items.product_id order by sum ( order_items.order_quantity ) asc limit 1