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

Convert text to sql: List the name and count of each product in all orders. | customers : customer_id , customer_name , customer_details | invoices : invoice_number , invoice_date , invoice_details | orders : order_id , customer_id , order_status , date_order_placed , order_details | products : product_id , product_name , product_details | order_items : order_item_id , product_id , order_id , order_item_status , order_item_details | shipments : shipment_id , order_id , invoice_number , shipment_tracking_number , shipment_date , other_shipment_details | shipment_items : shipment_id , order_item_id | orders.customer_id = customers.customer_id | order_items.product_id = products.product_id | order_items.order_id = orders.order_id | shipments.invoice_number = invoices.invoice_number | shipments.order_id = orders.order_id | shipment_items.shipment_id = shipments.shipment_id | shipment_items.order_item_id = order_items.order_item_id | 

### Response:

select products.product_name , count ( * ) from orders join order_items join products on orders.order_id = order_items.order_id and order_items.product_id = products.product_id group by products.product_id

### Instruction:

Convert text to sql: For each product, show its name and the number of times it was ordered. | customers : customer_id , customer_name , customer_details | invoices : invoice_number , invoice_date , invoice_details | orders : order_id , customer_id , order_status , date_order_placed , order_details | products : product_id , product_name , product_details | order_items : order_item_id , product_id , order_id , order_item_status , order_item_details | shipments : shipment_id , order_id , invoice_number , shipment_tracking_number , shipment_date , other_shipment_details | shipment_items : shipment_id , order_item_id | orders.customer_id = customers.customer_id | order_items.product_id = products.product_id | order_items.order_id = orders.order_id | shipments.invoice_number = invoices.invoice_number | shipments.order_id = orders.order_id | shipment_items.shipment_id = shipments.shipment_id | shipment_items.order_item_id = order_items.order_item_id | 

### Response:

select products.product_name , count ( * ) from orders join order_items join products on orders.order_id = order_items.order_id and order_items.product_id = products.product_id group by products.product_id
### Instruction:

Convert text to sql: Find the ids of orders which are shipped after 2000-01-01. | customers : customer_id , customer_name , customer_details | invoices : invoice_number , invoice_date , invoice_details | orders : order_id , customer_id , order_status , date_order_placed , order_details | products : product_id , product_name , product_details | order_items : order_item_id , product_id , order_id , order_item_status , order_item_details | shipments : shipment_id , order_id , invoice_number , shipment_tracking_number , shipment_date , other_shipment_details | shipment_items : shipment_id , order_item_id | orders.customer_id = customers.customer_id | order_items.product_id = products.product_id | order_items.order_id = orders.order_id | shipments.invoice_number = invoices.invoice_number | shipments.order_id = orders.order_id | shipment_items.shipment_id = shipments.shipment_id | shipment_items.order_item_id = order_items.order_item_id | 

### Response:

select order_id from shipments where shipment_date > '2000-01-01'

### Instruction:

Convert text to sql: Which orders have shipment after 2000-01-01? Give me the order ids. | customers : customer_id , customer_name , customer_details | invoices : invoice_number , invoice_date , invoice_details | orders : order_id , customer_id , order_status , date_order_placed , order_details | products : product_id , product_name , product_details | order_items : order_item_id , product_id , order_id , order_item_status , order_item_details | shipments : shipment_id , order_id , invoice_number , shipment_tracking_number , shipment_date , other_shipment_details | shipment_items : shipment_id , order_item_id | orders.customer_id = customers.customer_id | order_items.product_id = products.product_id | order_items.order_id = orders.order_id | shipments.invoice_number = invoices.invoice_number | shipments.order_id = orders.order_id | shipment_items.shipment_id = shipments.shipment_id | shipment_items.order_item_id = order_items.order_item_id | 

### Response:

select order_id from shipments where shipment_date > '2000-01-01'

### Instruction:

Convert text to sql: Find the id of the order which is shipped most recently. | customers : customer_id , customer_name , customer_details | invoices : invoice_number , invoice_date , invoice_details | orders : order_id , customer_id , order_status , date_order_placed , order_details | products : product_id , product_name , product_details | order_items : order_item_id , product_id , order_id , order_item_status , order_item_details | shipments : shipment_id , order_id , invoice_number , shipment_tracking_number , shipment_date , other_shipment_details | shipment_items : shipment_id , order_item_id | orders.customer_id = customers.customer_id | order_items.product_id = products.product_id | order_items.order_id = orders.order_id | shipments.invoice_number = invoices.invoice_number | shipments.order_id = orders.order_id | shipment_items.shipment_id = shipments.shipment_id | shipment_items.order_item_id = order_items.order_item_id | 

### Response:

select order_id from shipments where shipment_date = ( select max ( shipment_date ) from shipments )
### Instruction:

Convert text to sql: Which order has the most recent shipment? Give me the order id. | customers : customer_id , customer_name , customer_details | invoices : invoice_number , invoice_date , invoice_details | orders : order_id , customer_id , order_status , date_order_placed , order_details | products : product_id , product_name , product_details | order_items : order_item_id , product_id , order_id , order_item_status , order_item_details | shipments : shipment_id , order_id , invoice_number , shipment_tracking_number , shipment_date , other_shipment_details | shipment_items : shipment_id , order_item_id | orders.customer_id = customers.customer_id | order_items.product_id = products.product_id | order_items.order_id = orders.order_id | shipments.invoice_number = invoices.invoice_number | shipments.order_id = orders.order_id | shipment_items.shipment_id = shipments.shipment_id | shipment_items.order_item_id = order_items.order_item_id | 

### Response:

select order_id from shipments where shipment_date = ( select max ( shipment_date ) from shipments )

### Instruction:

Convert text to sql: List the names of all distinct products in alphabetical order. | customers : customer_id , customer_name , customer_details | invoices : invoice_number , invoice_date , invoice_details | orders : order_id , customer_id , order_status , date_order_placed , order_details | products : product_id , product_name , product_details | order_items : order_item_id , product_id , order_id , order_item_status , order_item_details | shipments : shipment_id , order_id , invoice_number , shipment_tracking_number , shipment_date , other_shipment_details | shipment_items : shipment_id , order_item_id | orders.customer_id = customers.customer_id | order_items.product_id = products.product_id | order_items.order_id = orders.order_id | shipments.invoice_number = invoices.invoice_number | shipments.order_id = orders.order_id | shipment_items.shipment_id = shipments.shipment_id | shipment_items.order_item_id = order_items.order_item_id | 

### Response:

select distinct product_name from products order by product_name asc

### Instruction:

Convert text to sql: Sort all the distinct products in alphabetical order. | customers : customer_id , customer_name , customer_details | invoices : invoice_number , invoice_date , invoice_details | orders : order_id , customer_id , order_status , date_order_placed , order_details | products : product_id , product_name , product_details | order_items : order_item_id , product_id , order_id , order_item_status , order_item_details | shipments : shipment_id , order_id , invoice_number , shipment_tracking_number , shipment_date , other_shipment_details | shipment_items : shipment_id , order_item_id | orders.customer_id = customers.customer_id | order_items.product_id = products.product_id | order_items.order_id = orders.order_id | shipments.invoice_number = invoices.invoice_number | shipments.order_id = orders.order_id | shipment_items.shipment_id = shipments.shipment_id | shipment_items.order_item_id = order_items.order_item_id | 

### Response:

select distinct product_name from products order by product_name asc
### Instruction:

Convert text to sql: List the ids of all distinct orders ordered by placed date. | customers : customer_id , customer_name , customer_details | invoices : invoice_number , invoice_date , invoice_details | orders : order_id , customer_id , order_status , date_order_placed , order_details | products : product_id , product_name , product_details | order_items : order_item_id , product_id , order_id , order_item_status , order_item_details | shipments : shipment_id , order_id , invoice_number , shipment_tracking_number , shipment_date , other_shipment_details | shipment_items : shipment_id , order_item_id | orders.customer_id = customers.customer_id | order_items.product_id = products.product_id | order_items.order_id = orders.order_id | shipments.invoice_number = invoices.invoice_number | shipments.order_id = orders.order_id | shipment_items.shipment_id = shipments.shipment_id | shipment_items.order_item_id = order_items.order_item_id | 

### Response:

select distinct order_id from orders order by date_order_placed asc

### Instruction:

Convert text to sql: What are ids of the all distinct orders, sorted by placement date? | customers : customer_id , customer_name , customer_details | invoices : invoice_number , invoice_date , invoice_details | orders : order_id , customer_id , order_status , date_order_placed , order_details | products : product_id , product_name , product_details | order_items : order_item_id , product_id , order_id , order_item_status , order_item_details | shipments : shipment_id , order_id , invoice_number , shipment_tracking_number , shipment_date , other_shipment_details | shipment_items : shipment_id , order_item_id | orders.customer_id = customers.customer_id | order_items.product_id = products.product_id | order_items.order_id = orders.order_id | shipments.invoice_number = invoices.invoice_number | shipments.order_id = orders.order_id | shipment_items.shipment_id = shipments.shipment_id | shipment_items.order_item_id = order_items.order_item_id | 

### Response:

select distinct order_id from orders order by date_order_placed asc
### Instruction:

Convert text to sql: What is the id of the order which has the most items? | customers : customer_id , customer_name , customer_details | invoices : invoice_number , invoice_date , invoice_details | orders : order_id , customer_id , order_status , date_order_placed , order_details | products : product_id , product_name , product_details | order_items : order_item_id , product_id , order_id , order_item_status , order_item_details | shipments : shipment_id , order_id , invoice_number , shipment_tracking_number , shipment_date , other_shipment_details | shipment_items : shipment_id , order_item_id | orders.customer_id = customers.customer_id | order_items.product_id = products.product_id | order_items.order_id = orders.order_id | shipments.invoice_number = invoices.invoice_number | shipments.order_id = orders.order_id | shipment_items.shipment_id = shipments.shipment_id | shipment_items.order_item_id = order_items.order_item_id | 

### Response:

select orders.order_id from orders join order_items on orders.order_id = order_items.order_id group by orders.order_id order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: Which order deals with the most items? Return the order id. | customers : customer_id , customer_name , customer_details | invoices : invoice_number , invoice_date , invoice_details | orders : order_id , customer_id , order_status , date_order_placed , order_details | products : product_id , product_name , product_details | order_items : order_item_id , product_id , order_id , order_item_status , order_item_details | shipments : shipment_id , order_id , invoice_number , shipment_tracking_number , shipment_date , other_shipment_details | shipment_items : shipment_id , order_item_id | orders.customer_id = customers.customer_id | order_items.product_id = products.product_id | order_items.order_id = orders.order_id | shipments.invoice_number = invoices.invoice_number | shipments.order_id = orders.order_id | shipment_items.shipment_id = shipments.shipment_id | shipment_items.order_item_id = order_items.order_item_id | 

### Response:

select orders.order_id from orders join order_items on orders.order_id = order_items.order_id group by orders.order_id order by count ( * ) desc limit 1
### Instruction:

Convert text to sql: What is the name of the customer who has the largest number of orders? | customers : customer_id , customer_name , customer_details | invoices : invoice_number , invoice_date , invoice_details | orders : order_id , customer_id , order_status , date_order_placed , order_details | products : product_id , product_name , product_details | order_items : order_item_id , product_id , order_id , order_item_status , order_item_details | shipments : shipment_id , order_id , invoice_number , shipment_tracking_number , shipment_date , other_shipment_details | shipment_items : shipment_id , order_item_id | orders.customer_id = customers.customer_id | order_items.product_id = products.product_id | order_items.order_id = orders.order_id | shipments.invoice_number = invoices.invoice_number | shipments.order_id = orders.order_id | shipment_items.shipment_id = shipments.shipment_id | shipment_items.order_item_id = order_items.order_item_id | 

### Response:

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

### Instruction:

Convert text to sql: Find the name of the customer who made the most orders. | customers : customer_id , customer_name , customer_details | invoices : invoice_number , invoice_date , invoice_details | orders : order_id , customer_id , order_status , date_order_placed , order_details | products : product_id , product_name , product_details | order_items : order_item_id , product_id , order_id , order_item_status , order_item_details | shipments : shipment_id , order_id , invoice_number , shipment_tracking_number , shipment_date , other_shipment_details | shipment_items : shipment_id , order_item_id | orders.customer_id = customers.customer_id | order_items.product_id = products.product_id | order_items.order_id = orders.order_id | shipments.invoice_number = invoices.invoice_number | shipments.order_id = orders.order_id | shipment_items.shipment_id = shipments.shipment_id | shipment_items.order_item_id = order_items.order_item_id | 

### Response:

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

Convert text to sql: Find the invoice numbers which are created before 1989-09-03 or after 2007-12-25. | customers : customer_id , customer_name , customer_details | invoices : invoice_number , invoice_date , invoice_details | orders : order_id , customer_id , order_status , date_order_placed , order_details | products : product_id , product_name , product_details | order_items : order_item_id , product_id , order_id , order_item_status , order_item_details | shipments : shipment_id , order_id , invoice_number , shipment_tracking_number , shipment_date , other_shipment_details | shipment_items : shipment_id , order_item_id | orders.customer_id = customers.customer_id | order_items.product_id = products.product_id | order_items.order_id = orders.order_id | shipments.invoice_number = invoices.invoice_number | shipments.order_id = orders.order_id | shipment_items.shipment_id = shipments.shipment_id | shipment_items.order_item_id = order_items.order_item_id | 

### Response:

select invoice_number from invoices where invoice_date < '1989-09-03' or invoice_date > '2007-12-25'

### Instruction:

Convert text to sql: What are the invoice numbers created before 1989-09-03 or after 2007-12-25? | customers : customer_id , customer_name , customer_details | invoices : invoice_number , invoice_date , invoice_details | orders : order_id , customer_id , order_status , date_order_placed , order_details | products : product_id , product_name , product_details | order_items : order_item_id , product_id , order_id , order_item_status , order_item_details | shipments : shipment_id , order_id , invoice_number , shipment_tracking_number , shipment_date , other_shipment_details | shipment_items : shipment_id , order_item_id | orders.customer_id = customers.customer_id | order_items.product_id = products.product_id | order_items.order_id = orders.order_id | shipments.invoice_number = invoices.invoice_number | shipments.order_id = orders.order_id | shipment_items.shipment_id = shipments.shipment_id | shipment_items.order_item_id = order_items.order_item_id | 

### Response:

select invoice_number from invoices where invoice_date < '1989-09-03' or invoice_date > '2007-12-25'
### Instruction:

Convert text to sql: Find the distinct details of invoices which are created before 1989-09-03 or after 2007-12-25. | customers : customer_id , customer_name , customer_details | invoices : invoice_number , invoice_date , invoice_details | orders : order_id , customer_id , order_status , date_order_placed , order_details | products : product_id , product_name , product_details | order_items : order_item_id , product_id , order_id , order_item_status , order_item_details | shipments : shipment_id , order_id , invoice_number , shipment_tracking_number , shipment_date , other_shipment_details | shipment_items : shipment_id , order_item_id | orders.customer_id = customers.customer_id | order_items.product_id = products.product_id | order_items.order_id = orders.order_id | shipments.invoice_number = invoices.invoice_number | shipments.order_id = orders.order_id | shipment_items.shipment_id = shipments.shipment_id | shipment_items.order_item_id = order_items.order_item_id | 

### Response:

select distinct invoice_details from invoices where invoice_date < '1989-09-03' or invoice_date > '2007-12-25'

### Instruction:

Convert text to sql: What are the distinct details of invoices created before 1989-09-03 or after 2007-12-25? | customers : customer_id , customer_name , customer_details | invoices : invoice_number , invoice_date , invoice_details | orders : order_id , customer_id , order_status , date_order_placed , order_details | products : product_id , product_name , product_details | order_items : order_item_id , product_id , order_id , order_item_status , order_item_details | shipments : shipment_id , order_id , invoice_number , shipment_tracking_number , shipment_date , other_shipment_details | shipment_items : shipment_id , order_item_id | orders.customer_id = customers.customer_id | order_items.product_id = products.product_id | order_items.order_id = orders.order_id | shipments.invoice_number = invoices.invoice_number | shipments.order_id = orders.order_id | shipment_items.shipment_id = shipments.shipment_id | shipment_items.order_item_id = order_items.order_item_id | 

### Response:

select distinct invoice_details from invoices where invoice_date < '1989-09-03' or invoice_date > '2007-12-25'
### Instruction:

Convert text to sql: For each customer who has at least two orders, find the customer name and number of orders made. | customers : customer_id , customer_name , customer_details | invoices : invoice_number , invoice_date , invoice_details | orders : order_id , customer_id , order_status , date_order_placed , order_details | products : product_id , product_name , product_details | order_items : order_item_id , product_id , order_id , order_item_status , order_item_details | shipments : shipment_id , order_id , invoice_number , shipment_tracking_number , shipment_date , other_shipment_details | shipment_items : shipment_id , order_item_id | orders.customer_id = customers.customer_id | order_items.product_id = products.product_id | order_items.order_id = orders.order_id | shipments.invoice_number = invoices.invoice_number | shipments.order_id = orders.order_id | shipment_items.shipment_id = shipments.shipment_id | shipment_items.order_item_id = order_items.order_item_id | 

### Response:

select customers.customer_name , count ( * ) from orders join customers on orders.customer_id = customers.customer_id group by customers.customer_id having count ( * ) >= 2

### Instruction:

Convert text to sql: Which customers have made at least two orders? Give me each customer name and number of orders made. | customers : customer_id , customer_name , customer_details | invoices : invoice_number , invoice_date , invoice_details | orders : order_id , customer_id , order_status , date_order_placed , order_details | products : product_id , product_name , product_details | order_items : order_item_id , product_id , order_id , order_item_status , order_item_details | shipments : shipment_id , order_id , invoice_number , shipment_tracking_number , shipment_date , other_shipment_details | shipment_items : shipment_id , order_item_id | orders.customer_id = customers.customer_id | order_items.product_id = products.product_id | order_items.order_id = orders.order_id | shipments.invoice_number = invoices.invoice_number | shipments.order_id = orders.order_id | shipment_items.shipment_id = shipments.shipment_id | shipment_items.order_item_id = order_items.order_item_id | 

### Response:

select customers.customer_name , count ( * ) from orders join customers on orders.customer_id = customers.customer_id group by customers.customer_id having count ( * ) >= 2