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

Convert text to sql: Find the famous titles of artists that do not have any volume. | artist : artist_id , artist , age , famous_title , famous_release_date | volume : volume_id , volume_issue , issue_date , weeks_on_top , song , artist_id | music_festival : id , music_festival , date_of_ceremony , category , volume , result | volume.artist_id = artist.artist_id | music_festival.volume = volume.volume_id | 

### Response:

select famous_title from artist where artist_id not in ( select artist_id from volume )

### Instruction:

Convert text to sql: What are the famous titles of artists who do not have any volumes? | artist : artist_id , artist , age , famous_title , famous_release_date | volume : volume_id , volume_issue , issue_date , weeks_on_top , song , artist_id | music_festival : id , music_festival , date_of_ceremony , category , volume , result | volume.artist_id = artist.artist_id | music_festival.volume = volume.volume_id | 

### Response:

select famous_title from artist where artist_id not in ( select artist_id from volume )

### Instruction:

Convert text to sql: Show the famous titles of the artists with both volumes that lasted more than 2 weeks on top and volumes that lasted less than 2 weeks on top. | artist : artist_id , artist , age , famous_title , famous_release_date | volume : volume_id , volume_issue , issue_date , weeks_on_top , song , artist_id | music_festival : id , music_festival , date_of_ceremony , category , volume , result | volume.artist_id = artist.artist_id | music_festival.volume = volume.volume_id | 

### Response:

select artist.famous_title from artist join volume on artist.artist_id = volume.artist_id where volume.weeks_on_top > 2 intersect select artist.famous_title from artist join volume on artist.artist_id = volume.artist_id where volume.weeks_on_top < 2

### Instruction:

Convert text to sql: What are the famous titles of artists who have not only had volumes that spent more than 2 weeks on top but also volumes that spent less than 2 weeks on top? | artist : artist_id , artist , age , famous_title , famous_release_date | volume : volume_id , volume_issue , issue_date , weeks_on_top , song , artist_id | music_festival : id , music_festival , date_of_ceremony , category , volume , result | volume.artist_id = artist.artist_id | music_festival.volume = volume.volume_id | 

### Response:

select artist.famous_title from artist join volume on artist.artist_id = volume.artist_id where volume.weeks_on_top > 2 intersect select artist.famous_title from artist join volume on artist.artist_id = volume.artist_id where volume.weeks_on_top < 2
### Instruction:

Convert text to sql: What are the date of ceremony of music festivals with category "Best Song" and result "Awarded"? | artist : artist_id , artist , age , famous_title , famous_release_date | volume : volume_id , volume_issue , issue_date , weeks_on_top , song , artist_id | music_festival : id , music_festival , date_of_ceremony , category , volume , result | volume.artist_id = artist.artist_id | music_festival.volume = volume.volume_id | 

### Response:

select date_of_ceremony from music_festival where category = 'Best Song' and result = 'Awarded'

### Instruction:

Convert text to sql: Return the dates of ceremony corresponding to music festivals that had the category "Best Song" and result "Awarded". | artist : artist_id , artist , age , famous_title , famous_release_date | volume : volume_id , volume_issue , issue_date , weeks_on_top , song , artist_id | music_festival : id , music_festival , date_of_ceremony , category , volume , result | volume.artist_id = artist.artist_id | music_festival.volume = volume.volume_id | 

### Response:

select date_of_ceremony from music_festival where category = 'Best Song' and result = 'Awarded'

### Instruction:

Convert text to sql: What is the issue date of the volume with the minimum weeks on top? | artist : artist_id , artist , age , famous_title , famous_release_date | volume : volume_id , volume_issue , issue_date , weeks_on_top , song , artist_id | music_festival : id , music_festival , date_of_ceremony , category , volume , result | volume.artist_id = artist.artist_id | music_festival.volume = volume.volume_id | 

### Response:

select issue_date from volume order by weeks_on_top asc limit 1

### Instruction:

Convert text to sql: Return the issue date of the volume that has spent the fewest weeks on top. | artist : artist_id , artist , age , famous_title , famous_release_date | volume : volume_id , volume_issue , issue_date , weeks_on_top , song , artist_id | music_festival : id , music_festival , date_of_ceremony , category , volume , result | volume.artist_id = artist.artist_id | music_festival.volume = volume.volume_id | 

### Response:

select issue_date from volume order by weeks_on_top asc limit 1

### Instruction:

Convert text to sql: How many distinct artists have volumes? | artist : artist_id , artist , age , famous_title , famous_release_date | volume : volume_id , volume_issue , issue_date , weeks_on_top , song , artist_id | music_festival : id , music_festival , date_of_ceremony , category , volume , result | volume.artist_id = artist.artist_id | music_festival.volume = volume.volume_id | 

### Response:

select count ( distinct artist_id ) from volume

### Instruction:

Convert text to sql: Count the number of artists who have had volumes. | artist : artist_id , artist , age , famous_title , famous_release_date | volume : volume_id , volume_issue , issue_date , weeks_on_top , song , artist_id | music_festival : id , music_festival , date_of_ceremony , category , volume , result | volume.artist_id = artist.artist_id | music_festival.volume = volume.volume_id | 

### Response:

select count ( distinct artist_id ) from volume
### Instruction:

Convert text to sql: Please show the results of music festivals and the number of music festivals that have had each, ordered by this count. | artist : artist_id , artist , age , famous_title , famous_release_date | volume : volume_id , volume_issue , issue_date , weeks_on_top , song , artist_id | music_festival : id , music_festival , date_of_ceremony , category , volume , result | volume.artist_id = artist.artist_id | music_festival.volume = volume.volume_id | 

### Response:

select result , count ( * ) from music_festival group by result order by count ( * ) desc

### Instruction:

Convert text to sql: How many music festivals have had each kind of result, ordered descending by count? | artist : artist_id , artist , age , famous_title , famous_release_date | volume : volume_id , volume_issue , issue_date , weeks_on_top , song , artist_id | music_festival : id , music_festival , date_of_ceremony , category , volume , result | volume.artist_id = artist.artist_id | music_festival.volume = volume.volume_id | 

### Response:

select result , count ( * ) from music_festival group by result order by count ( * ) desc

### Instruction:

Convert text to sql: What are the issue dates of volumes associated with the artist aged 23 or younger? | artist : artist_id , artist , age , famous_title , famous_release_date | volume : volume_id , volume_issue , issue_date , weeks_on_top , song , artist_id | music_festival : id , music_festival , date_of_ceremony , category , volume , result | volume.artist_id = artist.artist_id | music_festival.volume = volume.volume_id | 

### Response:

select issue_date from artist join volume on artist.artist_id = volume.artist_id where artist.age <= 23

### Instruction:

Convert text to sql: Return the issue dates of volumes by artists who are at most 23 years old? | artist : artist_id , artist , age , famous_title , famous_release_date | volume : volume_id , volume_issue , issue_date , weeks_on_top , song , artist_id | music_festival : id , music_festival , date_of_ceremony , category , volume , result | volume.artist_id = artist.artist_id | music_festival.volume = volume.volume_id | 

### Response:

select issue_date from artist join volume on artist.artist_id = volume.artist_id where artist.age <= 23
### Instruction:

Convert text to sql: How many roller coasters are there? | roller_coaster : roller_coaster_id , name , park , country_id , length , height , speed , opened , status | country : country_id , name , population , area , languages | roller_coaster.country_id = country.country_id | 

### Response:

select count ( * ) from roller_coaster

### Instruction:

Convert text to sql: List the names of roller coasters by ascending order of length. | roller_coaster : roller_coaster_id , name , park , country_id , length , height , speed , opened , status | country : country_id , name , population , area , languages | roller_coaster.country_id = country.country_id | 

### Response:

select name from roller_coaster order by length asc

### Instruction:

Convert text to sql: What are the lengths and heights of roller coasters? | roller_coaster : roller_coaster_id , name , park , country_id , length , height , speed , opened , status | country : country_id , name , population , area , languages | roller_coaster.country_id = country.country_id | 

### Response:

select length , height from roller_coaster

### Instruction:

Convert text to sql: List the names of countries whose language is not "German". | roller_coaster : roller_coaster_id , name , park , country_id , length , height , speed , opened , status | country : country_id , name , population , area , languages | roller_coaster.country_id = country.country_id | 

### Response:

select name from country where languages != 'German'

### Instruction:

Convert text to sql: Show the statuses of roller coasters longer than 3300 or higher than 100. | roller_coaster : roller_coaster_id , name , park , country_id , length , height , speed , opened , status | country : country_id , name , population , area , languages | roller_coaster.country_id = country.country_id | 

### Response:

select status from roller_coaster where length > 3300 or height > 100

### Instruction:

Convert text to sql: What are the speeds of the longest roller coaster? | roller_coaster : roller_coaster_id , name , park , country_id , length , height , speed , opened , status | country : country_id , name , population , area , languages | roller_coaster.country_id = country.country_id | 

### Response:

select speed from roller_coaster order by length desc limit 1

### Instruction:

Convert text to sql: What is the average speed of roller coasters? | roller_coaster : roller_coaster_id , name , park , country_id , length , height , speed , opened , status | country : country_id , name , population , area , languages | roller_coaster.country_id = country.country_id | 

### Response:

select avg ( speed ) from roller_coaster

### Instruction:

Convert text to sql: Show the different statuses and the numbers of roller coasters for each status. | roller_coaster : roller_coaster_id , name , park , country_id , length , height , speed , opened , status | country : country_id , name , population , area , languages | roller_coaster.country_id = country.country_id | 

### Response:

select status , count ( * ) from roller_coaster group by status
### Instruction:

Convert text to sql: Please show the most common status of roller coasters. | roller_coaster : roller_coaster_id , name , park , country_id , length , height , speed , opened , status | country : country_id , name , population , area , languages | roller_coaster.country_id = country.country_id | 

### Response:

select status from roller_coaster group by status order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: List the status shared by more than two roller coaster. | roller_coaster : roller_coaster_id , name , park , country_id , length , height , speed , opened , status | country : country_id , name , population , area , languages | roller_coaster.country_id = country.country_id | 

### Response:

select status from roller_coaster group by status having count ( * ) > 2

### Instruction:

Convert text to sql: Show the park of the roller coaster with the highest speed. | roller_coaster : roller_coaster_id , name , park , country_id , length , height , speed , opened , status | country : country_id , name , population , area , languages | roller_coaster.country_id = country.country_id | 

### Response:

select park from roller_coaster order by speed desc limit 1

### Instruction:

Convert text to sql: Show the names of roller coasters and names of country they are in. | roller_coaster : roller_coaster_id , name , park , country_id , length , height , speed , opened , status | country : country_id , name , population , area , languages | roller_coaster.country_id = country.country_id | 

### Response:

select roller_coaster.name , country.name from country join roller_coaster on country.country_id = roller_coaster.country_id

### Instruction:

Convert text to sql: Show the names of countries that have more than one roller coaster. | roller_coaster : roller_coaster_id , name , park , country_id , length , height , speed , opened , status | country : country_id , name , population , area , languages | roller_coaster.country_id = country.country_id | 

### Response:

select country.name from country join roller_coaster on country.country_id = roller_coaster.country_id group by country.name having count ( * ) > 1

### Instruction:

Convert text to sql: Show the name and population of the country that has the highest roller coaster. | roller_coaster : roller_coaster_id , name , park , country_id , length , height , speed , opened , status | country : country_id , name , population , area , languages | roller_coaster.country_id = country.country_id | 

### Response:

select country.name , country.population from country join roller_coaster on country.country_id = roller_coaster.country_id order by roller_coaster.height desc limit 1
### Instruction:

Convert text to sql: Show the names of countries and the average speed of roller coasters from each country. | roller_coaster : roller_coaster_id , name , park , country_id , length , height , speed , opened , status | country : country_id , name , population , area , languages | roller_coaster.country_id = country.country_id | 

### Response:

select country.name , avg ( roller_coaster.speed ) from country join roller_coaster on country.country_id = roller_coaster.country_id group by country.name

### Instruction:

Convert text to sql: How many countries do not have an roller coaster longer than 3000? | roller_coaster : roller_coaster_id , name , park , country_id , length , height , speed , opened , status | country : country_id , name , population , area , languages | roller_coaster.country_id = country.country_id | 

### Response:

select count ( * ) from country where country_id not in ( select country_id from roller_coaster where length > 3000 )

### Instruction:

Convert text to sql: What are the country names, area and population which has both roller coasters with speed higher | roller_coaster : roller_coaster_id , name , park , country_id , length , height , speed , opened , status | country : country_id , name , population , area , languages | roller_coaster.country_id = country.country_id | 

### Response:

select country.name , country.area , country.population from country join roller_coaster on country.country_id = roller_coaster.country_id where roller_coaster.speed > 60 intersect select country.name , country.area , country.population from country join roller_coaster on country.country_id = roller_coaster.country_id where roller_coaster.speed < 55
### Instruction:

Convert text to sql: How many different captain ranks are there? | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select count ( distinct rank ) from captain

### Instruction:

Convert text to sql: Count the number of different ranks of captain. | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select count ( distinct rank ) from captain

### Instruction:

Convert text to sql: How many captains are in each rank? | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select count ( * ) , rank from captain group by rank

### Instruction:

Convert text to sql: Count the number of captains that have each rank. | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select count ( * ) , rank from captain group by rank

### Instruction:

Convert text to sql: How many captains with younger than 50 are in each rank? | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select count ( * ) , rank from captain where age < 50 group by rank

### Instruction:

Convert text to sql: Count the number of captains younger than 50 of each rank. | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select count ( * ) , rank from captain where age < 50 group by rank

### Instruction:

Convert text to sql: Sort all captain names by their ages from old to young. | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select name from captain order by age desc

### Instruction:

Convert text to sql: What are the names of captains, sorted by age descending? | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select name from captain order by age desc

### Instruction:

Convert text to sql: Find the name, class and rank of all captains. | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select name , class , rank from captain

### Instruction:

Convert text to sql: What are the names, classes, and ranks of all captains? | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select name , class , rank from captain
### Instruction:

Convert text to sql: Which rank is the most common among captains? | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select rank from captain group by rank order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: Return the rank for which there are the fewest captains. | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select rank from captain group by rank order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: Which classes have more than two captains? | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select class from captain group by class having count ( * ) > 2

### Instruction:

Convert text to sql: Give the classes that have more than two captains. | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select class from captain group by class having count ( * ) > 2

### Instruction:

Convert text to sql: Find the name of captains whose rank are either Midshipman or Lieutenant. | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select name from captain where rank = 'Midshipman' or rank = 'Lieutenant'

### Instruction:

Convert text to sql: What are the names of captains that have either the rank Midshipman or Lieutenant? | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select name from captain where rank = 'Midshipman' or rank = 'Lieutenant'

### Instruction:

Convert text to sql: What are the average and minimum age of captains in different class? | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select avg ( age ) , min ( age ) , class from captain group by class

### Instruction:

Convert text to sql: Return the average and minimum age of captains in each class. | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select avg ( age ) , min ( age ) , class from captain group by class

### Instruction:

Convert text to sql: Find the captain rank that has some captains in both Cutter and Armed schooner classes. | captain : captain_id , name , ship_id , age , class , rank | ship : ship_id , name , type , built_year , class , flag | captain.ship_id = ship.ship_id | 

### Response:

select rank from captain where class = 'Cutter' intersect select rank from captain where class = 'Armed schooner'