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

Convert text to sql: Which industries have both companies with headquarter in "USA" and companies with headquarter in "China"? | buildings : id , name , city , height , stories , status | companies : id , name , headquarters , industry , sales_billion , profits_billion , assets_billion , market_value_billion | office_locations : building_id , company_id , move_in_year | office_locations.company_id = companies.id | office_locations.building_id = buildings.id | 

### Response:

select industry from companies where headquarters = 'USA' intersect select industry from companies where headquarters = 'China'

### Instruction:

Convert text to sql: Find the number of companies whose industry is "Banking" or "Conglomerate", | buildings : id , name , city , height , stories , status | companies : id , name , headquarters , industry , sales_billion , profits_billion , assets_billion , market_value_billion | office_locations : building_id , company_id , move_in_year | office_locations.company_id = companies.id | office_locations.building_id = buildings.id | 

### Response:

select count ( * ) from companies where industry = 'Banking' or industry = 'Conglomerate'

### Instruction:

Convert text to sql: How many companies are in either "Banking" industry or "Conglomerate" industry? | buildings : id , name , city , height , stories , status | companies : id , name , headquarters , industry , sales_billion , profits_billion , assets_billion , market_value_billion | office_locations : building_id , company_id , move_in_year | office_locations.company_id = companies.id | office_locations.building_id = buildings.id | 

### Response:

select count ( * ) from companies where industry = 'Banking' or industry = 'Conglomerate'

### Instruction:

Convert text to sql: Show the headquarters shared by more than two companies. | buildings : id , name , city , height , stories , status | companies : id , name , headquarters , industry , sales_billion , profits_billion , assets_billion , market_value_billion | office_locations : building_id , company_id , move_in_year | office_locations.company_id = companies.id | office_locations.building_id = buildings.id | 

### Response:

select headquarters from companies group by headquarters having count ( * ) > 2

### Instruction:

Convert text to sql: Which headquarter locations are used by more than 2 companies? | buildings : id , name , city , height , stories , status | companies : id , name , headquarters , industry , sales_billion , profits_billion , assets_billion , market_value_billion | office_locations : building_id , company_id , move_in_year | office_locations.company_id = companies.id | office_locations.building_id = buildings.id | 

### Response:

select headquarters from companies group by headquarters having count ( * ) > 2
### Instruction:

Convert text to sql: How many products are there? | addresses : address_id , address_details | locations : location_id , other_details | products : product_id , product_type_code , product_name , product_price | parties : party_id , party_details | assets : asset_id , other_details | channels : channel_id , other_details | finances : finance_id , other_details | events : event_id , address_id , channel_id , event_type_code , finance_id , location_id | products_in_events : product_in_event_id , event_id , product_id | parties_in_events : party_id , event_id , role_code | agreements : document_id , event_id | assets_in_events : asset_id , event_id | events.finance_id = finances.finance_id | events.address_id = addresses.address_id | events.location_id = locations.location_id | products_in_events.product_id = products.product_id | products_in_events.event_id = events.event_id | parties_in_events.event_id = events.event_id | parties_in_events.party_id = parties.party_id | agreements.event_id = events.event_id | assets_in_events.event_id = events.event_id | assets_in_events.event_id = events.event_id | 

### Response:

select count ( * ) from products

### Instruction:

Convert text to sql: List the name of products in ascending order of price. | addresses : address_id , address_details | locations : location_id , other_details | products : product_id , product_type_code , product_name , product_price | parties : party_id , party_details | assets : asset_id , other_details | channels : channel_id , other_details | finances : finance_id , other_details | events : event_id , address_id , channel_id , event_type_code , finance_id , location_id | products_in_events : product_in_event_id , event_id , product_id | parties_in_events : party_id , event_id , role_code | agreements : document_id , event_id | assets_in_events : asset_id , event_id | events.finance_id = finances.finance_id | events.address_id = addresses.address_id | events.location_id = locations.location_id | products_in_events.product_id = products.product_id | products_in_events.event_id = events.event_id | parties_in_events.event_id = events.event_id | parties_in_events.party_id = parties.party_id | agreements.event_id = events.event_id | assets_in_events.event_id = events.event_id | assets_in_events.event_id = events.event_id | 

### Response:

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

Convert text to sql: What are the names and type codes of products? | addresses : address_id , address_details | locations : location_id , other_details | products : product_id , product_type_code , product_name , product_price | parties : party_id , party_details | assets : asset_id , other_details | channels : channel_id , other_details | finances : finance_id , other_details | events : event_id , address_id , channel_id , event_type_code , finance_id , location_id | products_in_events : product_in_event_id , event_id , product_id | parties_in_events : party_id , event_id , role_code | agreements : document_id , event_id | assets_in_events : asset_id , event_id | events.finance_id = finances.finance_id | events.address_id = addresses.address_id | events.location_id = locations.location_id | products_in_events.product_id = products.product_id | products_in_events.event_id = events.event_id | parties_in_events.event_id = events.event_id | parties_in_events.party_id = parties.party_id | agreements.event_id = events.event_id | assets_in_events.event_id = events.event_id | assets_in_events.event_id = events.event_id | 

### Response:

select product_name , product_type_code from products

### Instruction:

Convert text to sql: Show the prices of the products named "Dining" or "Trading Policy". | addresses : address_id , address_details | locations : location_id , other_details | products : product_id , product_type_code , product_name , product_price | parties : party_id , party_details | assets : asset_id , other_details | channels : channel_id , other_details | finances : finance_id , other_details | events : event_id , address_id , channel_id , event_type_code , finance_id , location_id | products_in_events : product_in_event_id , event_id , product_id | parties_in_events : party_id , event_id , role_code | agreements : document_id , event_id | assets_in_events : asset_id , event_id | events.finance_id = finances.finance_id | events.address_id = addresses.address_id | events.location_id = locations.location_id | products_in_events.product_id = products.product_id | products_in_events.event_id = events.event_id | parties_in_events.event_id = events.event_id | parties_in_events.party_id = parties.party_id | agreements.event_id = events.event_id | assets_in_events.event_id = events.event_id | assets_in_events.event_id = events.event_id | 

### Response:

select product_price from products where product_name = 'Dining' or product_name = 'Trading Policy'
### Instruction:

Convert text to sql: What is the average price for products? | addresses : address_id , address_details | locations : location_id , other_details | products : product_id , product_type_code , product_name , product_price | parties : party_id , party_details | assets : asset_id , other_details | channels : channel_id , other_details | finances : finance_id , other_details | events : event_id , address_id , channel_id , event_type_code , finance_id , location_id | products_in_events : product_in_event_id , event_id , product_id | parties_in_events : party_id , event_id , role_code | agreements : document_id , event_id | assets_in_events : asset_id , event_id | events.finance_id = finances.finance_id | events.address_id = addresses.address_id | events.location_id = locations.location_id | products_in_events.product_id = products.product_id | products_in_events.event_id = events.event_id | parties_in_events.event_id = events.event_id | parties_in_events.party_id = parties.party_id | agreements.event_id = events.event_id | assets_in_events.event_id = events.event_id | assets_in_events.event_id = events.event_id | 

### Response:

select avg ( product_price ) from products

### Instruction:

Convert text to sql: What is the name of the product with the highest price? | addresses : address_id , address_details | locations : location_id , other_details | products : product_id , product_type_code , product_name , product_price | parties : party_id , party_details | assets : asset_id , other_details | channels : channel_id , other_details | finances : finance_id , other_details | events : event_id , address_id , channel_id , event_type_code , finance_id , location_id | products_in_events : product_in_event_id , event_id , product_id | parties_in_events : party_id , event_id , role_code | agreements : document_id , event_id | assets_in_events : asset_id , event_id | events.finance_id = finances.finance_id | events.address_id = addresses.address_id | events.location_id = locations.location_id | products_in_events.product_id = products.product_id | products_in_events.event_id = events.event_id | parties_in_events.event_id = events.event_id | parties_in_events.party_id = parties.party_id | agreements.event_id = events.event_id | assets_in_events.event_id = events.event_id | assets_in_events.event_id = events.event_id | 

### Response:

select product_name from products order by product_price desc limit 1
### Instruction:

Convert text to sql: Show different type codes of products and the number of products with each type code. | addresses : address_id , address_details | locations : location_id , other_details | products : product_id , product_type_code , product_name , product_price | parties : party_id , party_details | assets : asset_id , other_details | channels : channel_id , other_details | finances : finance_id , other_details | events : event_id , address_id , channel_id , event_type_code , finance_id , location_id | products_in_events : product_in_event_id , event_id , product_id | parties_in_events : party_id , event_id , role_code | agreements : document_id , event_id | assets_in_events : asset_id , event_id | events.finance_id = finances.finance_id | events.address_id = addresses.address_id | events.location_id = locations.location_id | products_in_events.product_id = products.product_id | products_in_events.event_id = events.event_id | parties_in_events.event_id = events.event_id | parties_in_events.party_id = parties.party_id | agreements.event_id = events.event_id | assets_in_events.event_id = events.event_id | assets_in_events.event_id = events.event_id | 

### Response:

select product_type_code , count ( * ) from products group by product_type_code

### Instruction:

Convert text to sql: Show the most common type code across products. | addresses : address_id , address_details | locations : location_id , other_details | products : product_id , product_type_code , product_name , product_price | parties : party_id , party_details | assets : asset_id , other_details | channels : channel_id , other_details | finances : finance_id , other_details | events : event_id , address_id , channel_id , event_type_code , finance_id , location_id | products_in_events : product_in_event_id , event_id , product_id | parties_in_events : party_id , event_id , role_code | agreements : document_id , event_id | assets_in_events : asset_id , event_id | events.finance_id = finances.finance_id | events.address_id = addresses.address_id | events.location_id = locations.location_id | products_in_events.product_id = products.product_id | products_in_events.event_id = events.event_id | parties_in_events.event_id = events.event_id | parties_in_events.party_id = parties.party_id | agreements.event_id = events.event_id | assets_in_events.event_id = events.event_id | assets_in_events.event_id = events.event_id | 

### Response:

select product_type_code from products group by product_type_code order by count ( * ) desc limit 1
### Instruction:

Convert text to sql: Show the product type codes that have at least two products. | addresses : address_id , address_details | locations : location_id , other_details | products : product_id , product_type_code , product_name , product_price | parties : party_id , party_details | assets : asset_id , other_details | channels : channel_id , other_details | finances : finance_id , other_details | events : event_id , address_id , channel_id , event_type_code , finance_id , location_id | products_in_events : product_in_event_id , event_id , product_id | parties_in_events : party_id , event_id , role_code | agreements : document_id , event_id | assets_in_events : asset_id , event_id | events.finance_id = finances.finance_id | events.address_id = addresses.address_id | events.location_id = locations.location_id | products_in_events.product_id = products.product_id | products_in_events.event_id = events.event_id | parties_in_events.event_id = events.event_id | parties_in_events.party_id = parties.party_id | agreements.event_id = events.event_id | assets_in_events.event_id = events.event_id | assets_in_events.event_id = events.event_id | 

### Response:

select product_type_code from products group by product_type_code having count ( * ) >= 2

### Instruction:

Convert text to sql: Show the product type codes that have both products with price higher than 4500 and products with price lower than 3000. | addresses : address_id , address_details | locations : location_id , other_details | products : product_id , product_type_code , product_name , product_price | parties : party_id , party_details | assets : asset_id , other_details | channels : channel_id , other_details | finances : finance_id , other_details | events : event_id , address_id , channel_id , event_type_code , finance_id , location_id | products_in_events : product_in_event_id , event_id , product_id | parties_in_events : party_id , event_id , role_code | agreements : document_id , event_id | assets_in_events : asset_id , event_id | events.finance_id = finances.finance_id | events.address_id = addresses.address_id | events.location_id = locations.location_id | products_in_events.product_id = products.product_id | products_in_events.event_id = events.event_id | parties_in_events.event_id = events.event_id | parties_in_events.party_id = parties.party_id | agreements.event_id = events.event_id | assets_in_events.event_id = events.event_id | assets_in_events.event_id = events.event_id | 

### Response:

select product_type_code from products where product_price > 4500 intersect select product_type_code from products where product_price < 3000
### Instruction:

Convert text to sql: Show the names of products and the number of events they are in. | addresses : address_id , address_details | locations : location_id , other_details | products : product_id , product_type_code , product_name , product_price | parties : party_id , party_details | assets : asset_id , other_details | channels : channel_id , other_details | finances : finance_id , other_details | events : event_id , address_id , channel_id , event_type_code , finance_id , location_id | products_in_events : product_in_event_id , event_id , product_id | parties_in_events : party_id , event_id , role_code | agreements : document_id , event_id | assets_in_events : asset_id , event_id | events.finance_id = finances.finance_id | events.address_id = addresses.address_id | events.location_id = locations.location_id | products_in_events.product_id = products.product_id | products_in_events.event_id = events.event_id | parties_in_events.event_id = events.event_id | parties_in_events.party_id = parties.party_id | agreements.event_id = events.event_id | assets_in_events.event_id = events.event_id | assets_in_events.event_id = events.event_id | 

### Response:

select products.product_name , count ( * ) from products join products_in_events on products.product_id = products_in_events.product_id group by products.product_name

### Instruction:

Convert text to sql: Show the names of products and the number of events they are in, sorted by the number of events in descending order. | addresses : address_id , address_details | locations : location_id , other_details | products : product_id , product_type_code , product_name , product_price | parties : party_id , party_details | assets : asset_id , other_details | channels : channel_id , other_details | finances : finance_id , other_details | events : event_id , address_id , channel_id , event_type_code , finance_id , location_id | products_in_events : product_in_event_id , event_id , product_id | parties_in_events : party_id , event_id , role_code | agreements : document_id , event_id | assets_in_events : asset_id , event_id | events.finance_id = finances.finance_id | events.address_id = addresses.address_id | events.location_id = locations.location_id | products_in_events.product_id = products.product_id | products_in_events.event_id = events.event_id | parties_in_events.event_id = events.event_id | parties_in_events.party_id = parties.party_id | agreements.event_id = events.event_id | assets_in_events.event_id = events.event_id | assets_in_events.event_id = events.event_id | 

### Response:

select products.product_name , count ( * ) from products join products_in_events on products.product_id = products_in_events.product_id group by products.product_name order by count ( * ) desc
### Instruction:

Convert text to sql: Show the names of products that are in at least two events. | addresses : address_id , address_details | locations : location_id , other_details | products : product_id , product_type_code , product_name , product_price | parties : party_id , party_details | assets : asset_id , other_details | channels : channel_id , other_details | finances : finance_id , other_details | events : event_id , address_id , channel_id , event_type_code , finance_id , location_id | products_in_events : product_in_event_id , event_id , product_id | parties_in_events : party_id , event_id , role_code | agreements : document_id , event_id | assets_in_events : asset_id , event_id | events.finance_id = finances.finance_id | events.address_id = addresses.address_id | events.location_id = locations.location_id | products_in_events.product_id = products.product_id | products_in_events.event_id = events.event_id | parties_in_events.event_id = events.event_id | parties_in_events.party_id = parties.party_id | agreements.event_id = events.event_id | assets_in_events.event_id = events.event_id | assets_in_events.event_id = events.event_id | 

### Response:

select products.product_name from products join products_in_events on products.product_id = products_in_events.product_id group by products.product_name having count ( * ) >= 2

### Instruction:

Convert text to sql: Show the names of products that are in at least two events in ascending alphabetical order of product name. | addresses : address_id , address_details | locations : location_id , other_details | products : product_id , product_type_code , product_name , product_price | parties : party_id , party_details | assets : asset_id , other_details | channels : channel_id , other_details | finances : finance_id , other_details | events : event_id , address_id , channel_id , event_type_code , finance_id , location_id | products_in_events : product_in_event_id , event_id , product_id | parties_in_events : party_id , event_id , role_code | agreements : document_id , event_id | assets_in_events : asset_id , event_id | events.finance_id = finances.finance_id | events.address_id = addresses.address_id | events.location_id = locations.location_id | products_in_events.product_id = products.product_id | products_in_events.event_id = events.event_id | parties_in_events.event_id = events.event_id | parties_in_events.party_id = parties.party_id | agreements.event_id = events.event_id | assets_in_events.event_id = events.event_id | assets_in_events.event_id = events.event_id | 

### Response:

select products.product_name from products join products_in_events on products.product_id = products_in_events.product_id group by products.product_name having count ( * ) >= 2 order by products.product_name asc
### Instruction:

Convert text to sql: List the names of products that are not in any event. | addresses : address_id , address_details | locations : location_id , other_details | products : product_id , product_type_code , product_name , product_price | parties : party_id , party_details | assets : asset_id , other_details | channels : channel_id , other_details | finances : finance_id , other_details | events : event_id , address_id , channel_id , event_type_code , finance_id , location_id | products_in_events : product_in_event_id , event_id , product_id | parties_in_events : party_id , event_id , role_code | agreements : document_id , event_id | assets_in_events : asset_id , event_id | events.finance_id = finances.finance_id | events.address_id = addresses.address_id | events.location_id = locations.location_id | products_in_events.product_id = products.product_id | products_in_events.event_id = events.event_id | parties_in_events.event_id = events.event_id | parties_in_events.party_id = parties.party_id | agreements.event_id = events.event_id | assets_in_events.event_id = events.event_id | assets_in_events.event_id = events.event_id | 

### Response:

select product_name from products where product_id not in ( select product_id from products_in_events )