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

Convert text to sql: How many phones are there? | phone : name , phone_id , memory_in_g , carrier , price | market : market_id , district , num_of_employees , num_of_shops , ranking | phone_market : market_id , phone_id , num_of_stock | phone_market.phone_id = phone.phone_id | phone_market.market_id = market.market_id | 

### Response:

select count ( * ) from phone

### Instruction:

Convert text to sql: List the names of phones in ascending order of price. | phone : name , phone_id , memory_in_g , carrier , price | market : market_id , district , num_of_employees , num_of_shops , ranking | phone_market : market_id , phone_id , num_of_stock | phone_market.phone_id = phone.phone_id | phone_market.market_id = market.market_id | 

### Response:

select name from phone order by price asc

### Instruction:

Convert text to sql: What are the memories and carriers of phones? | phone : name , phone_id , memory_in_g , carrier , price | market : market_id , district , num_of_employees , num_of_shops , ranking | phone_market : market_id , phone_id , num_of_stock | phone_market.phone_id = phone.phone_id | phone_market.market_id = market.market_id | 

### Response:

select memory_in_g , carrier from phone

### Instruction:

Convert text to sql: List the distinct carriers of phones with memories bigger than 32. | phone : name , phone_id , memory_in_g , carrier , price | market : market_id , district , num_of_employees , num_of_shops , ranking | phone_market : market_id , phone_id , num_of_stock | phone_market.phone_id = phone.phone_id | phone_market.market_id = market.market_id | 

### Response:

select distinct carrier from phone where memory_in_g > 32

### Instruction:

Convert text to sql: Show the names of phones with carrier either "Sprint" or "TMobile". | phone : name , phone_id , memory_in_g , carrier , price | market : market_id , district , num_of_employees , num_of_shops , ranking | phone_market : market_id , phone_id , num_of_stock | phone_market.phone_id = phone.phone_id | phone_market.market_id = market.market_id | 

### Response:

select name from phone where carrier = 'Sprint' or carrier = 'TMobile'

### Instruction:

Convert text to sql: What is the carrier of the most expensive phone? | phone : name , phone_id , memory_in_g , carrier , price | market : market_id , district , num_of_employees , num_of_shops , ranking | phone_market : market_id , phone_id , num_of_stock | phone_market.phone_id = phone.phone_id | phone_market.market_id = market.market_id | 

### Response:

select carrier from phone order by price desc limit 1

### Instruction:

Convert text to sql: Show different carriers of phones together with the number of phones with each carrier. | phone : name , phone_id , memory_in_g , carrier , price | market : market_id , district , num_of_employees , num_of_shops , ranking | phone_market : market_id , phone_id , num_of_stock | phone_market.phone_id = phone.phone_id | phone_market.market_id = market.market_id | 

### Response:

select carrier , count ( * ) from phone group by carrier
### Instruction:

Convert text to sql: Show the most frequently used carrier of the phones. | phone : name , phone_id , memory_in_g , carrier , price | market : market_id , district , num_of_employees , num_of_shops , ranking | phone_market : market_id , phone_id , num_of_stock | phone_market.phone_id = phone.phone_id | phone_market.market_id = market.market_id | 

### Response:

select carrier from phone group by carrier order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: Show the carriers that have both phones with memory smaller than 32 and phones with memory bigger than 64. | phone : name , phone_id , memory_in_g , carrier , price | market : market_id , district , num_of_employees , num_of_shops , ranking | phone_market : market_id , phone_id , num_of_stock | phone_market.phone_id = phone.phone_id | phone_market.market_id = market.market_id | 

### Response:

select carrier from phone where memory_in_g < 32 intersect select carrier from phone where memory_in_g > 64

### Instruction:

Convert text to sql: Show the names of phones and the districts of markets they are on. | phone : name , phone_id , memory_in_g , carrier , price | market : market_id , district , num_of_employees , num_of_shops , ranking | phone_market : market_id , phone_id , num_of_stock | phone_market.phone_id = phone.phone_id | phone_market.market_id = market.market_id | 

### Response:

select phone.name , market.district from phone_market join market on phone_market.market_id = market.market_id join phone on phone_market.phone_id = phone.phone_id

### Instruction:

Convert text to sql: Show the names of phones and the districts of markets they are on, in ascending order of the ranking of the market. | phone : name , phone_id , memory_in_g , carrier , price | market : market_id , district , num_of_employees , num_of_shops , ranking | phone_market : market_id , phone_id , num_of_stock | phone_market.phone_id = phone.phone_id | phone_market.market_id = market.market_id | 

### Response:

select phone.name , market.district from phone_market join market on phone_market.market_id = market.market_id join phone on phone_market.phone_id = phone.phone_id order by market.ranking asc

### Instruction:

Convert text to sql: Show the names of phones that are on market with number of shops greater than 50. | phone : name , phone_id , memory_in_g , carrier , price | market : market_id , district , num_of_employees , num_of_shops , ranking | phone_market : market_id , phone_id , num_of_stock | phone_market.phone_id = phone.phone_id | phone_market.market_id = market.market_id | 

### Response:

select phone.name from phone_market join market on phone_market.market_id = market.market_id join phone on phone_market.phone_id = phone.phone_id where market.num_of_shops > 50
### Instruction:

Convert text to sql: For each phone, show its names and total number of stocks. | phone : name , phone_id , memory_in_g , carrier , price | market : market_id , district , num_of_employees , num_of_shops , ranking | phone_market : market_id , phone_id , num_of_stock | phone_market.phone_id = phone.phone_id | phone_market.market_id = market.market_id | 

### Response:

select phone.name , sum ( phone_market.num_of_stock ) from phone_market join phone on phone_market.phone_id = phone.phone_id group by phone.name

### Instruction:

Convert text to sql: Show the names of phones that have total number of stocks bigger than 2000, in descending order of the total number of stocks. | phone : name , phone_id , memory_in_g , carrier , price | market : market_id , district , num_of_employees , num_of_shops , ranking | phone_market : market_id , phone_id , num_of_stock | phone_market.phone_id = phone.phone_id | phone_market.market_id = market.market_id | 

### Response:

select phone.name from phone_market join phone on phone_market.phone_id = phone.phone_id group by phone.name having sum ( phone_market.num_of_stock ) >= 2000 order by sum ( phone_market.num_of_stock ) desc

### Instruction:

Convert text to sql: List the names of phones that are not on any market. | phone : name , phone_id , memory_in_g , carrier , price | market : market_id , district , num_of_employees , num_of_shops , ranking | phone_market : market_id , phone_id , num_of_stock | phone_market.phone_id = phone.phone_id | phone_market.market_id = market.market_id | 

### Response:

select name from phone where phone_id not in ( select phone_id from phone_market )
### Instruction:

Convert text to sql: How many gas companies are there? | company : company_id , rank , company , headquarters , main_industry , sales_billion , profits_billion , assets_billion , market_value | gas_station : station_id , open_year , location , manager_name , vice_manager_name , representative_name | station_company : station_id , company_id , rank_of_the_year | station_company.company_id = company.company_id | station_company.station_id = gas_station.station_id | 

### Response:

select count ( * ) from company

### Instruction:

Convert text to sql: What is the total number of companies? | company : company_id , rank , company , headquarters , main_industry , sales_billion , profits_billion , assets_billion , market_value | gas_station : station_id , open_year , location , manager_name , vice_manager_name , representative_name | station_company : station_id , company_id , rank_of_the_year | station_company.company_id = company.company_id | station_company.station_id = gas_station.station_id | 

### Response:

select count ( * ) from company

### Instruction:

Convert text to sql: List the company name and rank for all companies in the decreasing order of their sales. | company : company_id , rank , company , headquarters , main_industry , sales_billion , profits_billion , assets_billion , market_value | gas_station : station_id , open_year , location , manager_name , vice_manager_name , representative_name | station_company : station_id , company_id , rank_of_the_year | station_company.company_id = company.company_id | station_company.station_id = gas_station.station_id | 

### Response:

select company , rank from company order by sales_billion desc

### Instruction:

Convert text to sql: What is the name and rank of every company ordered by descending number of sales? | company : company_id , rank , company , headquarters , main_industry , sales_billion , profits_billion , assets_billion , market_value | gas_station : station_id , open_year , location , manager_name , vice_manager_name , representative_name | station_company : station_id , company_id , rank_of_the_year | station_company.company_id = company.company_id | station_company.station_id = gas_station.station_id | 

### Response:

select company , rank from company order by sales_billion desc

### Instruction:

Convert text to sql: Show the company name and the main industry for all companies whose headquarters are not from USA. | company : company_id , rank , company , headquarters , main_industry , sales_billion , profits_billion , assets_billion , market_value | gas_station : station_id , open_year , location , manager_name , vice_manager_name , representative_name | station_company : station_id , company_id , rank_of_the_year | station_company.company_id = company.company_id | station_company.station_id = gas_station.station_id | 

### Response:

select company , main_industry from company where headquarters != 'USA'
### Instruction:

Convert text to sql: What are the companies and main industries of all companies that are not headquartered in the United States? | company : company_id , rank , company , headquarters , main_industry , sales_billion , profits_billion , assets_billion , market_value | gas_station : station_id , open_year , location , manager_name , vice_manager_name , representative_name | station_company : station_id , company_id , rank_of_the_year | station_company.company_id = company.company_id | station_company.station_id = gas_station.station_id | 

### Response:

select company , main_industry from company where headquarters != 'USA'

### Instruction:

Convert text to sql: Show all company names and headquarters in the descending order of market value. | company : company_id , rank , company , headquarters , main_industry , sales_billion , profits_billion , assets_billion , market_value | gas_station : station_id , open_year , location , manager_name , vice_manager_name , representative_name | station_company : station_id , company_id , rank_of_the_year | station_company.company_id = company.company_id | station_company.station_id = gas_station.station_id | 

### Response:

select company , headquarters from company order by market_value desc

### Instruction:

Convert text to sql: What are the names and headquarters of all companies ordered by descending market value? | company : company_id , rank , company , headquarters , main_industry , sales_billion , profits_billion , assets_billion , market_value | gas_station : station_id , open_year , location , manager_name , vice_manager_name , representative_name | station_company : station_id , company_id , rank_of_the_year | station_company.company_id = company.company_id | station_company.station_id = gas_station.station_id | 

### Response:

select company , headquarters from company order by market_value desc

### Instruction:

Convert text to sql: Show minimum, maximum, and average market value for all companies. | company : company_id , rank , company , headquarters , main_industry , sales_billion , profits_billion , assets_billion , market_value | gas_station : station_id , open_year , location , manager_name , vice_manager_name , representative_name | station_company : station_id , company_id , rank_of_the_year | station_company.company_id = company.company_id | station_company.station_id = gas_station.station_id | 

### Response:

select min ( market_value ) , max ( market_value ) , avg ( market_value ) from company

### Instruction:

Convert text to sql: What is the minimum, maximum, and average market value for every company? | company : company_id , rank , company , headquarters , main_industry , sales_billion , profits_billion , assets_billion , market_value | gas_station : station_id , open_year , location , manager_name , vice_manager_name , representative_name | station_company : station_id , company_id , rank_of_the_year | station_company.company_id = company.company_id | station_company.station_id = gas_station.station_id | 

### Response:

select min ( market_value ) , max ( market_value ) , avg ( market_value ) from company
### Instruction:

Convert text to sql: Show all main industry for all companies. | company : company_id , rank , company , headquarters , main_industry , sales_billion , profits_billion , assets_billion , market_value | gas_station : station_id , open_year , location , manager_name , vice_manager_name , representative_name | station_company : station_id , company_id , rank_of_the_year | station_company.company_id = company.company_id | station_company.station_id = gas_station.station_id | 

### Response:

select distinct main_industry from company

### Instruction:

Convert text to sql: What are the different main industries for all companies? | company : company_id , rank , company , headquarters , main_industry , sales_billion , profits_billion , assets_billion , market_value | gas_station : station_id , open_year , location , manager_name , vice_manager_name , representative_name | station_company : station_id , company_id , rank_of_the_year | station_company.company_id = company.company_id | station_company.station_id = gas_station.station_id | 

### Response:

select distinct main_industry from company

### Instruction:

Convert text to sql: List all headquarters and the number of companies in each headquarter. | company : company_id , rank , company , headquarters , main_industry , sales_billion , profits_billion , assets_billion , market_value | gas_station : station_id , open_year , location , manager_name , vice_manager_name , representative_name | station_company : station_id , company_id , rank_of_the_year | station_company.company_id = company.company_id | station_company.station_id = gas_station.station_id | 

### Response:

select headquarters , count ( * ) from company group by headquarters

### Instruction:

Convert text to sql: For each headquarter, what are the headquarter and how many companies are centered there? | company : company_id , rank , company , headquarters , main_industry , sales_billion , profits_billion , assets_billion , market_value | gas_station : station_id , open_year , location , manager_name , vice_manager_name , representative_name | station_company : station_id , company_id , rank_of_the_year | station_company.company_id = company.company_id | station_company.station_id = gas_station.station_id | 

### Response:

select headquarters , count ( * ) from company group by headquarters

### Instruction:

Convert text to sql: Show all main industry and total market value in each industry. | company : company_id , rank , company , headquarters , main_industry , sales_billion , profits_billion , assets_billion , market_value | gas_station : station_id , open_year , location , manager_name , vice_manager_name , representative_name | station_company : station_id , company_id , rank_of_the_year | station_company.company_id = company.company_id | station_company.station_id = gas_station.station_id | 

### Response:

select main_industry , sum ( market_value ) from company group by main_industry
### Instruction:

Convert text to sql: What are the main indstries and total market value for each industry? | company : company_id , rank , company , headquarters , main_industry , sales_billion , profits_billion , assets_billion , market_value | gas_station : station_id , open_year , location , manager_name , vice_manager_name , representative_name | station_company : station_id , company_id , rank_of_the_year | station_company.company_id = company.company_id | station_company.station_id = gas_station.station_id | 

### Response:

select main_industry , sum ( market_value ) from company group by main_industry

### Instruction:

Convert text to sql: List the main industry with highest total market value and its number of companies. | company : company_id , rank , company , headquarters , main_industry , sales_billion , profits_billion , assets_billion , market_value | gas_station : station_id , open_year , location , manager_name , vice_manager_name , representative_name | station_company : station_id , company_id , rank_of_the_year | station_company.company_id = company.company_id | station_company.station_id = gas_station.station_id | 

### Response:

select main_industry , count ( * ) from company group by main_industry order by sum ( market_value ) desc limit 1

### Instruction:

Convert text to sql: For each main industry, what is the total number of companies for the industry with the highest total market value? | company : company_id , rank , company , headquarters , main_industry , sales_billion , profits_billion , assets_billion , market_value | gas_station : station_id , open_year , location , manager_name , vice_manager_name , representative_name | station_company : station_id , company_id , rank_of_the_year | station_company.company_id = company.company_id | station_company.station_id = gas_station.station_id | 

### Response:

select main_industry , count ( * ) from company group by main_industry order by sum ( market_value ) desc limit 1

### Instruction:

Convert text to sql: Show headquarters with at least two companies in the banking industry. | company : company_id , rank , company , headquarters , main_industry , sales_billion , profits_billion , assets_billion , market_value | gas_station : station_id , open_year , location , manager_name , vice_manager_name , representative_name | station_company : station_id , company_id , rank_of_the_year | station_company.company_id = company.company_id | station_company.station_id = gas_station.station_id | 

### Response:

select headquarters from company where main_industry = 'Banking' group by headquarters having count ( * ) >= 2
### Instruction:

Convert text to sql: What are the headquarters with at least two companies in the banking industry? | company : company_id , rank , company , headquarters , main_industry , sales_billion , profits_billion , assets_billion , market_value | gas_station : station_id , open_year , location , manager_name , vice_manager_name , representative_name | station_company : station_id , company_id , rank_of_the_year | station_company.company_id = company.company_id | station_company.station_id = gas_station.station_id | 

### Response:

select headquarters from company where main_industry = 'Banking' group by headquarters having count ( * ) >= 2

### Instruction:

Convert text to sql: Show gas station id, location, and manager_name for all gas stations ordered by open year. | company : company_id , rank , company , headquarters , main_industry , sales_billion , profits_billion , assets_billion , market_value | gas_station : station_id , open_year , location , manager_name , vice_manager_name , representative_name | station_company : station_id , company_id , rank_of_the_year | station_company.company_id = company.company_id | station_company.station_id = gas_station.station_id | 

### Response:

select station_id , location , manager_name from gas_station order by open_year asc

### Instruction:

Convert text to sql: What are the gas station ids, locations, and manager names for the gas stations ordered by opening year? | company : company_id , rank , company , headquarters , main_industry , sales_billion , profits_billion , assets_billion , market_value | gas_station : station_id , open_year , location , manager_name , vice_manager_name , representative_name | station_company : station_id , company_id , rank_of_the_year | station_company.company_id = company.company_id | station_company.station_id = gas_station.station_id | 

### Response:

select station_id , location , manager_name from gas_station order by open_year asc

### Instruction:

Convert text to sql: How many gas station are opened between 2000 and 2005? | company : company_id , rank , company , headquarters , main_industry , sales_billion , profits_billion , assets_billion , market_value | gas_station : station_id , open_year , location , manager_name , vice_manager_name , representative_name | station_company : station_id , company_id , rank_of_the_year | station_company.company_id = company.company_id | station_company.station_id = gas_station.station_id | 

### Response:

select count ( * ) from gas_station where open_year between 2000 and 2005

### Instruction:

Convert text to sql: What is the total number of gas stations that opened between 2000 and 2005? | company : company_id , rank , company , headquarters , main_industry , sales_billion , profits_billion , assets_billion , market_value | gas_station : station_id , open_year , location , manager_name , vice_manager_name , representative_name | station_company : station_id , company_id , rank_of_the_year | station_company.company_id = company.company_id | station_company.station_id = gas_station.station_id | 

### Response:

select count ( * ) from gas_station where open_year between 2000 and 2005