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

Convert text to sql: Show all locations and the number of gas stations in each location ordered by the count. | 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 location , count ( * ) from gas_station group by location order by count ( * ) asc

### Instruction:

Convert text to sql: For each location, how many gas stations are there in order? | 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 location , count ( * ) from gas_station group by location order by count ( * ) asc

### Instruction:

Convert text to sql: Show all headquarters with both a company in banking industry and a company in Oil and gas. | 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' intersect select headquarters from company where main_industry = 'Oil and gas'

### Instruction:

Convert text to sql: What are the headquarters that have both a company in the banking and 'oil and gas' industries? | 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' intersect select headquarters from company where main_industry = 'Oil and gas'
### Instruction:

Convert text to sql: Show all headquarters without a company in 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 except select headquarters from company where main_industry = 'Banking'

### Instruction:

Convert text to sql: What are the headquarters without companies that are 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 except select headquarters from company where main_industry = 'Banking'

### Instruction:

Convert text to sql: Show the company name with the number of gas station. | 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.company , count ( * ) from station_company join company on station_company.company_id = company.company_id group by station_company.company_id

### Instruction:

Convert text to sql: For each company id, what are the companies and how many gas stations does each one operate? | 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.company , count ( * ) from station_company join company on station_company.company_id = company.company_id group by station_company.company_id
### Instruction:

Convert text to sql: Show company name and main industry without a gas station. | 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 company_id not in ( select company_id from station_company )

### Instruction:

Convert text to sql: What are the main industries of the companies without gas stations and what are the 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 company , main_industry from company where company_id not in ( select company_id from station_company )

### Instruction:

Convert text to sql: Show the manager name for gas stations belonging to the ExxonMobil 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 gas_station.manager_name from station_company join company on station_company.company_id = company.company_id join gas_station on station_company.station_id = gas_station.station_id where company.company = 'ExxonMobil'

### Instruction:

Convert text to sql: What are the names of the managers for gas stations that are operated by the ExxonMobil 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 gas_station.manager_name from station_company join company on station_company.company_id = company.company_id join gas_station on station_company.station_id = gas_station.station_id where company.company = 'ExxonMobil'
### Instruction:

Convert text to sql: Show all locations where a gas station for company with market value greater than 100 is located. | 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 gas_station.location from station_company join company on station_company.company_id = company.company_id join gas_station on station_company.station_id = gas_station.station_id where company.market_value > 100

### Instruction:

Convert text to sql: What are the locations that have gas stations owned by a company with a market value greater than 100? | 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 gas_station.location from station_company join company on station_company.company_id = company.company_id join gas_station on station_company.station_id = gas_station.station_id where company.market_value > 100

### Instruction:

Convert text to sql: Show the manager name with most number of gas stations opened after 2000. | 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 manager_name from gas_station where open_year > 2000 group by manager_name order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: What is the name of the manager with the most gas stations that opened after 2000? | 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 manager_name from gas_station where open_year > 2000 group by manager_name order by count ( * ) desc limit 1
### Instruction:

Convert text to sql: order all gas station locations by the 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 location from gas_station order by open_year asc

### Instruction:

Convert text to sql: What are the locations of all 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 location from gas_station order by open_year asc

### Instruction:

Convert text to sql: find the rank, company names, market values of the companies in the banking industry order by their sales and profits in billion. | 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 rank , company , market_value from company where main_industry = 'Banking' order by sales_billion asc , profits_billion

### Instruction:

Convert text to sql: What is the rank, company, and market value of every comapny in the banking industry ordered by sales and profits? | 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 rank , company , market_value from company where main_industry = 'Banking' order by sales_billion asc , profits_billion
### Instruction:

Convert text to sql: find the location and Representative name of the gas stations owned by the companies with top 3 Asset amounts. | 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 gas_station.location , gas_station.representative_name from station_company join company on station_company.company_id = company.company_id join gas_station on station_company.station_id = gas_station.station_id order by company.assets_billion desc limit 3

### Instruction:

Convert text to sql: What are the locations and representatives' names of the gas stations owned by the companies with the 3 largest amounts of assets? | 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 gas_station.location , gas_station.representative_name from station_company join company on station_company.company_id = company.company_id join gas_station on station_company.station_id = gas_station.station_id order by company.assets_billion desc limit 3
### Instruction:

Convert text to sql: How many regions do we have? | region : region_id , region_name , date , label , format , catalogue | party : party_id , minister , took_office , left_office , region_id , party_name | member : member_id , member_name , party_id , in_office | party_events : event_id , event_name , party_id , member_in_charge_id | party.region_id = region.region_id | member.party_id = party.party_id | party_events.member_in_charge_id = member.member_id | party_events.party_id = party.party_id | 

### Response:

select count ( * ) from region

### Instruction:

Convert text to sql: Count the number of regions. | region : region_id , region_name , date , label , format , catalogue | party : party_id , minister , took_office , left_office , region_id , party_name | member : member_id , member_name , party_id , in_office | party_events : event_id , event_name , party_id , member_in_charge_id | party.region_id = region.region_id | member.party_id = party.party_id | party_events.member_in_charge_id = member.member_id | party_events.party_id = party.party_id | 

### Response:

select count ( * ) from region

### Instruction:

Convert text to sql: Show all distinct region names ordered by their labels. | region : region_id , region_name , date , label , format , catalogue | party : party_id , minister , took_office , left_office , region_id , party_name | member : member_id , member_name , party_id , in_office | party_events : event_id , event_name , party_id , member_in_charge_id | party.region_id = region.region_id | member.party_id = party.party_id | party_events.member_in_charge_id = member.member_id | party_events.party_id = party.party_id | 

### Response:

select distinct region_name from region order by label asc

### Instruction:

Convert text to sql: What are the different region names, ordered by labels? | region : region_id , region_name , date , label , format , catalogue | party : party_id , minister , took_office , left_office , region_id , party_name | member : member_id , member_name , party_id , in_office | party_events : event_id , event_name , party_id , member_in_charge_id | party.region_id = region.region_id | member.party_id = party.party_id | party_events.member_in_charge_id = member.member_id | party_events.party_id = party.party_id | 

### Response:

select distinct region_name from region order by label asc

### Instruction:

Convert text to sql: How many parties do we have? | region : region_id , region_name , date , label , format , catalogue | party : party_id , minister , took_office , left_office , region_id , party_name | member : member_id , member_name , party_id , in_office | party_events : event_id , event_name , party_id , member_in_charge_id | party.region_id = region.region_id | member.party_id = party.party_id | party_events.member_in_charge_id = member.member_id | party_events.party_id = party.party_id | 

### Response:

select count ( distinct party_name ) from party
### Instruction:

Convert text to sql: Count the number of different parties. | region : region_id , region_name , date , label , format , catalogue | party : party_id , minister , took_office , left_office , region_id , party_name | member : member_id , member_name , party_id , in_office | party_events : event_id , event_name , party_id , member_in_charge_id | party.region_id = region.region_id | member.party_id = party.party_id | party_events.member_in_charge_id = member.member_id | party_events.party_id = party.party_id | 

### Response:

select count ( distinct party_name ) from party

### Instruction:

Convert text to sql: Show the ministers and the time they took and left office, listed by the time they left office. | region : region_id , region_name , date , label , format , catalogue | party : party_id , minister , took_office , left_office , region_id , party_name | member : member_id , member_name , party_id , in_office | party_events : event_id , event_name , party_id , member_in_charge_id | party.region_id = region.region_id | member.party_id = party.party_id | party_events.member_in_charge_id = member.member_id | party_events.party_id = party.party_id | 

### Response:

select minister , took_office , left_office from party order by left_office asc

### Instruction:

Convert text to sql: Who are the ministers, when did they take office, and when did they leave office, ordered by when they left office? | region : region_id , region_name , date , label , format , catalogue | party : party_id , minister , took_office , left_office , region_id , party_name | member : member_id , member_name , party_id , in_office | party_events : event_id , event_name , party_id , member_in_charge_id | party.region_id = region.region_id | member.party_id = party.party_id | party_events.member_in_charge_id = member.member_id | party_events.party_id = party.party_id | 

### Response:

select minister , took_office , left_office from party order by left_office asc

### Instruction:

Convert text to sql: Show the minister who took office after 1961 or before 1959. | region : region_id , region_name , date , label , format , catalogue | party : party_id , minister , took_office , left_office , region_id , party_name | member : member_id , member_name , party_id , in_office | party_events : event_id , event_name , party_id , member_in_charge_id | party.region_id = region.region_id | member.party_id = party.party_id | party_events.member_in_charge_id = member.member_id | party_events.party_id = party.party_id | 

### Response:

select minister from party where took_office > 1961 or took_office < 1959
### Instruction:

Convert text to sql: Who are the ministers who took office after 1961 or before 1959? | region : region_id , region_name , date , label , format , catalogue | party : party_id , minister , took_office , left_office , region_id , party_name | member : member_id , member_name , party_id , in_office | party_events : event_id , event_name , party_id , member_in_charge_id | party.region_id = region.region_id | member.party_id = party.party_id | party_events.member_in_charge_id = member.member_id | party_events.party_id = party.party_id | 

### Response:

select minister from party where took_office > 1961 or took_office < 1959

### Instruction:

Convert text to sql: Show all ministers who do not belong to Progress Party. | region : region_id , region_name , date , label , format , catalogue | party : party_id , minister , took_office , left_office , region_id , party_name | member : member_id , member_name , party_id , in_office | party_events : event_id , event_name , party_id , member_in_charge_id | party.region_id = region.region_id | member.party_id = party.party_id | party_events.member_in_charge_id = member.member_id | party_events.party_id = party.party_id | 

### Response:

select minister from party where party_name != 'Progress Party'

### Instruction:

Convert text to sql: Which ministers are not a part of the Progress Party? | region : region_id , region_name , date , label , format , catalogue | party : party_id , minister , took_office , left_office , region_id , party_name | member : member_id , member_name , party_id , in_office | party_events : event_id , event_name , party_id , member_in_charge_id | party.region_id = region.region_id | member.party_id = party.party_id | party_events.member_in_charge_id = member.member_id | party_events.party_id = party.party_id | 

### Response:

select minister from party where party_name != 'Progress Party'

### Instruction:

Convert text to sql: Show all ministers and parties they belong to in descending order of the time they took office. | region : region_id , region_name , date , label , format , catalogue | party : party_id , minister , took_office , left_office , region_id , party_name | member : member_id , member_name , party_id , in_office | party_events : event_id , event_name , party_id , member_in_charge_id | party.region_id = region.region_id | member.party_id = party.party_id | party_events.member_in_charge_id = member.member_id | party_events.party_id = party.party_id | 

### Response:

select minister , party_name from party order by took_office desc