db_id
stringlengths 4
31
| text
stringlengths 398
4.9k
|
---|---|
customers_and_invoices | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many transactions correspond to each invoice number? | customers : customer_id , customer_first_name , customer_middle_initial , customer_last_name , gender , email_address , login_name , login_password , phone_number , town_city , state_county_province , country | orders : order_id , customer_id , date_order_placed , order_details | invoices : invoice_number , order_id , invoice_date | accounts : account_id , customer_id , date_account_opened , account_name , other_account_details | product_categories : production_type_code , product_type_description , vat_rating | products : product_id , parent_product_id , production_type_code , unit_price , product_name , product_color , product_size | financial_transactions : transaction_id , account_id , invoice_number , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | order_items : order_item_id , order_id , product_id , product_quantity , other_order_item_details | invoice_line_items : order_item_id , invoice_number , product_id , product_title , product_quantity , product_price , derived_product_cost , derived_vat_payable , derived_total_cost | orders.customer_id = customers.customer_id | invoices.order_id = orders.order_id | accounts.customer_id = customers.customer_id | products.production_type_code = product_categories.production_type_code | financial_transactions.account_id = accounts.account_id | financial_transactions.invoice_number = invoices.invoice_number | order_items.order_id = orders.order_id | order_items.product_id = products.product_id | invoice_line_items.product_id = products.product_id | invoice_line_items.invoice_number = invoices.invoice_number | invoice_line_items.order_item_id = order_items.order_item_id |
### Response:
select _ , count ( _ ) from _ group by _ | select invoice_number , count ( * ) from financial_transactions group by invoice_number |
customers_and_invoices | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the invoice number and invoice date for the invoice with most number of transactions? | customers : customer_id , customer_first_name , customer_middle_initial , customer_last_name , gender , email_address , login_name , login_password , phone_number , town_city , state_county_province , country | orders : order_id , customer_id , date_order_placed , order_details | invoices : invoice_number , order_id , invoice_date | accounts : account_id , customer_id , date_account_opened , account_name , other_account_details | product_categories : production_type_code , product_type_description , vat_rating | products : product_id , parent_product_id , production_type_code , unit_price , product_name , product_color , product_size | financial_transactions : transaction_id , account_id , invoice_number , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | order_items : order_item_id , order_id , product_id , product_quantity , other_order_item_details | invoice_line_items : order_item_id , invoice_number , product_id , product_title , product_quantity , product_price , derived_product_cost , derived_vat_payable , derived_total_cost | orders.customer_id = customers.customer_id | invoices.order_id = orders.order_id | accounts.customer_id = customers.customer_id | products.production_type_code = product_categories.production_type_code | financial_transactions.account_id = accounts.account_id | financial_transactions.invoice_number = invoices.invoice_number | order_items.order_id = orders.order_id | order_items.product_id = products.product_id | invoice_line_items.product_id = products.product_id | invoice_line_items.invoice_number = invoices.invoice_number | invoice_line_items.order_item_id = order_items.order_item_id |
### Response:
select _ from _ group by _ order by count ( _ ) desc limit _ | select invoices.invoice_number , invoices.invoice_date from financial_transactions join invoices on financial_transactions.invoice_number = invoices.invoice_number group by financial_transactions.invoice_number order by count ( * ) desc limit 1 |
customers_and_invoices | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the invoice number and invoice date corresponding to the invoice with the greatest number of transactions? | customers : customer_id , customer_first_name , customer_middle_initial , customer_last_name , gender , email_address , login_name , login_password , phone_number , town_city , state_county_province , country | orders : order_id , customer_id , date_order_placed , order_details | invoices : invoice_number , order_id , invoice_date | accounts : account_id , customer_id , date_account_opened , account_name , other_account_details | product_categories : production_type_code , product_type_description , vat_rating | products : product_id , parent_product_id , production_type_code , unit_price , product_name , product_color , product_size | financial_transactions : transaction_id , account_id , invoice_number , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | order_items : order_item_id , order_id , product_id , product_quantity , other_order_item_details | invoice_line_items : order_item_id , invoice_number , product_id , product_title , product_quantity , product_price , derived_product_cost , derived_vat_payable , derived_total_cost | orders.customer_id = customers.customer_id | invoices.order_id = orders.order_id | accounts.customer_id = customers.customer_id | products.production_type_code = product_categories.production_type_code | financial_transactions.account_id = accounts.account_id | financial_transactions.invoice_number = invoices.invoice_number | order_items.order_id = orders.order_id | order_items.product_id = products.product_id | invoice_line_items.product_id = products.product_id | invoice_line_items.invoice_number = invoices.invoice_number | invoice_line_items.order_item_id = order_items.order_item_id |
### Response:
select _ from _ group by _ order by count ( _ ) desc limit _ | select invoices.invoice_number , invoices.invoice_date from financial_transactions join invoices on financial_transactions.invoice_number = invoices.invoice_number group by financial_transactions.invoice_number order by count ( * ) desc limit 1 |
customers_and_invoices | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many invoices do we have? | customers : customer_id , customer_first_name , customer_middle_initial , customer_last_name , gender , email_address , login_name , login_password , phone_number , town_city , state_county_province , country | orders : order_id , customer_id , date_order_placed , order_details | invoices : invoice_number , order_id , invoice_date | accounts : account_id , customer_id , date_account_opened , account_name , other_account_details | product_categories : production_type_code , product_type_description , vat_rating | products : product_id , parent_product_id , production_type_code , unit_price , product_name , product_color , product_size | financial_transactions : transaction_id , account_id , invoice_number , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | order_items : order_item_id , order_id , product_id , product_quantity , other_order_item_details | invoice_line_items : order_item_id , invoice_number , product_id , product_title , product_quantity , product_price , derived_product_cost , derived_vat_payable , derived_total_cost | orders.customer_id = customers.customer_id | invoices.order_id = orders.order_id | accounts.customer_id = customers.customer_id | products.production_type_code = product_categories.production_type_code | financial_transactions.account_id = accounts.account_id | financial_transactions.invoice_number = invoices.invoice_number | order_items.order_id = orders.order_id | order_items.product_id = products.product_id | invoice_line_items.product_id = products.product_id | invoice_line_items.invoice_number = invoices.invoice_number | invoice_line_items.order_item_id = order_items.order_item_id |
### Response:
select count ( _ ) from _ | select count ( * ) from invoices |
customers_and_invoices | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Count the number of invoices. | customers : customer_id , customer_first_name , customer_middle_initial , customer_last_name , gender , email_address , login_name , login_password , phone_number , town_city , state_county_province , country | orders : order_id , customer_id , date_order_placed , order_details | invoices : invoice_number , order_id , invoice_date | accounts : account_id , customer_id , date_account_opened , account_name , other_account_details | product_categories : production_type_code , product_type_description , vat_rating | products : product_id , parent_product_id , production_type_code , unit_price , product_name , product_color , product_size | financial_transactions : transaction_id , account_id , invoice_number , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | order_items : order_item_id , order_id , product_id , product_quantity , other_order_item_details | invoice_line_items : order_item_id , invoice_number , product_id , product_title , product_quantity , product_price , derived_product_cost , derived_vat_payable , derived_total_cost | orders.customer_id = customers.customer_id | invoices.order_id = orders.order_id | accounts.customer_id = customers.customer_id | products.production_type_code = product_categories.production_type_code | financial_transactions.account_id = accounts.account_id | financial_transactions.invoice_number = invoices.invoice_number | order_items.order_id = orders.order_id | order_items.product_id = products.product_id | invoice_line_items.product_id = products.product_id | invoice_line_items.invoice_number = invoices.invoice_number | invoice_line_items.order_item_id = order_items.order_item_id |
### Response:
select count ( _ ) from _ | select count ( * ) from invoices |
customers_and_invoices | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show invoice dates and order id and details for all invoices. | customers : customer_id , customer_first_name , customer_middle_initial , customer_last_name , gender , email_address , login_name , login_password , phone_number , town_city , state_county_province , country | orders : order_id , customer_id , date_order_placed , order_details | invoices : invoice_number , order_id , invoice_date | accounts : account_id , customer_id , date_account_opened , account_name , other_account_details | product_categories : production_type_code , product_type_description , vat_rating | products : product_id , parent_product_id , production_type_code , unit_price , product_name , product_color , product_size | financial_transactions : transaction_id , account_id , invoice_number , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | order_items : order_item_id , order_id , product_id , product_quantity , other_order_item_details | invoice_line_items : order_item_id , invoice_number , product_id , product_title , product_quantity , product_price , derived_product_cost , derived_vat_payable , derived_total_cost | orders.customer_id = customers.customer_id | invoices.order_id = orders.order_id | accounts.customer_id = customers.customer_id | products.production_type_code = product_categories.production_type_code | financial_transactions.account_id = accounts.account_id | financial_transactions.invoice_number = invoices.invoice_number | order_items.order_id = orders.order_id | order_items.product_id = products.product_id | invoice_line_items.product_id = products.product_id | invoice_line_items.invoice_number = invoices.invoice_number | invoice_line_items.order_item_id = order_items.order_item_id |
### Response:
select _ from _ | select invoices.invoice_date , invoices.order_id , orders.order_details from invoices join orders on invoices.order_id = orders.order_id |
customers_and_invoices | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the invoice dates, order ids, and order details for all invoices? | customers : customer_id , customer_first_name , customer_middle_initial , customer_last_name , gender , email_address , login_name , login_password , phone_number , town_city , state_county_province , country | orders : order_id , customer_id , date_order_placed , order_details | invoices : invoice_number , order_id , invoice_date | accounts : account_id , customer_id , date_account_opened , account_name , other_account_details | product_categories : production_type_code , product_type_description , vat_rating | products : product_id , parent_product_id , production_type_code , unit_price , product_name , product_color , product_size | financial_transactions : transaction_id , account_id , invoice_number , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | order_items : order_item_id , order_id , product_id , product_quantity , other_order_item_details | invoice_line_items : order_item_id , invoice_number , product_id , product_title , product_quantity , product_price , derived_product_cost , derived_vat_payable , derived_total_cost | orders.customer_id = customers.customer_id | invoices.order_id = orders.order_id | accounts.customer_id = customers.customer_id | products.production_type_code = product_categories.production_type_code | financial_transactions.account_id = accounts.account_id | financial_transactions.invoice_number = invoices.invoice_number | order_items.order_id = orders.order_id | order_items.product_id = products.product_id | invoice_line_items.product_id = products.product_id | invoice_line_items.invoice_number = invoices.invoice_number | invoice_line_items.order_item_id = order_items.order_item_id |
### Response:
select _ from _ | select invoices.invoice_date , invoices.order_id , orders.order_details from invoices join orders on invoices.order_id = orders.order_id |
customers_and_invoices | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show the order ids and the number of invoices for each order. | customers : customer_id , customer_first_name , customer_middle_initial , customer_last_name , gender , email_address , login_name , login_password , phone_number , town_city , state_county_province , country | orders : order_id , customer_id , date_order_placed , order_details | invoices : invoice_number , order_id , invoice_date | accounts : account_id , customer_id , date_account_opened , account_name , other_account_details | product_categories : production_type_code , product_type_description , vat_rating | products : product_id , parent_product_id , production_type_code , unit_price , product_name , product_color , product_size | financial_transactions : transaction_id , account_id , invoice_number , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | order_items : order_item_id , order_id , product_id , product_quantity , other_order_item_details | invoice_line_items : order_item_id , invoice_number , product_id , product_title , product_quantity , product_price , derived_product_cost , derived_vat_payable , derived_total_cost | orders.customer_id = customers.customer_id | invoices.order_id = orders.order_id | accounts.customer_id = customers.customer_id | products.production_type_code = product_categories.production_type_code | financial_transactions.account_id = accounts.account_id | financial_transactions.invoice_number = invoices.invoice_number | order_items.order_id = orders.order_id | order_items.product_id = products.product_id | invoice_line_items.product_id = products.product_id | invoice_line_items.invoice_number = invoices.invoice_number | invoice_line_items.order_item_id = order_items.order_item_id |
### Response:
select _ , count ( _ ) from _ group by _ | select order_id , count ( * ) from invoices group by order_id |
customers_and_invoices | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many invoices correspond to each order id? | customers : customer_id , customer_first_name , customer_middle_initial , customer_last_name , gender , email_address , login_name , login_password , phone_number , town_city , state_county_province , country | orders : order_id , customer_id , date_order_placed , order_details | invoices : invoice_number , order_id , invoice_date | accounts : account_id , customer_id , date_account_opened , account_name , other_account_details | product_categories : production_type_code , product_type_description , vat_rating | products : product_id , parent_product_id , production_type_code , unit_price , product_name , product_color , product_size | financial_transactions : transaction_id , account_id , invoice_number , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | order_items : order_item_id , order_id , product_id , product_quantity , other_order_item_details | invoice_line_items : order_item_id , invoice_number , product_id , product_title , product_quantity , product_price , derived_product_cost , derived_vat_payable , derived_total_cost | orders.customer_id = customers.customer_id | invoices.order_id = orders.order_id | accounts.customer_id = customers.customer_id | products.production_type_code = product_categories.production_type_code | financial_transactions.account_id = accounts.account_id | financial_transactions.invoice_number = invoices.invoice_number | order_items.order_id = orders.order_id | order_items.product_id = products.product_id | invoice_line_items.product_id = products.product_id | invoice_line_items.invoice_number = invoices.invoice_number | invoice_line_items.order_item_id = order_items.order_item_id |
### Response:
select _ , count ( _ ) from _ group by _ | select order_id , count ( * ) from invoices group by order_id |
customers_and_invoices | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the order id and order details for the order more than two invoices. | customers : customer_id , customer_first_name , customer_middle_initial , customer_last_name , gender , email_address , login_name , login_password , phone_number , town_city , state_county_province , country | orders : order_id , customer_id , date_order_placed , order_details | invoices : invoice_number , order_id , invoice_date | accounts : account_id , customer_id , date_account_opened , account_name , other_account_details | product_categories : production_type_code , product_type_description , vat_rating | products : product_id , parent_product_id , production_type_code , unit_price , product_name , product_color , product_size | financial_transactions : transaction_id , account_id , invoice_number , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | order_items : order_item_id , order_id , product_id , product_quantity , other_order_item_details | invoice_line_items : order_item_id , invoice_number , product_id , product_title , product_quantity , product_price , derived_product_cost , derived_vat_payable , derived_total_cost | orders.customer_id = customers.customer_id | invoices.order_id = orders.order_id | accounts.customer_id = customers.customer_id | products.production_type_code = product_categories.production_type_code | financial_transactions.account_id = accounts.account_id | financial_transactions.invoice_number = invoices.invoice_number | order_items.order_id = orders.order_id | order_items.product_id = products.product_id | invoice_line_items.product_id = products.product_id | invoice_line_items.invoice_number = invoices.invoice_number | invoice_line_items.order_item_id = order_items.order_item_id |
### Response:
select _ from _ group by _ having count ( _ ) > _ | select orders.order_id , orders.order_details from invoices join orders on invoices.order_id = orders.order_id group by orders.order_id having count ( * ) > 2 |
customers_and_invoices | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Return the order ids and details for orderes with two or more invoices. | customers : customer_id , customer_first_name , customer_middle_initial , customer_last_name , gender , email_address , login_name , login_password , phone_number , town_city , state_county_province , country | orders : order_id , customer_id , date_order_placed , order_details | invoices : invoice_number , order_id , invoice_date | accounts : account_id , customer_id , date_account_opened , account_name , other_account_details | product_categories : production_type_code , product_type_description , vat_rating | products : product_id , parent_product_id , production_type_code , unit_price , product_name , product_color , product_size | financial_transactions : transaction_id , account_id , invoice_number , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | order_items : order_item_id , order_id , product_id , product_quantity , other_order_item_details | invoice_line_items : order_item_id , invoice_number , product_id , product_title , product_quantity , product_price , derived_product_cost , derived_vat_payable , derived_total_cost | orders.customer_id = customers.customer_id | invoices.order_id = orders.order_id | accounts.customer_id = customers.customer_id | products.production_type_code = product_categories.production_type_code | financial_transactions.account_id = accounts.account_id | financial_transactions.invoice_number = invoices.invoice_number | order_items.order_id = orders.order_id | order_items.product_id = products.product_id | invoice_line_items.product_id = products.product_id | invoice_line_items.invoice_number = invoices.invoice_number | invoice_line_items.order_item_id = order_items.order_item_id |
### Response:
select _ from _ group by _ having count ( _ ) > _ | select orders.order_id , orders.order_details from invoices join orders on invoices.order_id = orders.order_id group by orders.order_id having count ( * ) > 2 |
customers_and_invoices | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the customer last name, id and phone number with most number of orders? | customers : customer_id , customer_first_name , customer_middle_initial , customer_last_name , gender , email_address , login_name , login_password , phone_number , town_city , state_county_province , country | orders : order_id , customer_id , date_order_placed , order_details | invoices : invoice_number , order_id , invoice_date | accounts : account_id , customer_id , date_account_opened , account_name , other_account_details | product_categories : production_type_code , product_type_description , vat_rating | products : product_id , parent_product_id , production_type_code , unit_price , product_name , product_color , product_size | financial_transactions : transaction_id , account_id , invoice_number , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | order_items : order_item_id , order_id , product_id , product_quantity , other_order_item_details | invoice_line_items : order_item_id , invoice_number , product_id , product_title , product_quantity , product_price , derived_product_cost , derived_vat_payable , derived_total_cost | orders.customer_id = customers.customer_id | invoices.order_id = orders.order_id | accounts.customer_id = customers.customer_id | products.production_type_code = product_categories.production_type_code | financial_transactions.account_id = accounts.account_id | financial_transactions.invoice_number = invoices.invoice_number | order_items.order_id = orders.order_id | order_items.product_id = products.product_id | invoice_line_items.product_id = products.product_id | invoice_line_items.invoice_number = invoices.invoice_number | invoice_line_items.order_item_id = order_items.order_item_id |
### Response:
select _ from _ group by _ order by count ( _ ) desc limit _ | select customers.customer_last_name , orders.customer_id , customers.phone_number from orders join customers on orders.customer_id = customers.customer_id group by orders.customer_id order by count ( * ) desc limit 1 |
customers_and_invoices | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Return the last name, id and phone number of the customer who has made the greatest number of orders. | customers : customer_id , customer_first_name , customer_middle_initial , customer_last_name , gender , email_address , login_name , login_password , phone_number , town_city , state_county_province , country | orders : order_id , customer_id , date_order_placed , order_details | invoices : invoice_number , order_id , invoice_date | accounts : account_id , customer_id , date_account_opened , account_name , other_account_details | product_categories : production_type_code , product_type_description , vat_rating | products : product_id , parent_product_id , production_type_code , unit_price , product_name , product_color , product_size | financial_transactions : transaction_id , account_id , invoice_number , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | order_items : order_item_id , order_id , product_id , product_quantity , other_order_item_details | invoice_line_items : order_item_id , invoice_number , product_id , product_title , product_quantity , product_price , derived_product_cost , derived_vat_payable , derived_total_cost | orders.customer_id = customers.customer_id | invoices.order_id = orders.order_id | accounts.customer_id = customers.customer_id | products.production_type_code = product_categories.production_type_code | financial_transactions.account_id = accounts.account_id | financial_transactions.invoice_number = invoices.invoice_number | order_items.order_id = orders.order_id | order_items.product_id = products.product_id | invoice_line_items.product_id = products.product_id | invoice_line_items.invoice_number = invoices.invoice_number | invoice_line_items.order_item_id = order_items.order_item_id |
### Response:
select _ from _ group by _ order by count ( _ ) desc limit _ | select customers.customer_last_name , orders.customer_id , customers.phone_number from orders join customers on orders.customer_id = customers.customer_id group by orders.customer_id order by count ( * ) desc limit 1 |
customers_and_invoices | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show all product names without an order. | customers : customer_id , customer_first_name , customer_middle_initial , customer_last_name , gender , email_address , login_name , login_password , phone_number , town_city , state_county_province , country | orders : order_id , customer_id , date_order_placed , order_details | invoices : invoice_number , order_id , invoice_date | accounts : account_id , customer_id , date_account_opened , account_name , other_account_details | product_categories : production_type_code , product_type_description , vat_rating | products : product_id , parent_product_id , production_type_code , unit_price , product_name , product_color , product_size | financial_transactions : transaction_id , account_id , invoice_number , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | order_items : order_item_id , order_id , product_id , product_quantity , other_order_item_details | invoice_line_items : order_item_id , invoice_number , product_id , product_title , product_quantity , product_price , derived_product_cost , derived_vat_payable , derived_total_cost | orders.customer_id = customers.customer_id | invoices.order_id = orders.order_id | accounts.customer_id = customers.customer_id | products.production_type_code = product_categories.production_type_code | financial_transactions.account_id = accounts.account_id | financial_transactions.invoice_number = invoices.invoice_number | order_items.order_id = orders.order_id | order_items.product_id = products.product_id | invoice_line_items.product_id = products.product_id | invoice_line_items.invoice_number = invoices.invoice_number | invoice_line_items.order_item_id = order_items.order_item_id |
### Response:
select _ from _ except select _ from _ | select product_name from products except select products.product_name from products join order_items on products.product_id = order_items.product_id |
customers_and_invoices | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the names of products that have never been ordered? | customers : customer_id , customer_first_name , customer_middle_initial , customer_last_name , gender , email_address , login_name , login_password , phone_number , town_city , state_county_province , country | orders : order_id , customer_id , date_order_placed , order_details | invoices : invoice_number , order_id , invoice_date | accounts : account_id , customer_id , date_account_opened , account_name , other_account_details | product_categories : production_type_code , product_type_description , vat_rating | products : product_id , parent_product_id , production_type_code , unit_price , product_name , product_color , product_size | financial_transactions : transaction_id , account_id , invoice_number , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | order_items : order_item_id , order_id , product_id , product_quantity , other_order_item_details | invoice_line_items : order_item_id , invoice_number , product_id , product_title , product_quantity , product_price , derived_product_cost , derived_vat_payable , derived_total_cost | orders.customer_id = customers.customer_id | invoices.order_id = orders.order_id | accounts.customer_id = customers.customer_id | products.production_type_code = product_categories.production_type_code | financial_transactions.account_id = accounts.account_id | financial_transactions.invoice_number = invoices.invoice_number | order_items.order_id = orders.order_id | order_items.product_id = products.product_id | invoice_line_items.product_id = products.product_id | invoice_line_items.invoice_number = invoices.invoice_number | invoice_line_items.order_item_id = order_items.order_item_id |
### Response:
select _ from _ except select _ from _ | select product_name from products except select products.product_name from products join order_items on products.product_id = order_items.product_id |
customers_and_invoices | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show all product names and the total quantity ordered for each product name. | customers : customer_id , customer_first_name , customer_middle_initial , customer_last_name , gender , email_address , login_name , login_password , phone_number , town_city , state_county_province , country | orders : order_id , customer_id , date_order_placed , order_details | invoices : invoice_number , order_id , invoice_date | accounts : account_id , customer_id , date_account_opened , account_name , other_account_details | product_categories : production_type_code , product_type_description , vat_rating | products : product_id , parent_product_id , production_type_code , unit_price , product_name , product_color , product_size | financial_transactions : transaction_id , account_id , invoice_number , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | order_items : order_item_id , order_id , product_id , product_quantity , other_order_item_details | invoice_line_items : order_item_id , invoice_number , product_id , product_title , product_quantity , product_price , derived_product_cost , derived_vat_payable , derived_total_cost | orders.customer_id = customers.customer_id | invoices.order_id = orders.order_id | accounts.customer_id = customers.customer_id | products.production_type_code = product_categories.production_type_code | financial_transactions.account_id = accounts.account_id | financial_transactions.invoice_number = invoices.invoice_number | order_items.order_id = orders.order_id | order_items.product_id = products.product_id | invoice_line_items.product_id = products.product_id | invoice_line_items.invoice_number = invoices.invoice_number | invoice_line_items.order_item_id = order_items.order_item_id |
### Response:
select _ , sum ( _ ) from _ group by _ | select products.product_name , sum ( order_items.product_quantity ) from order_items join products on order_items.product_id = products.product_id group by products.product_name |
customers_and_invoices | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the different product names, and what is the sum of quantity ordered for each product? | customers : customer_id , customer_first_name , customer_middle_initial , customer_last_name , gender , email_address , login_name , login_password , phone_number , town_city , state_county_province , country | orders : order_id , customer_id , date_order_placed , order_details | invoices : invoice_number , order_id , invoice_date | accounts : account_id , customer_id , date_account_opened , account_name , other_account_details | product_categories : production_type_code , product_type_description , vat_rating | products : product_id , parent_product_id , production_type_code , unit_price , product_name , product_color , product_size | financial_transactions : transaction_id , account_id , invoice_number , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | order_items : order_item_id , order_id , product_id , product_quantity , other_order_item_details | invoice_line_items : order_item_id , invoice_number , product_id , product_title , product_quantity , product_price , derived_product_cost , derived_vat_payable , derived_total_cost | orders.customer_id = customers.customer_id | invoices.order_id = orders.order_id | accounts.customer_id = customers.customer_id | products.production_type_code = product_categories.production_type_code | financial_transactions.account_id = accounts.account_id | financial_transactions.invoice_number = invoices.invoice_number | order_items.order_id = orders.order_id | order_items.product_id = products.product_id | invoice_line_items.product_id = products.product_id | invoice_line_items.invoice_number = invoices.invoice_number | invoice_line_items.order_item_id = order_items.order_item_id |
### Response:
select _ , sum ( _ ) from _ group by _ | select products.product_name , sum ( order_items.product_quantity ) from order_items join products on order_items.product_id = products.product_id group by products.product_name |
customers_and_invoices | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show the order ids and the number of items in each order. | customers : customer_id , customer_first_name , customer_middle_initial , customer_last_name , gender , email_address , login_name , login_password , phone_number , town_city , state_county_province , country | orders : order_id , customer_id , date_order_placed , order_details | invoices : invoice_number , order_id , invoice_date | accounts : account_id , customer_id , date_account_opened , account_name , other_account_details | product_categories : production_type_code , product_type_description , vat_rating | products : product_id , parent_product_id , production_type_code , unit_price , product_name , product_color , product_size | financial_transactions : transaction_id , account_id , invoice_number , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | order_items : order_item_id , order_id , product_id , product_quantity , other_order_item_details | invoice_line_items : order_item_id , invoice_number , product_id , product_title , product_quantity , product_price , derived_product_cost , derived_vat_payable , derived_total_cost | orders.customer_id = customers.customer_id | invoices.order_id = orders.order_id | accounts.customer_id = customers.customer_id | products.production_type_code = product_categories.production_type_code | financial_transactions.account_id = accounts.account_id | financial_transactions.invoice_number = invoices.invoice_number | order_items.order_id = orders.order_id | order_items.product_id = products.product_id | invoice_line_items.product_id = products.product_id | invoice_line_items.invoice_number = invoices.invoice_number | invoice_line_items.order_item_id = order_items.order_item_id |
### Response:
select _ , count ( _ ) from _ group by _ | select order_id , count ( * ) from order_items group by order_id |
customers_and_invoices | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many order items correspond to each order id? | customers : customer_id , customer_first_name , customer_middle_initial , customer_last_name , gender , email_address , login_name , login_password , phone_number , town_city , state_county_province , country | orders : order_id , customer_id , date_order_placed , order_details | invoices : invoice_number , order_id , invoice_date | accounts : account_id , customer_id , date_account_opened , account_name , other_account_details | product_categories : production_type_code , product_type_description , vat_rating | products : product_id , parent_product_id , production_type_code , unit_price , product_name , product_color , product_size | financial_transactions : transaction_id , account_id , invoice_number , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | order_items : order_item_id , order_id , product_id , product_quantity , other_order_item_details | invoice_line_items : order_item_id , invoice_number , product_id , product_title , product_quantity , product_price , derived_product_cost , derived_vat_payable , derived_total_cost | orders.customer_id = customers.customer_id | invoices.order_id = orders.order_id | accounts.customer_id = customers.customer_id | products.production_type_code = product_categories.production_type_code | financial_transactions.account_id = accounts.account_id | financial_transactions.invoice_number = invoices.invoice_number | order_items.order_id = orders.order_id | order_items.product_id = products.product_id | invoice_line_items.product_id = products.product_id | invoice_line_items.invoice_number = invoices.invoice_number | invoice_line_items.order_item_id = order_items.order_item_id |
### Response:
select _ , count ( _ ) from _ group by _ | select order_id , count ( * ) from order_items group by order_id |
customers_and_invoices | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show the product ids and the number of unique orders containing each product. | customers : customer_id , customer_first_name , customer_middle_initial , customer_last_name , gender , email_address , login_name , login_password , phone_number , town_city , state_county_province , country | orders : order_id , customer_id , date_order_placed , order_details | invoices : invoice_number , order_id , invoice_date | accounts : account_id , customer_id , date_account_opened , account_name , other_account_details | product_categories : production_type_code , product_type_description , vat_rating | products : product_id , parent_product_id , production_type_code , unit_price , product_name , product_color , product_size | financial_transactions : transaction_id , account_id , invoice_number , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | order_items : order_item_id , order_id , product_id , product_quantity , other_order_item_details | invoice_line_items : order_item_id , invoice_number , product_id , product_title , product_quantity , product_price , derived_product_cost , derived_vat_payable , derived_total_cost | orders.customer_id = customers.customer_id | invoices.order_id = orders.order_id | accounts.customer_id = customers.customer_id | products.production_type_code = product_categories.production_type_code | financial_transactions.account_id = accounts.account_id | financial_transactions.invoice_number = invoices.invoice_number | order_items.order_id = orders.order_id | order_items.product_id = products.product_id | invoice_line_items.product_id = products.product_id | invoice_line_items.invoice_number = invoices.invoice_number | invoice_line_items.order_item_id = order_items.order_item_id |
### Response:
select _ , count ( distinct _ ) from _ group by _ | select product_id , count ( distinct order_id ) from order_items group by product_id |
customers_and_invoices | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many distinct order ids correspond to each product? | customers : customer_id , customer_first_name , customer_middle_initial , customer_last_name , gender , email_address , login_name , login_password , phone_number , town_city , state_county_province , country | orders : order_id , customer_id , date_order_placed , order_details | invoices : invoice_number , order_id , invoice_date | accounts : account_id , customer_id , date_account_opened , account_name , other_account_details | product_categories : production_type_code , product_type_description , vat_rating | products : product_id , parent_product_id , production_type_code , unit_price , product_name , product_color , product_size | financial_transactions : transaction_id , account_id , invoice_number , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | order_items : order_item_id , order_id , product_id , product_quantity , other_order_item_details | invoice_line_items : order_item_id , invoice_number , product_id , product_title , product_quantity , product_price , derived_product_cost , derived_vat_payable , derived_total_cost | orders.customer_id = customers.customer_id | invoices.order_id = orders.order_id | accounts.customer_id = customers.customer_id | products.production_type_code = product_categories.production_type_code | financial_transactions.account_id = accounts.account_id | financial_transactions.invoice_number = invoices.invoice_number | order_items.order_id = orders.order_id | order_items.product_id = products.product_id | invoice_line_items.product_id = products.product_id | invoice_line_items.invoice_number = invoices.invoice_number | invoice_line_items.order_item_id = order_items.order_item_id |
### Response:
select _ , count ( distinct _ ) from _ group by _ | select product_id , count ( distinct order_id ) from order_items group by product_id |
customers_and_invoices | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show all product names and the number of customers having an order on each product. | customers : customer_id , customer_first_name , customer_middle_initial , customer_last_name , gender , email_address , login_name , login_password , phone_number , town_city , state_county_province , country | orders : order_id , customer_id , date_order_placed , order_details | invoices : invoice_number , order_id , invoice_date | accounts : account_id , customer_id , date_account_opened , account_name , other_account_details | product_categories : production_type_code , product_type_description , vat_rating | products : product_id , parent_product_id , production_type_code , unit_price , product_name , product_color , product_size | financial_transactions : transaction_id , account_id , invoice_number , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | order_items : order_item_id , order_id , product_id , product_quantity , other_order_item_details | invoice_line_items : order_item_id , invoice_number , product_id , product_title , product_quantity , product_price , derived_product_cost , derived_vat_payable , derived_total_cost | orders.customer_id = customers.customer_id | invoices.order_id = orders.order_id | accounts.customer_id = customers.customer_id | products.production_type_code = product_categories.production_type_code | financial_transactions.account_id = accounts.account_id | financial_transactions.invoice_number = invoices.invoice_number | order_items.order_id = orders.order_id | order_items.product_id = products.product_id | invoice_line_items.product_id = products.product_id | invoice_line_items.invoice_number = invoices.invoice_number | invoice_line_items.order_item_id = order_items.order_item_id |
### Response:
select _ , count ( _ ) from _ group by _ | select products.product_name , count ( * ) from order_items join products on order_items.product_id = products.product_id join orders on orders.order_id = order_items.order_id group by products.product_name |
customers_and_invoices | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are teh names of the different products, as well as the number of customers who have ordered each product. | customers : customer_id , customer_first_name , customer_middle_initial , customer_last_name , gender , email_address , login_name , login_password , phone_number , town_city , state_county_province , country | orders : order_id , customer_id , date_order_placed , order_details | invoices : invoice_number , order_id , invoice_date | accounts : account_id , customer_id , date_account_opened , account_name , other_account_details | product_categories : production_type_code , product_type_description , vat_rating | products : product_id , parent_product_id , production_type_code , unit_price , product_name , product_color , product_size | financial_transactions : transaction_id , account_id , invoice_number , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | order_items : order_item_id , order_id , product_id , product_quantity , other_order_item_details | invoice_line_items : order_item_id , invoice_number , product_id , product_title , product_quantity , product_price , derived_product_cost , derived_vat_payable , derived_total_cost | orders.customer_id = customers.customer_id | invoices.order_id = orders.order_id | accounts.customer_id = customers.customer_id | products.production_type_code = product_categories.production_type_code | financial_transactions.account_id = accounts.account_id | financial_transactions.invoice_number = invoices.invoice_number | order_items.order_id = orders.order_id | order_items.product_id = products.product_id | invoice_line_items.product_id = products.product_id | invoice_line_items.invoice_number = invoices.invoice_number | invoice_line_items.order_item_id = order_items.order_item_id |
### Response:
select _ , count ( _ ) from _ group by _ | select products.product_name , count ( * ) from order_items join products on order_items.product_id = products.product_id join orders on orders.order_id = order_items.order_id group by products.product_name |
customers_and_invoices | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show order ids and the number of products in each order. | customers : customer_id , customer_first_name , customer_middle_initial , customer_last_name , gender , email_address , login_name , login_password , phone_number , town_city , state_county_province , country | orders : order_id , customer_id , date_order_placed , order_details | invoices : invoice_number , order_id , invoice_date | accounts : account_id , customer_id , date_account_opened , account_name , other_account_details | product_categories : production_type_code , product_type_description , vat_rating | products : product_id , parent_product_id , production_type_code , unit_price , product_name , product_color , product_size | financial_transactions : transaction_id , account_id , invoice_number , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | order_items : order_item_id , order_id , product_id , product_quantity , other_order_item_details | invoice_line_items : order_item_id , invoice_number , product_id , product_title , product_quantity , product_price , derived_product_cost , derived_vat_payable , derived_total_cost | orders.customer_id = customers.customer_id | invoices.order_id = orders.order_id | accounts.customer_id = customers.customer_id | products.production_type_code = product_categories.production_type_code | financial_transactions.account_id = accounts.account_id | financial_transactions.invoice_number = invoices.invoice_number | order_items.order_id = orders.order_id | order_items.product_id = products.product_id | invoice_line_items.product_id = products.product_id | invoice_line_items.invoice_number = invoices.invoice_number | invoice_line_items.order_item_id = order_items.order_item_id |
### Response:
select _ , count ( distinct _ ) from _ group by _ | select order_id , count ( distinct product_id ) from order_items group by order_id |
customers_and_invoices | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many different products correspond to each order id? | customers : customer_id , customer_first_name , customer_middle_initial , customer_last_name , gender , email_address , login_name , login_password , phone_number , town_city , state_county_province , country | orders : order_id , customer_id , date_order_placed , order_details | invoices : invoice_number , order_id , invoice_date | accounts : account_id , customer_id , date_account_opened , account_name , other_account_details | product_categories : production_type_code , product_type_description , vat_rating | products : product_id , parent_product_id , production_type_code , unit_price , product_name , product_color , product_size | financial_transactions : transaction_id , account_id , invoice_number , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | order_items : order_item_id , order_id , product_id , product_quantity , other_order_item_details | invoice_line_items : order_item_id , invoice_number , product_id , product_title , product_quantity , product_price , derived_product_cost , derived_vat_payable , derived_total_cost | orders.customer_id = customers.customer_id | invoices.order_id = orders.order_id | accounts.customer_id = customers.customer_id | products.production_type_code = product_categories.production_type_code | financial_transactions.account_id = accounts.account_id | financial_transactions.invoice_number = invoices.invoice_number | order_items.order_id = orders.order_id | order_items.product_id = products.product_id | invoice_line_items.product_id = products.product_id | invoice_line_items.invoice_number = invoices.invoice_number | invoice_line_items.order_item_id = order_items.order_item_id |
### Response:
select _ , count ( distinct _ ) from _ group by _ | select order_id , count ( distinct product_id ) from order_items group by order_id |
customers_and_invoices | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show order ids and the total quantity in each order. | customers : customer_id , customer_first_name , customer_middle_initial , customer_last_name , gender , email_address , login_name , login_password , phone_number , town_city , state_county_province , country | orders : order_id , customer_id , date_order_placed , order_details | invoices : invoice_number , order_id , invoice_date | accounts : account_id , customer_id , date_account_opened , account_name , other_account_details | product_categories : production_type_code , product_type_description , vat_rating | products : product_id , parent_product_id , production_type_code , unit_price , product_name , product_color , product_size | financial_transactions : transaction_id , account_id , invoice_number , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | order_items : order_item_id , order_id , product_id , product_quantity , other_order_item_details | invoice_line_items : order_item_id , invoice_number , product_id , product_title , product_quantity , product_price , derived_product_cost , derived_vat_payable , derived_total_cost | orders.customer_id = customers.customer_id | invoices.order_id = orders.order_id | accounts.customer_id = customers.customer_id | products.production_type_code = product_categories.production_type_code | financial_transactions.account_id = accounts.account_id | financial_transactions.invoice_number = invoices.invoice_number | order_items.order_id = orders.order_id | order_items.product_id = products.product_id | invoice_line_items.product_id = products.product_id | invoice_line_items.invoice_number = invoices.invoice_number | invoice_line_items.order_item_id = order_items.order_item_id |
### Response:
select _ , sum ( _ ) from _ group by _ | select order_id , sum ( product_quantity ) from order_items group by order_id |
customers_and_invoices | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Give the order ids for all orders, as well as the total product quantity in each. | customers : customer_id , customer_first_name , customer_middle_initial , customer_last_name , gender , email_address , login_name , login_password , phone_number , town_city , state_county_province , country | orders : order_id , customer_id , date_order_placed , order_details | invoices : invoice_number , order_id , invoice_date | accounts : account_id , customer_id , date_account_opened , account_name , other_account_details | product_categories : production_type_code , product_type_description , vat_rating | products : product_id , parent_product_id , production_type_code , unit_price , product_name , product_color , product_size | financial_transactions : transaction_id , account_id , invoice_number , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | order_items : order_item_id , order_id , product_id , product_quantity , other_order_item_details | invoice_line_items : order_item_id , invoice_number , product_id , product_title , product_quantity , product_price , derived_product_cost , derived_vat_payable , derived_total_cost | orders.customer_id = customers.customer_id | invoices.order_id = orders.order_id | accounts.customer_id = customers.customer_id | products.production_type_code = product_categories.production_type_code | financial_transactions.account_id = accounts.account_id | financial_transactions.invoice_number = invoices.invoice_number | order_items.order_id = orders.order_id | order_items.product_id = products.product_id | invoice_line_items.product_id = products.product_id | invoice_line_items.invoice_number = invoices.invoice_number | invoice_line_items.order_item_id = order_items.order_item_id |
### Response:
select _ , sum ( _ ) from _ group by _ | select order_id , sum ( product_quantity ) from order_items group by order_id |
customers_and_invoices | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many products were not included in any order? | customers : customer_id , customer_first_name , customer_middle_initial , customer_last_name , gender , email_address , login_name , login_password , phone_number , town_city , state_county_province , country | orders : order_id , customer_id , date_order_placed , order_details | invoices : invoice_number , order_id , invoice_date | accounts : account_id , customer_id , date_account_opened , account_name , other_account_details | product_categories : production_type_code , product_type_description , vat_rating | products : product_id , parent_product_id , production_type_code , unit_price , product_name , product_color , product_size | financial_transactions : transaction_id , account_id , invoice_number , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | order_items : order_item_id , order_id , product_id , product_quantity , other_order_item_details | invoice_line_items : order_item_id , invoice_number , product_id , product_title , product_quantity , product_price , derived_product_cost , derived_vat_payable , derived_total_cost | orders.customer_id = customers.customer_id | invoices.order_id = orders.order_id | accounts.customer_id = customers.customer_id | products.production_type_code = product_categories.production_type_code | financial_transactions.account_id = accounts.account_id | financial_transactions.invoice_number = invoices.invoice_number | order_items.order_id = orders.order_id | order_items.product_id = products.product_id | invoice_line_items.product_id = products.product_id | invoice_line_items.invoice_number = invoices.invoice_number | invoice_line_items.order_item_id = order_items.order_item_id |
### Response:
select count ( _ ) from _ where _ not in ( select _ from _ ) | select count ( * ) from products where product_id not in ( select product_id from order_items ) |
customers_and_invoices | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Count the number of products that were never ordered. | customers : customer_id , customer_first_name , customer_middle_initial , customer_last_name , gender , email_address , login_name , login_password , phone_number , town_city , state_county_province , country | orders : order_id , customer_id , date_order_placed , order_details | invoices : invoice_number , order_id , invoice_date | accounts : account_id , customer_id , date_account_opened , account_name , other_account_details | product_categories : production_type_code , product_type_description , vat_rating | products : product_id , parent_product_id , production_type_code , unit_price , product_name , product_color , product_size | financial_transactions : transaction_id , account_id , invoice_number , transaction_type , transaction_date , transaction_amount , transaction_comment , other_transaction_details | order_items : order_item_id , order_id , product_id , product_quantity , other_order_item_details | invoice_line_items : order_item_id , invoice_number , product_id , product_title , product_quantity , product_price , derived_product_cost , derived_vat_payable , derived_total_cost | orders.customer_id = customers.customer_id | invoices.order_id = orders.order_id | accounts.customer_id = customers.customer_id | products.production_type_code = product_categories.production_type_code | financial_transactions.account_id = accounts.account_id | financial_transactions.invoice_number = invoices.invoice_number | order_items.order_id = orders.order_id | order_items.product_id = products.product_id | invoice_line_items.product_id = products.product_id | invoice_line_items.invoice_number = invoices.invoice_number | invoice_line_items.order_item_id = order_items.order_item_id |
### Response:
select count ( _ ) from _ where _ not in ( select _ from _ ) | select count ( * ) from products where product_id not in ( select product_id from order_items ) |
wedding | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many churches opened before 1850 are there? | people : people_id , name , country , is_male , age | church : church_id , name , organized_by , open_date , continuation_of | wedding : church_id , male_id , female_id , year | wedding.female_id = people.people_id | wedding.male_id = people.people_id | wedding.church_id = church.church_id |
### Response:
select count ( _ ) from _ where _ | select count ( * ) from church where open_date < 1850 |
wedding | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show the name, open date, and organizer for all churches. | people : people_id , name , country , is_male , age | church : church_id , name , organized_by , open_date , continuation_of | wedding : church_id , male_id , female_id , year | wedding.female_id = people.people_id | wedding.male_id = people.people_id | wedding.church_id = church.church_id |
### Response:
select _ from _ | select name , open_date , organized_by from church |
wedding | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: List all church names in descending order of opening date. | people : people_id , name , country , is_male , age | church : church_id , name , organized_by , open_date , continuation_of | wedding : church_id , male_id , female_id , year | wedding.female_id = people.people_id | wedding.male_id = people.people_id | wedding.church_id = church.church_id |
### Response:
select _ from _ order by _ desc | select name from church order by open_date desc |
wedding | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show the opening year in whcih at least two churches opened. | people : people_id , name , country , is_male , age | church : church_id , name , organized_by , open_date , continuation_of | wedding : church_id , male_id , female_id , year | wedding.female_id = people.people_id | wedding.male_id = people.people_id | wedding.church_id = church.church_id |
### Response:
select _ from _ group by _ having count ( _ ) >= _ | select open_date from church group by open_date having count ( * ) >= 2 |
wedding | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show the organizer and name for churches that opened between 1830 and 1840. | people : people_id , name , country , is_male , age | church : church_id , name , organized_by , open_date , continuation_of | wedding : church_id , male_id , female_id , year | wedding.female_id = people.people_id | wedding.male_id = people.people_id | wedding.church_id = church.church_id |
### Response:
select _ from _ where _ between _ and _ | select organized_by , name from church where open_date between 1830 and 1840 |
wedding | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show all opening years and the number of churches that opened in that year. | people : people_id , name , country , is_male , age | church : church_id , name , organized_by , open_date , continuation_of | wedding : church_id , male_id , female_id , year | wedding.female_id = people.people_id | wedding.male_id = people.people_id | wedding.church_id = church.church_id |
### Response:
select _ , count ( _ ) from _ group by _ | select open_date , count ( * ) from church group by open_date |
wedding | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show the name and opening year for three churches that opened most recently. | people : people_id , name , country , is_male , age | church : church_id , name , organized_by , open_date , continuation_of | wedding : church_id , male_id , female_id , year | wedding.female_id = people.people_id | wedding.male_id = people.people_id | wedding.church_id = church.church_id |
### Response:
select _ from _ order by _ desc limit _ | select name , open_date from church order by open_date desc limit 3 |
wedding | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many female people are older than 30 in our record? | people : people_id , name , country , is_male , age | church : church_id , name , organized_by , open_date , continuation_of | wedding : church_id , male_id , female_id , year | wedding.female_id = people.people_id | wedding.male_id = people.people_id | wedding.church_id = church.church_id |
### Response:
select count ( _ ) from _ where _ | select count ( * ) from people where is_male = 'F' and age > 30 |
wedding | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show the country where people older than 30 and younger than 25 are from. | people : people_id , name , country , is_male , age | church : church_id , name , organized_by , open_date , continuation_of | wedding : church_id , male_id , female_id , year | wedding.female_id = people.people_id | wedding.male_id = people.people_id | wedding.church_id = church.church_id |
### Response:
select _ from _ where _ intersect select _ from _ where _ | select country from people where age < 25 intersect select country from people where age > 30 |
wedding | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show the minimum, maximum, and average age for all people. | people : people_id , name , country , is_male , age | church : church_id , name , organized_by , open_date , continuation_of | wedding : church_id , male_id , female_id , year | wedding.female_id = people.people_id | wedding.male_id = people.people_id | wedding.church_id = church.church_id |
### Response:
select min ( _ ) , max ( _ ) , avg ( _ ) from _ | select min ( age ) , max ( age ) , avg ( age ) from people |
wedding | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show the name and country for all people whose age is smaller than the average. | people : people_id , name , country , is_male , age | church : church_id , name , organized_by , open_date , continuation_of | wedding : church_id , male_id , female_id , year | wedding.female_id = people.people_id | wedding.male_id = people.people_id | wedding.church_id = church.church_id |
### Response:
select _ from _ where _ < ( select avg ( _ ) from _ ) | select name , country from people where age < ( select avg ( age ) from people ) |
wedding | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show the pair of male and female names in all weddings after year 2014 | people : people_id , name , country , is_male , age | church : church_id , name , organized_by , open_date , continuation_of | wedding : church_id , male_id , female_id , year | wedding.female_id = people.people_id | wedding.male_id = people.people_id | wedding.church_id = church.church_id |
### Response:
select _ from _ where _ | select people.name , people.name from wedding join people on wedding.male_id = people.people_id join people on wedding.female_id = people.people_id where wedding.year > 2014 |
wedding | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show the name and age for all male people who don't have a wedding. | people : people_id , name , country , is_male , age | church : church_id , name , organized_by , open_date , continuation_of | wedding : church_id , male_id , female_id , year | wedding.female_id = people.people_id | wedding.male_id = people.people_id | wedding.church_id = church.church_id |
### Response:
select _ from _ where _ not in ( select _ from _ ) | select name , age from people where is_male = 'T' and people_id not in ( select male_id from wedding ) |
wedding | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show all church names except for those that had a wedding in year 2015. | people : people_id , name , country , is_male , age | church : church_id , name , organized_by , open_date , continuation_of | wedding : church_id , male_id , female_id , year | wedding.female_id = people.people_id | wedding.male_id = people.people_id | wedding.church_id = church.church_id |
### Response:
select _ from _ except select _ from _ where _ | select name from church except select church.name from church join wedding on church.church_id = wedding.church_id where wedding.year = 2015 |
wedding | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show all church names that have hosted least two weddings. | people : people_id , name , country , is_male , age | church : church_id , name , organized_by , open_date , continuation_of | wedding : church_id , male_id , female_id , year | wedding.female_id = people.people_id | wedding.male_id = people.people_id | wedding.church_id = church.church_id |
### Response:
select _ from _ group by _ having count ( _ ) >= _ | select church.name from church join wedding on church.church_id = wedding.church_id group by church.church_id having count ( * ) >= 2 |
wedding | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show the names for all females from Canada having a wedding in year 2016. | people : people_id , name , country , is_male , age | church : church_id , name , organized_by , open_date , continuation_of | wedding : church_id , male_id , female_id , year | wedding.female_id = people.people_id | wedding.male_id = people.people_id | wedding.church_id = church.church_id |
### Response:
select _ from _ where _ | select people.name from wedding join people on wedding.female_id = people.people_id where wedding.year = 2016 and people.is_male = 'F' and people.country = 'Canada' |
wedding | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many weddings are there in year 2016? | people : people_id , name , country , is_male , age | church : church_id , name , organized_by , open_date , continuation_of | wedding : church_id , male_id , female_id , year | wedding.female_id = people.people_id | wedding.male_id = people.people_id | wedding.church_id = church.church_id |
### Response:
select count ( _ ) from _ where _ | select count ( * ) from wedding where year = 2016 |
wedding | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show the church names for the weddings of all people older than 30. | people : people_id , name , country , is_male , age | church : church_id , name , organized_by , open_date , continuation_of | wedding : church_id , male_id , female_id , year | wedding.female_id = people.people_id | wedding.male_id = people.people_id | wedding.church_id = church.church_id |
### Response:
select _ from _ where _ | select church.name from wedding join people on wedding.male_id = people.people_id join people on wedding.female_id = people.people_id join church on church.church_id = wedding.church_id where people.age > 30 or people.age > 30 |
wedding | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show all countries and the number of people from each country. | people : people_id , name , country , is_male , age | church : church_id , name , organized_by , open_date , continuation_of | wedding : church_id , male_id , female_id , year | wedding.female_id = people.people_id | wedding.male_id = people.people_id | wedding.church_id = church.church_id |
### Response:
select _ , count ( _ ) from _ group by _ | select country , count ( * ) from people group by country |
wedding | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many churches have a wedding in year 2016? | people : people_id , name , country , is_male , age | church : church_id , name , organized_by , open_date , continuation_of | wedding : church_id , male_id , female_id , year | wedding.female_id = people.people_id | wedding.male_id = people.people_id | wedding.church_id = church.church_id |
### Response:
select count ( distinct _ ) from _ where _ | select count ( distinct church_id ) from wedding where year = 2016 |
theme_gallery | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many artists do we have? | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id |
### Response:
select count ( _ ) from _ | select count ( * ) from artist |
theme_gallery | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Count the number of artists. | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id |
### Response:
select count ( _ ) from _ | select count ( * ) from artist |
theme_gallery | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show all artist name, age, and country ordered by the yeared they joined. | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id |
### Response:
select _ from _ order by _ asc | select name , age , country from artist order by year_join asc |
theme_gallery | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the names, ages, and countries of artists, sorted by the year they joined? | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id |
### Response:
select _ from _ order by _ asc | select name , age , country from artist order by year_join asc |
theme_gallery | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are all distinct country for artists? | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id |
### Response:
select distinct _ from _ | select distinct country from artist |
theme_gallery | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Return the different countries for artists. | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id |
### Response:
select distinct _ from _ | select distinct country from artist |
theme_gallery | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show all artist names and the year joined who are not from United States. | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id |
### Response:
select _ from _ where _ | select name , year_join from artist where country != 'United States' |
theme_gallery | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the names and year of joining for artists that do not have the country "United States"? | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id |
### Response:
select _ from _ where _ | select name , year_join from artist where country != 'United States' |
theme_gallery | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many artists are above age 46 and joined after 1990? | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id |
### Response:
select count ( _ ) from _ where _ | select count ( * ) from artist where age > 46 and year_join > 1990 |
theme_gallery | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Count the number of artists who are older than 46 and joined after 1990. | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id |
### Response:
select count ( _ ) from _ where _ | select count ( * ) from artist where age > 46 and year_join > 1990 |
theme_gallery | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the average and minimum age of all artists from United States. | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id |
### Response:
select avg ( _ ) , min ( _ ) from _ where _ | select avg ( age ) , min ( age ) from artist where country = 'United States' |
theme_gallery | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Return the average and minimum ages across artists from the United States. | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id |
### Response:
select avg ( _ ) , min ( _ ) from _ where _ | select avg ( age ) , min ( age ) from artist where country = 'United States' |
theme_gallery | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the name of the artist who joined latest? | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id |
### Response:
select _ from _ order by _ desc limit _ | select name from artist order by year_join desc limit 1 |
theme_gallery | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Return the name of the artist who has the latest join year. | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id |
### Response:
select _ from _ order by _ desc limit _ | select name from artist order by year_join desc limit 1 |
theme_gallery | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many exhibition are there in year 2005 or after? | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id |
### Response:
select count ( _ ) from _ where _ | select count ( * ) from exhibition where year >= 2005 |
theme_gallery | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Count the number of exhibitions that happened in or after 2005. | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id |
### Response:
select count ( _ ) from _ where _ | select count ( * ) from exhibition where year >= 2005 |
theme_gallery | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show theme and year for all exhibitions with ticket prices lower than 15. | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id |
### Response:
select _ from _ where _ | select theme , year from exhibition where ticket_price < 15 |
theme_gallery | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the theme and year for all exhibitions that have a ticket price under 15? | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id |
### Response:
select _ from _ where _ | select theme , year from exhibition where ticket_price < 15 |
theme_gallery | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show all artist names and the number of exhibitions for each artist. | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id |
### Response:
select _ , count ( _ ) from _ group by _ | select artist.name , count ( * ) from exhibition join artist on exhibition.artist_id = artist.artist_id group by exhibition.artist_id |
theme_gallery | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many exhibitions has each artist had? | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id |
### Response:
select _ , count ( _ ) from _ group by _ | select artist.name , count ( * ) from exhibition join artist on exhibition.artist_id = artist.artist_id group by exhibition.artist_id |
theme_gallery | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the name and country for the artist with most number of exhibitions? | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id |
### Response:
select _ from _ group by _ order by count ( _ ) desc limit _ | select artist.name , artist.country from exhibition join artist on exhibition.artist_id = artist.artist_id group by exhibition.artist_id order by count ( * ) desc limit 1 |
theme_gallery | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Return the name and country corresponding to the artist who has had the most exhibitions. | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id |
### Response:
select _ from _ group by _ order by count ( _ ) desc limit _ | select artist.name , artist.country from exhibition join artist on exhibition.artist_id = artist.artist_id group by exhibition.artist_id order by count ( * ) desc limit 1 |
theme_gallery | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show names for artists without any exhibition. | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id |
### Response:
select _ from _ where _ not in ( select _ from _ ) | select name from artist where artist_id not in ( select artist_id from exhibition ) |
theme_gallery | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the names of artists that have not had any exhibitions? | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id |
### Response:
select _ from _ where _ not in ( select _ from _ ) | select name from artist where artist_id not in ( select artist_id from exhibition ) |
theme_gallery | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the theme and artist name for the exhibition with a ticket price higher than the average? | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id |
### Response:
select _ from _ where _ > ( select avg ( _ ) from _ ) | select exhibition.theme , artist.name from exhibition join artist on exhibition.artist_id = artist.artist_id where exhibition.ticket_price > ( select avg ( ticket_price ) from exhibition ) |
theme_gallery | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Return the names of artists and the themes of their exhibitions that had a ticket price higher than average. | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id |
### Response:
select _ from _ where _ > ( select avg ( _ ) from _ ) | select exhibition.theme , artist.name from exhibition join artist on exhibition.artist_id = artist.artist_id where exhibition.ticket_price > ( select avg ( ticket_price ) from exhibition ) |
theme_gallery | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show the average, minimum, and maximum ticket prices for exhibitions for all years before 2009. | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id |
### Response:
select avg ( _ ) , min ( _ ) , max ( _ ) from _ where _ | select avg ( ticket_price ) , min ( ticket_price ) , max ( ticket_price ) from exhibition where year < 2009 |
theme_gallery | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the average, minimum, and maximum ticket prices for exhibitions that happened prior to 2009? | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id |
### Response:
select avg ( _ ) , min ( _ ) , max ( _ ) from _ where _ | select avg ( ticket_price ) , min ( ticket_price ) , max ( ticket_price ) from exhibition where year < 2009 |
theme_gallery | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show theme and year for all exhibitions in an descending order of ticket price. | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id |
### Response:
select _ from _ order by _ desc | select theme , year from exhibition order by ticket_price desc |
theme_gallery | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the themes and years for exhibitions, sorted by ticket price descending? | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id |
### Response:
select _ from _ order by _ desc | select theme , year from exhibition order by ticket_price desc |
theme_gallery | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the theme, date, and attendance for the exhibition in year 2004? | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id |
### Response:
select _ from _ where _ | select exhibition.theme , exhibition_record.date , exhibition_record.attendance from exhibition_record join exhibition on exhibition_record.exhibition_id = exhibition.exhibition_id where exhibition.year = 2004 |
theme_gallery | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Return the themes, dates, and attendance for exhibitions that happened in 2004. | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id |
### Response:
select _ from _ where _ | select exhibition.theme , exhibition_record.date , exhibition_record.attendance from exhibition_record join exhibition on exhibition_record.exhibition_id = exhibition.exhibition_id where exhibition.year = 2004 |
theme_gallery | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show all artist names who didn't have an exhibition in 2004. | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id |
### Response:
select _ from _ except select _ from _ where _ | select name from artist except select artist.name from exhibition join artist on exhibition.artist_id = artist.artist_id where exhibition.year = 2004 |
theme_gallery | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the names of artists who did not have an exhibition in 2004? | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id |
### Response:
select _ from _ except select _ from _ where _ | select name from artist except select artist.name from exhibition join artist on exhibition.artist_id = artist.artist_id where exhibition.year = 2004 |
theme_gallery | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show the theme for exhibitions with both records of an attendance below 100 and above 500. | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id |
### Response:
select _ from _ where _ intersect select _ from _ where _ | select exhibition.theme from exhibition_record join exhibition on exhibition_record.exhibition_id = exhibition.exhibition_id where exhibition_record.attendance < 100 intersect select exhibition.theme from exhibition_record join exhibition on exhibition_record.exhibition_id = exhibition.exhibition_id where exhibition_record.attendance > 500 |
theme_gallery | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Which themes have had corresponding exhibitions that have had attendance both below 100 and above 500? | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id |
### Response:
select _ from _ where _ intersect select _ from _ where _ | select exhibition.theme from exhibition_record join exhibition on exhibition_record.exhibition_id = exhibition.exhibition_id where exhibition_record.attendance < 100 intersect select exhibition.theme from exhibition_record join exhibition on exhibition_record.exhibition_id = exhibition.exhibition_id where exhibition_record.attendance > 500 |
theme_gallery | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many exhibitions have a attendance more than 100 or have a ticket price below 10? | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id |
### Response:
select count ( _ ) from _ where _ | select count ( * ) from exhibition_record join exhibition on exhibition_record.exhibition_id = exhibition.exhibition_id where exhibition_record.attendance > 100 or exhibition.ticket_price < 10 |
theme_gallery | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Count the number of exhibitions that have had an attendnance of over 100 or a ticket prices under 10. | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id |
### Response:
select count ( _ ) from _ where _ | select count ( * ) from exhibition_record join exhibition on exhibition_record.exhibition_id = exhibition.exhibition_id where exhibition_record.attendance > 100 or exhibition.ticket_price < 10 |
theme_gallery | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show all artist names with an average exhibition attendance over 200. | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id |
### Response:
select _ from _ group by _ having avg ( _ ) > _ | select artist.name from exhibition_record join exhibition on exhibition_record.exhibition_id = exhibition.exhibition_id join artist on artist.artist_id = exhibition.artist_id group by artist.artist_id having avg ( exhibition_record.attendance ) > 200 |
theme_gallery | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the names of artist whose exhibitions draw over 200 attendees on average? | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id |
### Response:
select _ from _ group by _ having avg ( _ ) > _ | select artist.name from exhibition_record join exhibition on exhibition_record.exhibition_id = exhibition.exhibition_id join artist on artist.artist_id = exhibition.artist_id group by artist.artist_id having avg ( exhibition_record.attendance ) > 200 |
epinions_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the id of the item whose title is "orange". | item : i_id , title | review : a_id , u_id , i_id , rating , rank | useracct : u_id , name | trust : source_u_id , target_u_id , trust | review.i_id = item.i_id | review.u_id = useracct.u_id | trust.target_u_id = useracct.u_id | trust.source_u_id = useracct.u_id |
### Response:
select _ from _ where _ | select i_id from item where title = 'orange' |
epinions_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: List all information in the item table. | item : i_id , title | review : a_id , u_id , i_id , rating , rank | useracct : u_id , name | trust : source_u_id , target_u_id , trust | review.i_id = item.i_id | review.u_id = useracct.u_id | trust.target_u_id = useracct.u_id | trust.source_u_id = useracct.u_id |
### Response:
select _ from _ | select * from item |
epinions_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the number of reviews. | item : i_id , title | review : a_id , u_id , i_id , rating , rank | useracct : u_id , name | trust : source_u_id , target_u_id , trust | review.i_id = item.i_id | review.u_id = useracct.u_id | trust.target_u_id = useracct.u_id | trust.source_u_id = useracct.u_id |
### Response:
select count ( _ ) from _ | select count ( * ) from review |
epinions_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many users are there? | item : i_id , title | review : a_id , u_id , i_id , rating , rank | useracct : u_id , name | trust : source_u_id , target_u_id , trust | review.i_id = item.i_id | review.u_id = useracct.u_id | trust.target_u_id = useracct.u_id | trust.source_u_id = useracct.u_id |
### Response:
select count ( _ ) from _ | select count ( * ) from useracct |
epinions_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the average and maximum rating of all reviews. | item : i_id , title | review : a_id , u_id , i_id , rating , rank | useracct : u_id , name | trust : source_u_id , target_u_id , trust | review.i_id = item.i_id | review.u_id = useracct.u_id | trust.target_u_id = useracct.u_id | trust.source_u_id = useracct.u_id |
### Response:
select avg ( _ ) , max ( _ ) from _ | select avg ( rating ) , max ( rating ) from review |
epinions_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the highest rank of all reviews. | item : i_id , title | review : a_id , u_id , i_id , rating , rank | useracct : u_id , name | trust : source_u_id , target_u_id , trust | review.i_id = item.i_id | review.u_id = useracct.u_id | trust.target_u_id = useracct.u_id | trust.source_u_id = useracct.u_id |
### Response:
select min ( _ ) from _ | select min ( rank ) from review |
epinions_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many different users wrote some reviews? | item : i_id , title | review : a_id , u_id , i_id , rating , rank | useracct : u_id , name | trust : source_u_id , target_u_id , trust | review.i_id = item.i_id | review.u_id = useracct.u_id | trust.target_u_id = useracct.u_id | trust.source_u_id = useracct.u_id |
### Response:
select count ( distinct _ ) from _ | select count ( distinct u_id ) from review |
epinions_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many different items were reviewed by some users? | item : i_id , title | review : a_id , u_id , i_id , rating , rank | useracct : u_id , name | trust : source_u_id , target_u_id , trust | review.i_id = item.i_id | review.u_id = useracct.u_id | trust.target_u_id = useracct.u_id | trust.source_u_id = useracct.u_id |
### Response:
select count ( distinct _ ) from _ | select count ( distinct i_id ) from review |
epinions_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the number of items that did not receive any review. | item : i_id , title | review : a_id , u_id , i_id , rating , rank | useracct : u_id , name | trust : source_u_id , target_u_id , trust | review.i_id = item.i_id | review.u_id = useracct.u_id | trust.target_u_id = useracct.u_id | trust.source_u_id = useracct.u_id |
### Response:
select count ( _ ) from _ where _ not in ( select _ from _ ) | select count ( * ) from item where i_id not in ( select i_id from review ) |
epinions_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the names of users who did not leave any review. | item : i_id , title | review : a_id , u_id , i_id , rating , rank | useracct : u_id , name | trust : source_u_id , target_u_id , trust | review.i_id = item.i_id | review.u_id = useracct.u_id | trust.target_u_id = useracct.u_id | trust.source_u_id = useracct.u_id |
### Response:
select _ from _ where _ not in ( select _ from _ ) | select name from useracct where u_id not in ( select u_id from review ) |
epinions_1 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the names of goods that receive a rating of 10. | item : i_id , title | review : a_id , u_id , i_id , rating , rank | useracct : u_id , name | trust : source_u_id , target_u_id , trust | review.i_id = item.i_id | review.u_id = useracct.u_id | trust.target_u_id = useracct.u_id | trust.source_u_id = useracct.u_id |
### Response:
select _ from _ where _ | select item.title from item join review on item.i_id = review.i_id where review.rating = 10 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.