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

Convert text to sql: What are the positions with both players having more than 20 points and less than 10 points. | club : club_id , name , region , start_year | club_rank : rank , club_id , gold , silver , bronze , total | player : player_id , name , position , club_id , apps , tries , goals , points | competition : competition_id , year , competition_type , country | competition_result : competition_id , club_id_1 , club_id_2 , score | club_rank.club_id = club.club_id | player.club_id = club.club_id | competition_result.competition_id = competition.competition_id | competition_result.club_id_2 = club.club_id | competition_result.club_id_1 = club.club_id | 

### Response:

select position from player where points > 20 intersect select position from player where points < 10

### Instruction:

Convert text to sql: What are the positions of both players that have more than 20 20 points and less than 10 points? | club : club_id , name , region , start_year | club_rank : rank , club_id , gold , silver , bronze , total | player : player_id , name , position , club_id , apps , tries , goals , points | competition : competition_id , year , competition_type , country | competition_result : competition_id , club_id_1 , club_id_2 , score | club_rank.club_id = club.club_id | player.club_id = club.club_id | competition_result.competition_id = competition.competition_id | competition_result.club_id_2 = club.club_id | competition_result.club_id_1 = club.club_id | 

### Response:

select position from player where points > 20 intersect select position from player where points < 10

### Instruction:

Convert text to sql: Show total points of all players. | club : club_id , name , region , start_year | club_rank : rank , club_id , gold , silver , bronze , total | player : player_id , name , position , club_id , apps , tries , goals , points | competition : competition_id , year , competition_type , country | competition_result : competition_id , club_id_1 , club_id_2 , score | club_rank.club_id = club.club_id | player.club_id = club.club_id | competition_result.competition_id = competition.competition_id | competition_result.club_id_2 = club.club_id | competition_result.club_id_1 = club.club_id | 

### Response:

select sum ( points ) from player

### Instruction:

Convert text to sql: What is the total number of points for all players? | club : club_id , name , region , start_year | club_rank : rank , club_id , gold , silver , bronze , total | player : player_id , name , position , club_id , apps , tries , goals , points | competition : competition_id , year , competition_type , country | competition_result : competition_id , club_id_1 , club_id_2 , score | club_rank.club_id = club.club_id | player.club_id = club.club_id | competition_result.competition_id = competition.competition_id | competition_result.club_id_2 = club.club_id | competition_result.club_id_1 = club.club_id | 

### Response:

select sum ( points ) from player
### Instruction:

Convert text to sql: how many different positions are there? | club : club_id , name , region , start_year | club_rank : rank , club_id , gold , silver , bronze , total | player : player_id , name , position , club_id , apps , tries , goals , points | competition : competition_id , year , competition_type , country | competition_result : competition_id , club_id_1 , club_id_2 , score | club_rank.club_id = club.club_id | player.club_id = club.club_id | competition_result.competition_id = competition.competition_id | competition_result.club_id_2 = club.club_id | competition_result.club_id_1 = club.club_id | 

### Response:

select count ( distinct position ) from player

### Instruction:

Convert text to sql: How many different position for players are listed? | club : club_id , name , region , start_year | club_rank : rank , club_id , gold , silver , bronze , total | player : player_id , name , position , club_id , apps , tries , goals , points | competition : competition_id , year , competition_type , country | competition_result : competition_id , club_id_1 , club_id_2 , score | club_rank.club_id = club.club_id | player.club_id = club.club_id | competition_result.competition_id = competition.competition_id | competition_result.club_id_2 = club.club_id | competition_result.club_id_1 = club.club_id | 

### Response:

select count ( distinct position ) from player

### Instruction:

Convert text to sql: what are the name of players who get more than the average points. | club : club_id , name , region , start_year | club_rank : rank , club_id , gold , silver , bronze , total | player : player_id , name , position , club_id , apps , tries , goals , points | competition : competition_id , year , competition_type , country | competition_result : competition_id , club_id_1 , club_id_2 , score | club_rank.club_id = club.club_id | player.club_id = club.club_id | competition_result.competition_id = competition.competition_id | competition_result.club_id_2 = club.club_id | competition_result.club_id_1 = club.club_id | 

### Response:

select name from player where points > ( select avg ( points ) from player )

### Instruction:

Convert text to sql: What are the names of all players that got more than the average number of points? | club : club_id , name , region , start_year | club_rank : rank , club_id , gold , silver , bronze , total | player : player_id , name , position , club_id , apps , tries , goals , points | competition : competition_id , year , competition_type , country | competition_result : competition_id , club_id_1 , club_id_2 , score | club_rank.club_id = club.club_id | player.club_id = club.club_id | competition_result.competition_id = competition.competition_id | competition_result.club_id_2 = club.club_id | competition_result.club_id_1 = club.club_id | 

### Response:

select name from player where points > ( select avg ( points ) from player )
### Instruction:

Convert text to sql: find the number of players whose points are lower than 30 in each position. | club : club_id , name , region , start_year | club_rank : rank , club_id , gold , silver , bronze , total | player : player_id , name , position , club_id , apps , tries , goals , points | competition : competition_id , year , competition_type , country | competition_result : competition_id , club_id_1 , club_id_2 , score | club_rank.club_id = club.club_id | player.club_id = club.club_id | competition_result.competition_id = competition.competition_id | competition_result.club_id_2 = club.club_id | competition_result.club_id_1 = club.club_id | 

### Response:

select count ( * ) , position from player where points < 30 group by position

### Instruction:

Convert text to sql: What is the number of players who have points less than 30 for each position? | club : club_id , name , region , start_year | club_rank : rank , club_id , gold , silver , bronze , total | player : player_id , name , position , club_id , apps , tries , goals , points | competition : competition_id , year , competition_type , country | competition_result : competition_id , club_id_1 , club_id_2 , score | club_rank.club_id = club.club_id | player.club_id = club.club_id | competition_result.competition_id = competition.competition_id | competition_result.club_id_2 = club.club_id | competition_result.club_id_1 = club.club_id | 

### Response:

select count ( * ) , position from player where points < 30 group by position

### Instruction:

Convert text to sql: which country did participated in the most number of Tournament competitions? | club : club_id , name , region , start_year | club_rank : rank , club_id , gold , silver , bronze , total | player : player_id , name , position , club_id , apps , tries , goals , points | competition : competition_id , year , competition_type , country | competition_result : competition_id , club_id_1 , club_id_2 , score | club_rank.club_id = club.club_id | player.club_id = club.club_id | competition_result.competition_id = competition.competition_id | competition_result.club_id_2 = club.club_id | competition_result.club_id_1 = club.club_id | 

### Response:

select country from competition where competition_type = 'Tournament' group by country order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: what is the name of the country that participated in the most tournament competitions? | club : club_id , name , region , start_year | club_rank : rank , club_id , gold , silver , bronze , total | player : player_id , name , position , club_id , apps , tries , goals , points | competition : competition_id , year , competition_type , country | competition_result : competition_id , club_id_1 , club_id_2 , score | club_rank.club_id = club.club_id | player.club_id = club.club_id | competition_result.competition_id = competition.competition_id | competition_result.club_id_2 = club.club_id | competition_result.club_id_1 = club.club_id | 

### Response:

select country from competition where competition_type = 'Tournament' group by country order by count ( * ) desc limit 1
### Instruction:

Convert text to sql: which countries did participated in both Friendly and Tournament type competitions. | club : club_id , name , region , start_year | club_rank : rank , club_id , gold , silver , bronze , total | player : player_id , name , position , club_id , apps , tries , goals , points | competition : competition_id , year , competition_type , country | competition_result : competition_id , club_id_1 , club_id_2 , score | club_rank.club_id = club.club_id | player.club_id = club.club_id | competition_result.competition_id = competition.competition_id | competition_result.club_id_2 = club.club_id | competition_result.club_id_1 = club.club_id | 

### Response:

select country from competition where competition_type = 'Friendly' intersect select country from competition where competition_type = 'Tournament'

### Instruction:

Convert text to sql: What are the countries that participated in both friendly and tournament type competitions? | club : club_id , name , region , start_year | club_rank : rank , club_id , gold , silver , bronze , total | player : player_id , name , position , club_id , apps , tries , goals , points | competition : competition_id , year , competition_type , country | competition_result : competition_id , club_id_1 , club_id_2 , score | club_rank.club_id = club.club_id | player.club_id = club.club_id | competition_result.competition_id = competition.competition_id | competition_result.club_id_2 = club.club_id | competition_result.club_id_1 = club.club_id | 

### Response:

select country from competition where competition_type = 'Friendly' intersect select country from competition where competition_type = 'Tournament'

### Instruction:

Convert text to sql: Find the countries that have never participated in any competition with Friendly type. | club : club_id , name , region , start_year | club_rank : rank , club_id , gold , silver , bronze , total | player : player_id , name , position , club_id , apps , tries , goals , points | competition : competition_id , year , competition_type , country | competition_result : competition_id , club_id_1 , club_id_2 , score | club_rank.club_id = club.club_id | player.club_id = club.club_id | competition_result.competition_id = competition.competition_id | competition_result.club_id_2 = club.club_id | competition_result.club_id_1 = club.club_id | 

### Response:

select country from competition except select country from competition where competition_type = 'Friendly'
### Instruction:

Convert text to sql: What are the countries that have never participated in any friendly-type competitions? | club : club_id , name , region , start_year | club_rank : rank , club_id , gold , silver , bronze , total | player : player_id , name , position , club_id , apps , tries , goals , points | competition : competition_id , year , competition_type , country | competition_result : competition_id , club_id_1 , club_id_2 , score | club_rank.club_id = club.club_id | player.club_id = club.club_id | competition_result.competition_id = competition.competition_id | competition_result.club_id_2 = club.club_id | competition_result.club_id_1 = club.club_id | 

### Response:

select country from competition except select country from competition where competition_type = 'Friendly'
### Instruction:

Convert text to sql: How many furniture components are there in total? | manufacturer : manufacturer_id , open_year , name , num_of_factories , num_of_shops | furniture : furniture_id , name , num_of_component , market_rate | furniture_manufacte : manufacturer_id , furniture_id , price_in_dollar | furniture_manufacte.furniture_id = furniture.furniture_id | furniture_manufacte.manufacturer_id = manufacturer.manufacturer_id | 

### Response:

select sum ( num_of_component ) from furniture

### Instruction:

Convert text to sql: Return the name and id of the furniture with the highest market rate. | manufacturer : manufacturer_id , open_year , name , num_of_factories , num_of_shops | furniture : furniture_id , name , num_of_component , market_rate | furniture_manufacte : manufacturer_id , furniture_id , price_in_dollar | furniture_manufacte.furniture_id = furniture.furniture_id | furniture_manufacte.manufacturer_id = manufacturer.manufacturer_id | 

### Response:

select name , furniture_id from furniture order by market_rate desc limit 1

### Instruction:

Convert text to sql: find the total market rate of the furnitures that have the top 2 market shares. | manufacturer : manufacturer_id , open_year , name , num_of_factories , num_of_shops | furniture : furniture_id , name , num_of_component , market_rate | furniture_manufacte : manufacturer_id , furniture_id , price_in_dollar | furniture_manufacte.furniture_id = furniture.furniture_id | furniture_manufacte.manufacturer_id = manufacturer.manufacturer_id | 

### Response:

select sum ( market_rate ) from furniture order by market_rate desc limit 2

### Instruction:

Convert text to sql: Find the component amounts and names of all furnitures that have more than 10 components. | manufacturer : manufacturer_id , open_year , name , num_of_factories , num_of_shops | furniture : furniture_id , name , num_of_component , market_rate | furniture_manufacte : manufacturer_id , furniture_id , price_in_dollar | furniture_manufacte.furniture_id = furniture.furniture_id | furniture_manufacte.manufacturer_id = manufacturer.manufacturer_id | 

### Response:

select num_of_component , name from furniture where num_of_component > 10

### Instruction:

Convert text to sql: Find the name and component amount of the least popular furniture. | manufacturer : manufacturer_id , open_year , name , num_of_factories , num_of_shops | furniture : furniture_id , name , num_of_component , market_rate | furniture_manufacte : manufacturer_id , furniture_id , price_in_dollar | furniture_manufacte.furniture_id = furniture.furniture_id | furniture_manufacte.manufacturer_id = manufacturer.manufacturer_id | 

### Response:

select name , num_of_component from furniture order by market_rate asc limit 1
### Instruction:

Convert text to sql: Find the names of furnitures whose prices are lower than the highest price. | manufacturer : manufacturer_id , open_year , name , num_of_factories , num_of_shops | furniture : furniture_id , name , num_of_component , market_rate | furniture_manufacte : manufacturer_id , furniture_id , price_in_dollar | furniture_manufacte.furniture_id = furniture.furniture_id | furniture_manufacte.manufacturer_id = manufacturer.manufacturer_id | 

### Response:

select furniture.name from furniture join furniture_manufacte on furniture.furniture_id = furniture_manufacte.furniture_id where furniture_manufacte.price_in_dollar < ( select max ( price_in_dollar ) from furniture_manufacte )

### Instruction:

Convert text to sql: Which manufacturer has the most number of shops? List its name and year of opening. | manufacturer : manufacturer_id , open_year , name , num_of_factories , num_of_shops | furniture : furniture_id , name , num_of_component , market_rate | furniture_manufacte : manufacturer_id , furniture_id , price_in_dollar | furniture_manufacte.furniture_id = furniture.furniture_id | furniture_manufacte.manufacturer_id = manufacturer.manufacturer_id | 

### Response:

select open_year , name from manufacturer order by num_of_shops desc limit 1

### Instruction:

Convert text to sql: Find the average number of factories for the manufacturers that have more than 20 shops. | manufacturer : manufacturer_id , open_year , name , num_of_factories , num_of_shops | furniture : furniture_id , name , num_of_component , market_rate | furniture_manufacte : manufacturer_id , furniture_id , price_in_dollar | furniture_manufacte.furniture_id = furniture.furniture_id | furniture_manufacte.manufacturer_id = manufacturer.manufacturer_id | 

### Response:

select avg ( num_of_factories ) from manufacturer where num_of_shops > 20

### Instruction:

Convert text to sql: List all manufacturer names and ids ordered by their opening year. | manufacturer : manufacturer_id , open_year , name , num_of_factories , num_of_shops | furniture : furniture_id , name , num_of_component , market_rate | furniture_manufacte : manufacturer_id , furniture_id , price_in_dollar | furniture_manufacte.furniture_id = furniture.furniture_id | furniture_manufacte.manufacturer_id = manufacturer.manufacturer_id | 

### Response:

select name , manufacturer_id from manufacturer order by open_year asc

### Instruction:

Convert text to sql: Give me the name and year of opening of the manufacturers that have either less than 10 factories or more than 10 shops. | manufacturer : manufacturer_id , open_year , name , num_of_factories , num_of_shops | furniture : furniture_id , name , num_of_component , market_rate | furniture_manufacte : manufacturer_id , furniture_id , price_in_dollar | furniture_manufacte.furniture_id = furniture.furniture_id | furniture_manufacte.manufacturer_id = manufacturer.manufacturer_id | 

### Response:

select name , open_year from manufacturer where num_of_shops > 10 or num_of_factories < 10
### Instruction:

Convert text to sql: what is the average number of factories and maximum number of shops for manufacturers that opened before 1990. | manufacturer : manufacturer_id , open_year , name , num_of_factories , num_of_shops | furniture : furniture_id , name , num_of_component , market_rate | furniture_manufacte : manufacturer_id , furniture_id , price_in_dollar | furniture_manufacte.furniture_id = furniture.furniture_id | furniture_manufacte.manufacturer_id = manufacturer.manufacturer_id | 

### Response:

select max ( num_of_shops ) , avg ( num_of_factories ) from manufacturer where open_year < 1990

### Instruction:

Convert text to sql: Find the id and number of shops for the company that produces the most expensive furniture. | manufacturer : manufacturer_id , open_year , name , num_of_factories , num_of_shops | furniture : furniture_id , name , num_of_component , market_rate | furniture_manufacte : manufacturer_id , furniture_id , price_in_dollar | furniture_manufacte.furniture_id = furniture.furniture_id | furniture_manufacte.manufacturer_id = manufacturer.manufacturer_id | 

### Response:

select manufacturer.manufacturer_id , manufacturer.num_of_shops from manufacturer join furniture_manufacte on manufacturer.manufacturer_id = furniture_manufacte.manufacturer_id order by furniture_manufacte.price_in_dollar desc limit 1

### Instruction:

Convert text to sql: Find the number of funiture types produced by each manufacturer as well as the company names. | manufacturer : manufacturer_id , open_year , name , num_of_factories , num_of_shops | furniture : furniture_id , name , num_of_component , market_rate | furniture_manufacte : manufacturer_id , furniture_id , price_in_dollar | furniture_manufacte.furniture_id = furniture.furniture_id | furniture_manufacte.manufacturer_id = manufacturer.manufacturer_id | 

### Response:

select count ( * ) , manufacturer.name from manufacturer join furniture_manufacte on manufacturer.manufacturer_id = furniture_manufacte.manufacturer_id group by manufacturer.manufacturer_id

### Instruction:

Convert text to sql: Give me the names and prices of furnitures which some companies are manufacturing. | manufacturer : manufacturer_id , open_year , name , num_of_factories , num_of_shops | furniture : furniture_id , name , num_of_component , market_rate | furniture_manufacte : manufacturer_id , furniture_id , price_in_dollar | furniture_manufacte.furniture_id = furniture.furniture_id | furniture_manufacte.manufacturer_id = manufacturer.manufacturer_id | 

### Response:

select furniture.name , furniture_manufacte.price_in_dollar from furniture join furniture_manufacte on furniture.furniture_id = furniture_manufacte.furniture_id
### Instruction:

Convert text to sql: Find the market shares and names of furnitures which no any company is producing in our records. | manufacturer : manufacturer_id , open_year , name , num_of_factories , num_of_shops | furniture : furniture_id , name , num_of_component , market_rate | furniture_manufacte : manufacturer_id , furniture_id , price_in_dollar | furniture_manufacte.furniture_id = furniture.furniture_id | furniture_manufacte.manufacturer_id = manufacturer.manufacturer_id | 

### Response:

select market_rate , name from furniture where furniture_id not in ( select furniture_id from furniture_manufacte )

### Instruction:

Convert text to sql: Find the name of the company that produces both furnitures with less than 6 components and furnitures with more than 10 components. | manufacturer : manufacturer_id , open_year , name , num_of_factories , num_of_shops | furniture : furniture_id , name , num_of_component , market_rate | furniture_manufacte : manufacturer_id , furniture_id , price_in_dollar | furniture_manufacte.furniture_id = furniture.furniture_id | furniture_manufacte.manufacturer_id = manufacturer.manufacturer_id | 

### Response:

select manufacturer.name from furniture join furniture_manufacte on furniture.furniture_id = furniture_manufacte.furniture_id join manufacturer on furniture_manufacte.manufacturer_id = manufacturer.manufacturer_id where furniture.num_of_component < 6 intersect select manufacturer.name from furniture join furniture_manufacte on furniture.furniture_id = furniture_manufacte.furniture_id join manufacturer on furniture_manufacte.manufacturer_id = manufacturer.manufacturer_id where furniture.num_of_component > 10