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

Convert text to sql: Show the name and opening year for three churches that opened most recently. | people : people_id , name , country , is_male , age | church : church_id , name , organized_by , open_date , continuation_of | wedding : church_id , male_id , female_id , year | wedding.female_id = people.people_id | wedding.male_id = people.people_id | wedding.church_id = church.church_id | 

### Response:

select name , open_date from church order by open_date desc limit 3

### Instruction:

Convert text to sql: How many female people are older than 30 in our record? | people : people_id , name , country , is_male , age | church : church_id , name , organized_by , open_date , continuation_of | wedding : church_id , male_id , female_id , year | wedding.female_id = people.people_id | wedding.male_id = people.people_id | wedding.church_id = church.church_id | 

### Response:

select count ( * ) from people where is_male = 'F' and age > 30

### Instruction:

Convert text to sql: Show the country where people older than 30 and younger than 25 are from. | people : people_id , name , country , is_male , age | church : church_id , name , organized_by , open_date , continuation_of | wedding : church_id , male_id , female_id , year | wedding.female_id = people.people_id | wedding.male_id = people.people_id | wedding.church_id = church.church_id | 

### Response:

select country from people where age < 25 intersect select country from people where age > 30

### Instruction:

Convert text to sql: Show the minimum, maximum, and average age for all people. | people : people_id , name , country , is_male , age | church : church_id , name , organized_by , open_date , continuation_of | wedding : church_id , male_id , female_id , year | wedding.female_id = people.people_id | wedding.male_id = people.people_id | wedding.church_id = church.church_id | 

### Response:

select min ( age ) , max ( age ) , avg ( age ) from people

### Instruction:

Convert text to sql: Show the name and country for all people whose age is smaller than the average. | people : people_id , name , country , is_male , age | church : church_id , name , organized_by , open_date , continuation_of | wedding : church_id , male_id , female_id , year | wedding.female_id = people.people_id | wedding.male_id = people.people_id | wedding.church_id = church.church_id | 

### Response:

select name , country from people where age < ( select avg ( age ) from people )

### Instruction:

Convert text to sql: Show the pair of male and female names in all weddings after year 2014 | people : people_id , name , country , is_male , age | church : church_id , name , organized_by , open_date , continuation_of | wedding : church_id , male_id , female_id , year | wedding.female_id = people.people_id | wedding.male_id = people.people_id | wedding.church_id = church.church_id | 

### Response:

select people.name , people.name from wedding join people on wedding.male_id = people.people_id join people on wedding.female_id = people.people_id where wedding.year > 2014
### Instruction:

Convert text to sql: Show the name and age for all male people who don't have a wedding. | people : people_id , name , country , is_male , age | church : church_id , name , organized_by , open_date , continuation_of | wedding : church_id , male_id , female_id , year | wedding.female_id = people.people_id | wedding.male_id = people.people_id | wedding.church_id = church.church_id | 

### Response:

select name , age from people where is_male = 'T' and people_id not in ( select male_id from wedding )

### Instruction:

Convert text to sql: Show all church names except for those that had a wedding in year 2015. | people : people_id , name , country , is_male , age | church : church_id , name , organized_by , open_date , continuation_of | wedding : church_id , male_id , female_id , year | wedding.female_id = people.people_id | wedding.male_id = people.people_id | wedding.church_id = church.church_id | 

### Response:

select name from church except select church.name from church join wedding on church.church_id = wedding.church_id where wedding.year = 2015

### Instruction:

Convert text to sql: Show all church names that have hosted least two weddings. | people : people_id , name , country , is_male , age | church : church_id , name , organized_by , open_date , continuation_of | wedding : church_id , male_id , female_id , year | wedding.female_id = people.people_id | wedding.male_id = people.people_id | wedding.church_id = church.church_id | 

### Response:

select church.name from church join wedding on church.church_id = wedding.church_id group by church.church_id having count ( * ) >= 2

### Instruction:

Convert text to sql: Show the names for all females from Canada having a wedding in year 2016. | people : people_id , name , country , is_male , age | church : church_id , name , organized_by , open_date , continuation_of | wedding : church_id , male_id , female_id , year | wedding.female_id = people.people_id | wedding.male_id = people.people_id | wedding.church_id = church.church_id | 

### Response:

select people.name from wedding join people on wedding.female_id = people.people_id where wedding.year = 2016 and people.is_male = 'F' and people.country = 'Canada'

### Instruction:

Convert text to sql: How many weddings are there in year 2016? | people : people_id , name , country , is_male , age | church : church_id , name , organized_by , open_date , continuation_of | wedding : church_id , male_id , female_id , year | wedding.female_id = people.people_id | wedding.male_id = people.people_id | wedding.church_id = church.church_id | 

### Response:

select count ( * ) from wedding where year = 2016
### Instruction:

Convert text to sql: Show the church names for the weddings of all people older than 30. | people : people_id , name , country , is_male , age | church : church_id , name , organized_by , open_date , continuation_of | wedding : church_id , male_id , female_id , year | wedding.female_id = people.people_id | wedding.male_id = people.people_id | wedding.church_id = church.church_id | 

### Response:

select church.name from wedding join people on wedding.male_id = people.people_id join people on wedding.female_id = people.people_id join church on church.church_id = wedding.church_id where people.age > 30 or people.age > 30

### Instruction:

Convert text to sql: Show all countries and the number of people from each country. | people : people_id , name , country , is_male , age | church : church_id , name , organized_by , open_date , continuation_of | wedding : church_id , male_id , female_id , year | wedding.female_id = people.people_id | wedding.male_id = people.people_id | wedding.church_id = church.church_id | 

### Response:

select country , count ( * ) from people group by country

### Instruction:

Convert text to sql: How many churches have a wedding in year 2016? | people : people_id , name , country , is_male , age | church : church_id , name , organized_by , open_date , continuation_of | wedding : church_id , male_id , female_id , year | wedding.female_id = people.people_id | wedding.male_id = people.people_id | wedding.church_id = church.church_id | 

### Response:

select count ( distinct church_id ) from wedding where year = 2016
### Instruction:

Convert text to sql: How many artists do we have? | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id | 

### Response:

select count ( * ) from artist

### Instruction:

Convert text to sql: Count the number of artists. | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id | 

### Response:

select count ( * ) from artist

### Instruction:

Convert text to sql: Show all artist name, age, and country ordered by the yeared they joined. | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id | 

### Response:

select name , age , country from artist order by year_join asc

### Instruction:

Convert text to sql: What are the names, ages, and countries of artists, sorted by the year they joined? | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id | 

### Response:

select name , age , country from artist order by year_join asc

### Instruction:

Convert text to sql: What are all distinct country for artists? | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id | 

### Response:

select distinct country from artist

### Instruction:

Convert text to sql: Return the different countries for artists. | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id | 

### Response:

select distinct country from artist

### Instruction:

Convert text to sql: Show all artist names and the year joined who are not from United States. | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id | 

### Response:

select name , year_join from artist where country != 'United States'
### Instruction:

Convert text to sql: What are the names and year of joining for artists that do not have the country "United States"? | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id | 

### Response:

select name , year_join from artist where country != 'United States'

### Instruction:

Convert text to sql: How many artists are above age 46 and joined after 1990? | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id | 

### Response:

select count ( * ) from artist where age > 46 and year_join > 1990

### Instruction:

Convert text to sql: Count the number of artists who are older than 46 and joined after 1990. | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id | 

### Response:

select count ( * ) from artist where age > 46 and year_join > 1990

### Instruction:

Convert text to sql: What is the average and minimum age of all artists from United States. | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id | 

### Response:

select avg ( age ) , min ( age ) from artist where country = 'United States'

### Instruction:

Convert text to sql: Return the average and minimum ages across artists from the United States. | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id | 

### Response:

select avg ( age ) , min ( age ) from artist where country = 'United States'

### Instruction:

Convert text to sql: What is the name of the artist who joined latest? | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id | 

### Response:

select name from artist order by year_join desc limit 1
### Instruction:

Convert text to sql: Return the name of the artist who has the latest join year. | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id | 

### Response:

select name from artist order by year_join desc limit 1

### Instruction:

Convert text to sql: How many exhibition are there in year 2005 or after? | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id | 

### Response:

select count ( * ) from exhibition where year >= 2005

### Instruction:

Convert text to sql: Count the number of exhibitions that happened in or after 2005. | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id | 

### Response:

select count ( * ) from exhibition where year >= 2005

### Instruction:

Convert text to sql: Show theme and year for all exhibitions with ticket prices lower than 15. | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id | 

### Response:

select theme , year from exhibition where ticket_price < 15

### Instruction:

Convert text to sql: What are the theme and year for all exhibitions that have a ticket price under 15? | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id | 

### Response:

select theme , year from exhibition where ticket_price < 15

### Instruction:

Convert text to sql: Show all artist names and the number of exhibitions for each artist. | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id | 

### Response:

select artist.name , count ( * ) from exhibition join artist on exhibition.artist_id = artist.artist_id group by exhibition.artist_id
### Instruction:

Convert text to sql: How many exhibitions has each artist had? | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id | 

### Response:

select artist.name , count ( * ) from exhibition join artist on exhibition.artist_id = artist.artist_id group by exhibition.artist_id

### Instruction:

Convert text to sql: What is the name and country for the artist with most number of exhibitions? | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id | 

### Response:

select artist.name , artist.country from exhibition join artist on exhibition.artist_id = artist.artist_id group by exhibition.artist_id order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: Return the name and country corresponding to the artist who has had the most exhibitions. | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id | 

### Response:

select artist.name , artist.country from exhibition join artist on exhibition.artist_id = artist.artist_id group by exhibition.artist_id order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: Show names for artists without any exhibition. | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id | 

### Response:

select name from artist where artist_id not in ( select artist_id from exhibition )

### Instruction:

Convert text to sql: What are the names of artists that have not had any exhibitions? | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id | 

### Response:

select name from artist where artist_id not in ( select artist_id from exhibition )
### Instruction:

Convert text to sql: What is the theme and artist name for the exhibition with a ticket price higher than the average? | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id | 

### Response:

select exhibition.theme , artist.name from exhibition join artist on exhibition.artist_id = artist.artist_id where exhibition.ticket_price > ( select avg ( ticket_price ) from exhibition )

### Instruction:

Convert text to sql: Return the names of artists and the themes of their exhibitions that had a ticket price higher than average. | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id | 

### Response:

select exhibition.theme , artist.name from exhibition join artist on exhibition.artist_id = artist.artist_id where exhibition.ticket_price > ( select avg ( ticket_price ) from exhibition )

### Instruction:

Convert text to sql: Show the average, minimum, and maximum ticket prices for exhibitions for all years before 2009. | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id | 

### Response:

select avg ( ticket_price ) , min ( ticket_price ) , max ( ticket_price ) from exhibition where year < 2009

### Instruction:

Convert text to sql: What are the average, minimum, and maximum ticket prices for exhibitions that happened prior to 2009? | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id | 

### Response:

select avg ( ticket_price ) , min ( ticket_price ) , max ( ticket_price ) from exhibition where year < 2009

### Instruction:

Convert text to sql: Show theme and year for all exhibitions in an descending order of ticket price. | artist : artist_id , name , country , year_join , age | exhibition : exhibition_id , year , theme , artist_id , ticket_price | exhibition_record : exhibition_id , date , attendance | exhibition.artist_id = artist.artist_id | exhibition_record.exhibition_id = exhibition.exhibition_id | 

### Response:

select theme , year from exhibition order by ticket_price desc