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

Convert text to sql: What are the ids of all products that were either ordered more than 3 times or have a cumulative amount purchased of above 80000? | addresses : address_id , address_details | staff : staff_id , staff_gender , staff_name | suppliers : supplier_id , supplier_name , supplier_phone | department_store_chain : dept_store_chain_id , dept_store_chain_name | customers : customer_id , payment_method_code , customer_code , customer_name , customer_address , customer_phone , customer_email | products : product_id , product_type_code , product_name , product_price | supplier_addresses : supplier_id , address_id , date_from , date_to | customer_addresses : customer_id , address_id , date_from , date_to | customer_orders : order_id , customer_id , order_status_code , order_date | department_stores : dept_store_id , dept_store_chain_id , store_name , store_address , store_phone , store_email | departments : department_id , dept_store_id , department_name | order_items : order_item_id , order_id , product_id | product_suppliers : product_id , supplier_id , date_supplied_from , date_supplied_to , total_amount_purchased , total_value_purchased | staff_department_assignments : staff_id , department_id , date_assigned_from , job_title_code , date_assigned_to | supplier_addresses.supplier_id = suppliers.supplier_id | supplier_addresses.address_id = addresses.address_id | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_orders.customer_id = customers.customer_id | department_stores.dept_store_chain_id = department_store_chain.dept_store_chain_id | departments.dept_store_id = department_stores.dept_store_id | order_items.product_id = products.product_id | order_items.order_id = customer_orders.order_id | product_suppliers.product_id = products.product_id | product_suppliers.supplier_id = suppliers.supplier_id | staff_department_assignments.staff_id = staff.staff_id | staff_department_assignments.department_id = departments.department_id | 

### Response:

select _ from _ group by _ having count ( _ ) > _ union select _ from _ group by _ having sum ( _ ) > _ | select product_id from order_items group by product_id having count ( * ) > 3 union select product_id from product_suppliers group by product_id having sum ( total_amount_purchased ) > 80000
### Instruction:

Convert text to sql: What are id and name of the products whose price is lower than 600 or higher than 900? | addresses : address_id , address_details | staff : staff_id , staff_gender , staff_name | suppliers : supplier_id , supplier_name , supplier_phone | department_store_chain : dept_store_chain_id , dept_store_chain_name | customers : customer_id , payment_method_code , customer_code , customer_name , customer_address , customer_phone , customer_email | products : product_id , product_type_code , product_name , product_price | supplier_addresses : supplier_id , address_id , date_from , date_to | customer_addresses : customer_id , address_id , date_from , date_to | customer_orders : order_id , customer_id , order_status_code , order_date | department_stores : dept_store_id , dept_store_chain_id , store_name , store_address , store_phone , store_email | departments : department_id , dept_store_id , department_name | order_items : order_item_id , order_id , product_id | product_suppliers : product_id , supplier_id , date_supplied_from , date_supplied_to , total_amount_purchased , total_value_purchased | staff_department_assignments : staff_id , department_id , date_assigned_from , job_title_code , date_assigned_to | supplier_addresses.supplier_id = suppliers.supplier_id | supplier_addresses.address_id = addresses.address_id | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_orders.customer_id = customers.customer_id | department_stores.dept_store_chain_id = department_store_chain.dept_store_chain_id | departments.dept_store_id = department_stores.dept_store_id | order_items.product_id = products.product_id | order_items.order_id = customer_orders.order_id | product_suppliers.product_id = products.product_id | product_suppliers.supplier_id = suppliers.supplier_id | staff_department_assignments.staff_id = staff.staff_id | staff_department_assignments.department_id = departments.department_id | 

### Response:

select _ from _ where _ | select product_id , product_name from products where product_price < 600 or product_price > 900
### Instruction:

Convert text to sql: Give the ids and names of products with price lower than 600 or higher than 900. | addresses : address_id , address_details | staff : staff_id , staff_gender , staff_name | suppliers : supplier_id , supplier_name , supplier_phone | department_store_chain : dept_store_chain_id , dept_store_chain_name | customers : customer_id , payment_method_code , customer_code , customer_name , customer_address , customer_phone , customer_email | products : product_id , product_type_code , product_name , product_price | supplier_addresses : supplier_id , address_id , date_from , date_to | customer_addresses : customer_id , address_id , date_from , date_to | customer_orders : order_id , customer_id , order_status_code , order_date | department_stores : dept_store_id , dept_store_chain_id , store_name , store_address , store_phone , store_email | departments : department_id , dept_store_id , department_name | order_items : order_item_id , order_id , product_id | product_suppliers : product_id , supplier_id , date_supplied_from , date_supplied_to , total_amount_purchased , total_value_purchased | staff_department_assignments : staff_id , department_id , date_assigned_from , job_title_code , date_assigned_to | supplier_addresses.supplier_id = suppliers.supplier_id | supplier_addresses.address_id = addresses.address_id | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_orders.customer_id = customers.customer_id | department_stores.dept_store_chain_id = department_store_chain.dept_store_chain_id | departments.dept_store_id = department_stores.dept_store_id | order_items.product_id = products.product_id | order_items.order_id = customer_orders.order_id | product_suppliers.product_id = products.product_id | product_suppliers.supplier_id = suppliers.supplier_id | staff_department_assignments.staff_id = staff.staff_id | staff_department_assignments.department_id = departments.department_id | 

### Response:

select _ from _ where _ | select product_id , product_name from products where product_price < 600 or product_price > 900
### Instruction:

Convert text to sql: Find the id of suppliers whose average amount purchased for each product is above 50000 or below 30000. | addresses : address_id , address_details | staff : staff_id , staff_gender , staff_name | suppliers : supplier_id , supplier_name , supplier_phone | department_store_chain : dept_store_chain_id , dept_store_chain_name | customers : customer_id , payment_method_code , customer_code , customer_name , customer_address , customer_phone , customer_email | products : product_id , product_type_code , product_name , product_price | supplier_addresses : supplier_id , address_id , date_from , date_to | customer_addresses : customer_id , address_id , date_from , date_to | customer_orders : order_id , customer_id , order_status_code , order_date | department_stores : dept_store_id , dept_store_chain_id , store_name , store_address , store_phone , store_email | departments : department_id , dept_store_id , department_name | order_items : order_item_id , order_id , product_id | product_suppliers : product_id , supplier_id , date_supplied_from , date_supplied_to , total_amount_purchased , total_value_purchased | staff_department_assignments : staff_id , department_id , date_assigned_from , job_title_code , date_assigned_to | supplier_addresses.supplier_id = suppliers.supplier_id | supplier_addresses.address_id = addresses.address_id | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_orders.customer_id = customers.customer_id | department_stores.dept_store_chain_id = department_store_chain.dept_store_chain_id | departments.dept_store_id = department_stores.dept_store_id | order_items.product_id = products.product_id | order_items.order_id = customer_orders.order_id | product_suppliers.product_id = products.product_id | product_suppliers.supplier_id = suppliers.supplier_id | staff_department_assignments.staff_id = staff.staff_id | staff_department_assignments.department_id = departments.department_id | 

### Response:

select _ from _ group by _ having avg ( _ ) > _ or avg ( _ ) < _ | select supplier_id from product_suppliers group by supplier_id having avg ( total_amount_purchased ) > 50000 or avg ( total_amount_purchased ) < 30000
### Instruction:

Convert text to sql: What are the ids of suppliers which have an average amount purchased of above 50000 or below 30000? | addresses : address_id , address_details | staff : staff_id , staff_gender , staff_name | suppliers : supplier_id , supplier_name , supplier_phone | department_store_chain : dept_store_chain_id , dept_store_chain_name | customers : customer_id , payment_method_code , customer_code , customer_name , customer_address , customer_phone , customer_email | products : product_id , product_type_code , product_name , product_price | supplier_addresses : supplier_id , address_id , date_from , date_to | customer_addresses : customer_id , address_id , date_from , date_to | customer_orders : order_id , customer_id , order_status_code , order_date | department_stores : dept_store_id , dept_store_chain_id , store_name , store_address , store_phone , store_email | departments : department_id , dept_store_id , department_name | order_items : order_item_id , order_id , product_id | product_suppliers : product_id , supplier_id , date_supplied_from , date_supplied_to , total_amount_purchased , total_value_purchased | staff_department_assignments : staff_id , department_id , date_assigned_from , job_title_code , date_assigned_to | supplier_addresses.supplier_id = suppliers.supplier_id | supplier_addresses.address_id = addresses.address_id | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_orders.customer_id = customers.customer_id | department_stores.dept_store_chain_id = department_store_chain.dept_store_chain_id | departments.dept_store_id = department_stores.dept_store_id | order_items.product_id = products.product_id | order_items.order_id = customer_orders.order_id | product_suppliers.product_id = products.product_id | product_suppliers.supplier_id = suppliers.supplier_id | staff_department_assignments.staff_id = staff.staff_id | staff_department_assignments.department_id = departments.department_id | 

### Response:

select _ from _ group by _ having avg ( _ ) > _ or avg ( _ ) < _ | select supplier_id from product_suppliers group by supplier_id having avg ( total_amount_purchased ) > 50000 or avg ( total_amount_purchased ) < 30000
### Instruction:

Convert text to sql: What are the average amount purchased and value purchased for the supplier who supplies the most products. | addresses : address_id , address_details | staff : staff_id , staff_gender , staff_name | suppliers : supplier_id , supplier_name , supplier_phone | department_store_chain : dept_store_chain_id , dept_store_chain_name | customers : customer_id , payment_method_code , customer_code , customer_name , customer_address , customer_phone , customer_email | products : product_id , product_type_code , product_name , product_price | supplier_addresses : supplier_id , address_id , date_from , date_to | customer_addresses : customer_id , address_id , date_from , date_to | customer_orders : order_id , customer_id , order_status_code , order_date | department_stores : dept_store_id , dept_store_chain_id , store_name , store_address , store_phone , store_email | departments : department_id , dept_store_id , department_name | order_items : order_item_id , order_id , product_id | product_suppliers : product_id , supplier_id , date_supplied_from , date_supplied_to , total_amount_purchased , total_value_purchased | staff_department_assignments : staff_id , department_id , date_assigned_from , job_title_code , date_assigned_to | supplier_addresses.supplier_id = suppliers.supplier_id | supplier_addresses.address_id = addresses.address_id | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_orders.customer_id = customers.customer_id | department_stores.dept_store_chain_id = department_store_chain.dept_store_chain_id | departments.dept_store_id = department_stores.dept_store_id | order_items.product_id = products.product_id | order_items.order_id = customer_orders.order_id | product_suppliers.product_id = products.product_id | product_suppliers.supplier_id = suppliers.supplier_id | staff_department_assignments.staff_id = staff.staff_id | staff_department_assignments.department_id = departments.department_id | 

### Response:

select avg ( _ ) , avg ( _ ) from _ where _ = ( select _ from _ group by _ order by count ( _ ) desc limit _ ) | select avg ( total_amount_purchased ) , avg ( total_value_purchased ) from product_suppliers where supplier_id = ( select supplier_id from product_suppliers group by supplier_id order by count ( * ) desc limit 1 )
### Instruction:

Convert text to sql: Return the average total amount purchased and total value purchased for the supplier who supplies the greatest number of products. | addresses : address_id , address_details | staff : staff_id , staff_gender , staff_name | suppliers : supplier_id , supplier_name , supplier_phone | department_store_chain : dept_store_chain_id , dept_store_chain_name | customers : customer_id , payment_method_code , customer_code , customer_name , customer_address , customer_phone , customer_email | products : product_id , product_type_code , product_name , product_price | supplier_addresses : supplier_id , address_id , date_from , date_to | customer_addresses : customer_id , address_id , date_from , date_to | customer_orders : order_id , customer_id , order_status_code , order_date | department_stores : dept_store_id , dept_store_chain_id , store_name , store_address , store_phone , store_email | departments : department_id , dept_store_id , department_name | order_items : order_item_id , order_id , product_id | product_suppliers : product_id , supplier_id , date_supplied_from , date_supplied_to , total_amount_purchased , total_value_purchased | staff_department_assignments : staff_id , department_id , date_assigned_from , job_title_code , date_assigned_to | supplier_addresses.supplier_id = suppliers.supplier_id | supplier_addresses.address_id = addresses.address_id | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_orders.customer_id = customers.customer_id | department_stores.dept_store_chain_id = department_store_chain.dept_store_chain_id | departments.dept_store_id = department_stores.dept_store_id | order_items.product_id = products.product_id | order_items.order_id = customer_orders.order_id | product_suppliers.product_id = products.product_id | product_suppliers.supplier_id = suppliers.supplier_id | staff_department_assignments.staff_id = staff.staff_id | staff_department_assignments.department_id = departments.department_id | 

### Response:

select avg ( _ ) , avg ( _ ) from _ where _ = ( select _ from _ group by _ order by count ( _ ) desc limit _ ) | select avg ( total_amount_purchased ) , avg ( total_value_purchased ) from product_suppliers where supplier_id = ( select supplier_id from product_suppliers group by supplier_id order by count ( * ) desc limit 1 )
### Instruction:

Convert text to sql: What is the largest and smallest customer codes? | addresses : address_id , address_details | staff : staff_id , staff_gender , staff_name | suppliers : supplier_id , supplier_name , supplier_phone | department_store_chain : dept_store_chain_id , dept_store_chain_name | customers : customer_id , payment_method_code , customer_code , customer_name , customer_address , customer_phone , customer_email | products : product_id , product_type_code , product_name , product_price | supplier_addresses : supplier_id , address_id , date_from , date_to | customer_addresses : customer_id , address_id , date_from , date_to | customer_orders : order_id , customer_id , order_status_code , order_date | department_stores : dept_store_id , dept_store_chain_id , store_name , store_address , store_phone , store_email | departments : department_id , dept_store_id , department_name | order_items : order_item_id , order_id , product_id | product_suppliers : product_id , supplier_id , date_supplied_from , date_supplied_to , total_amount_purchased , total_value_purchased | staff_department_assignments : staff_id , department_id , date_assigned_from , job_title_code , date_assigned_to | supplier_addresses.supplier_id = suppliers.supplier_id | supplier_addresses.address_id = addresses.address_id | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_orders.customer_id = customers.customer_id | department_stores.dept_store_chain_id = department_store_chain.dept_store_chain_id | departments.dept_store_id = department_stores.dept_store_id | order_items.product_id = products.product_id | order_items.order_id = customer_orders.order_id | product_suppliers.product_id = products.product_id | product_suppliers.supplier_id = suppliers.supplier_id | staff_department_assignments.staff_id = staff.staff_id | staff_department_assignments.department_id = departments.department_id | 

### Response:

select max ( _ ) , min ( _ ) from _ | select max ( customer_code ) , min ( customer_code ) from customers
### Instruction:

Convert text to sql: Return the maximum and minimum customer codes. | addresses : address_id , address_details | staff : staff_id , staff_gender , staff_name | suppliers : supplier_id , supplier_name , supplier_phone | department_store_chain : dept_store_chain_id , dept_store_chain_name | customers : customer_id , payment_method_code , customer_code , customer_name , customer_address , customer_phone , customer_email | products : product_id , product_type_code , product_name , product_price | supplier_addresses : supplier_id , address_id , date_from , date_to | customer_addresses : customer_id , address_id , date_from , date_to | customer_orders : order_id , customer_id , order_status_code , order_date | department_stores : dept_store_id , dept_store_chain_id , store_name , store_address , store_phone , store_email | departments : department_id , dept_store_id , department_name | order_items : order_item_id , order_id , product_id | product_suppliers : product_id , supplier_id , date_supplied_from , date_supplied_to , total_amount_purchased , total_value_purchased | staff_department_assignments : staff_id , department_id , date_assigned_from , job_title_code , date_assigned_to | supplier_addresses.supplier_id = suppliers.supplier_id | supplier_addresses.address_id = addresses.address_id | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_orders.customer_id = customers.customer_id | department_stores.dept_store_chain_id = department_store_chain.dept_store_chain_id | departments.dept_store_id = department_stores.dept_store_id | order_items.product_id = products.product_id | order_items.order_id = customer_orders.order_id | product_suppliers.product_id = products.product_id | product_suppliers.supplier_id = suppliers.supplier_id | staff_department_assignments.staff_id = staff.staff_id | staff_department_assignments.department_id = departments.department_id | 

### Response:

select max ( _ ) , min ( _ ) from _ | select max ( customer_code ) , min ( customer_code ) from customers
### Instruction:

Convert text to sql: List the names of all the distinct customers who bought a keyboard. | addresses : address_id , address_details | staff : staff_id , staff_gender , staff_name | suppliers : supplier_id , supplier_name , supplier_phone | department_store_chain : dept_store_chain_id , dept_store_chain_name | customers : customer_id , payment_method_code , customer_code , customer_name , customer_address , customer_phone , customer_email | products : product_id , product_type_code , product_name , product_price | supplier_addresses : supplier_id , address_id , date_from , date_to | customer_addresses : customer_id , address_id , date_from , date_to | customer_orders : order_id , customer_id , order_status_code , order_date | department_stores : dept_store_id , dept_store_chain_id , store_name , store_address , store_phone , store_email | departments : department_id , dept_store_id , department_name | order_items : order_item_id , order_id , product_id | product_suppliers : product_id , supplier_id , date_supplied_from , date_supplied_to , total_amount_purchased , total_value_purchased | staff_department_assignments : staff_id , department_id , date_assigned_from , job_title_code , date_assigned_to | supplier_addresses.supplier_id = suppliers.supplier_id | supplier_addresses.address_id = addresses.address_id | customer_addresses.customer_id = customers.customer_id | customer_addresses.address_id = addresses.address_id | customer_orders.customer_id = customers.customer_id | department_stores.dept_store_chain_id = department_store_chain.dept_store_chain_id | departments.dept_store_id = department_stores.dept_store_id | order_items.product_id = products.product_id | order_items.order_id = customer_orders.order_id | product_suppliers.product_id = products.product_id | product_suppliers.supplier_id = suppliers.supplier_id | staff_department_assignments.staff_id = staff.staff_id | staff_department_assignments.department_id = departments.department_id | 

### Response:

select distinct _ from _ where _ | select distinct 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 join products on order_items.product_id = products.product_id where products.product_name = 'keyboard'