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

Convert text to sql: Find the contact channel code that was used by the customer named "Tillman Ernser". | 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 distinct _ from _ where _ | select distinct channel_code from customers join customer_contact_channels on customers.customer_id = customer_contact_channels.customer_id where customers.customer_name = 'Tillman Ernser'
### Instruction:

Convert text to sql: What is the "active to date" of the latest contact channel used by "Tillman Ernser"? | 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 max ( _ ) from _ where _ | select max ( customer_contact_channels.active_to_date ) from customers join customer_contact_channels on customers.customer_id = customer_contact_channels.customer_id where customers.customer_name = 'Tillman Ernser'
### Instruction:

Convert text to sql: Return the the "active to date" of the latest contact channel used by the customer named "Tillman Ernser". | 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 max ( _ ) from _ where _ | select max ( customer_contact_channels.active_to_date ) from customers join customer_contact_channels on customers.customer_id = customer_contact_channels.customer_id where customers.customer_name = 'Tillman Ernser'
### Instruction:

Convert text to sql: What is the average time span of contact channels in the database? | 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 avg ( _ - _ ) from _ | select avg ( active_to_date - active_from_date ) from customer_contact_channels
### Instruction:

Convert text to sql: Compute the average active time span of contact channels. | 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 avg ( _ - _ ) from _ | select avg ( active_to_date - active_from_date ) from customer_contact_channels
### Instruction:

Convert text to sql: What is the channel code and contact number of the customer contact channel that was active for the longest 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 _ from _ where _ - _ = ( select _ - _ from _ order by ( _ - _ ) desc limit _ ) | select channel_code , contact_number from customer_contact_channels where active_to_date - active_from_date = ( select active_to_date - active_from_date from customer_contact_channels order by ( active_to_date - active_from_date ) desc limit 1 )
### Instruction:

Convert text to sql: Return the channel code and contact number of the customer contact channel whose active duration was the longest. | 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 _ - _ from _ order by ( _ - _ ) desc limit _ ) | select channel_code , contact_number from customer_contact_channels where active_to_date - active_from_date = ( select active_to_date - active_from_date from customer_contact_channels order by ( active_to_date - active_from_date ) desc limit 1 )
### Instruction:

Convert text to sql: Find the name and active date of the customer that use email as the contact channel. | 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_contact_channels.active_from_date from customers join customer_contact_channels on customers.customer_id = customer_contact_channels.customer_id where customer_contact_channels.channel_code = 'Email'
### Instruction:

Convert text to sql: What are the name and active date of the customers whose contact channel code is email? | 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_contact_channels.active_from_date from customers join customer_contact_channels on customers.customer_id = customer_contact_channels.customer_id where customer_contact_channels.channel_code = 'Email'
### 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 _ from _ where _ = ( select max ( _ ) from _ ) | 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 _ from _ where _ = ( select max ( _ ) from _ ) | 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 _ from _ group by _ order by sum ( _ ) desc limit _ | 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 _ from _ group by _ order by sum ( _ ) desc limit _ | 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 _ from _ group by _ order by sum ( _ ) asc limit _ | 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 _ from _ group by _ order by sum ( _ ) asc limit _ | 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 _ ) from _ where _ | 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 _ ) from _ where _ | 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'