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

Convert text to sql: Show all member names and registered branch names sorted by register year. | member : member_id , card_number , name , hometown , level | branch : branch_id , name , open_year , address_road , city , membership_amount | membership_register_branch : member_id , branch_id , register_year | purchase : member_id , branch_id , year , total_pounds | membership_register_branch.branch_id = branch.branch_id | membership_register_branch.member_id = member.member_id | purchase.branch_id = branch.branch_id | purchase.member_id = member.member_id | 

### Response:

select member.name , branch.name from membership_register_branch join branch on membership_register_branch.branch_id = branch.branch_id join member on membership_register_branch.member_id = member.member_id order by membership_register_branch.register_year asc

### Instruction:

Convert text to sql: What are the names of the members and branches at which they are registered sorted by year of registration? | member : member_id , card_number , name , hometown , level | branch : branch_id , name , open_year , address_road , city , membership_amount | membership_register_branch : member_id , branch_id , register_year | purchase : member_id , branch_id , year , total_pounds | membership_register_branch.branch_id = branch.branch_id | membership_register_branch.member_id = member.member_id | purchase.branch_id = branch.branch_id | purchase.member_id = member.member_id | 

### Response:

select member.name , branch.name from membership_register_branch join branch on membership_register_branch.branch_id = branch.branch_id join member on membership_register_branch.member_id = member.member_id order by membership_register_branch.register_year asc

### Instruction:

Convert text to sql: Show all branch names with the number of members in each branch registered after 2015. | member : member_id , card_number , name , hometown , level | branch : branch_id , name , open_year , address_road , city , membership_amount | membership_register_branch : member_id , branch_id , register_year | purchase : member_id , branch_id , year , total_pounds | membership_register_branch.branch_id = branch.branch_id | membership_register_branch.member_id = member.member_id | purchase.branch_id = branch.branch_id | purchase.member_id = member.member_id | 

### Response:

select branch.name , count ( * ) from membership_register_branch join branch on membership_register_branch.branch_id = branch.branch_id where membership_register_branch.register_year > 2015 group by branch.branch_id
### Instruction:

Convert text to sql: For each branch id, what are the names of the branches that were registered after 2015? | member : member_id , card_number , name , hometown , level | branch : branch_id , name , open_year , address_road , city , membership_amount | membership_register_branch : member_id , branch_id , register_year | purchase : member_id , branch_id , year , total_pounds | membership_register_branch.branch_id = branch.branch_id | membership_register_branch.member_id = member.member_id | purchase.branch_id = branch.branch_id | purchase.member_id = member.member_id | 

### Response:

select branch.name , count ( * ) from membership_register_branch join branch on membership_register_branch.branch_id = branch.branch_id where membership_register_branch.register_year > 2015 group by branch.branch_id

### Instruction:

Convert text to sql: Show member names without any registered branch. | member : member_id , card_number , name , hometown , level | branch : branch_id , name , open_year , address_road , city , membership_amount | membership_register_branch : member_id , branch_id , register_year | purchase : member_id , branch_id , year , total_pounds | membership_register_branch.branch_id = branch.branch_id | membership_register_branch.member_id = member.member_id | purchase.branch_id = branch.branch_id | purchase.member_id = member.member_id | 

### Response:

select name from member where member_id not in ( select member_id from membership_register_branch )

### Instruction:

Convert text to sql: What are the names of the members that have never registered at any branch? | member : member_id , card_number , name , hometown , level | branch : branch_id , name , open_year , address_road , city , membership_amount | membership_register_branch : member_id , branch_id , register_year | purchase : member_id , branch_id , year , total_pounds | membership_register_branch.branch_id = branch.branch_id | membership_register_branch.member_id = member.member_id | purchase.branch_id = branch.branch_id | purchase.member_id = member.member_id | 

### Response:

select name from member where member_id not in ( select member_id from membership_register_branch )

### Instruction:

Convert text to sql: List the branch name and city without any registered members. | member : member_id , card_number , name , hometown , level | branch : branch_id , name , open_year , address_road , city , membership_amount | membership_register_branch : member_id , branch_id , register_year | purchase : member_id , branch_id , year , total_pounds | membership_register_branch.branch_id = branch.branch_id | membership_register_branch.member_id = member.member_id | purchase.branch_id = branch.branch_id | purchase.member_id = member.member_id | 

### Response:

select name , city from branch where branch_id not in ( select branch_id from membership_register_branch )
### Instruction:

Convert text to sql: What are the names and cities of the branches that do not have any registered members? | member : member_id , card_number , name , hometown , level | branch : branch_id , name , open_year , address_road , city , membership_amount | membership_register_branch : member_id , branch_id , register_year | purchase : member_id , branch_id , year , total_pounds | membership_register_branch.branch_id = branch.branch_id | membership_register_branch.member_id = member.member_id | purchase.branch_id = branch.branch_id | purchase.member_id = member.member_id | 

### Response:

select name , city from branch where branch_id not in ( select branch_id from membership_register_branch )

### Instruction:

Convert text to sql: What is the name and open year for the branch with most number of memberships registered in 2016? | member : member_id , card_number , name , hometown , level | branch : branch_id , name , open_year , address_road , city , membership_amount | membership_register_branch : member_id , branch_id , register_year | purchase : member_id , branch_id , year , total_pounds | membership_register_branch.branch_id = branch.branch_id | membership_register_branch.member_id = member.member_id | purchase.branch_id = branch.branch_id | purchase.member_id = member.member_id | 

### Response:

select branch.name , branch.open_year from membership_register_branch join branch on membership_register_branch.branch_id = branch.branch_id where membership_register_branch.register_year = 2016 group by branch.branch_id order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: What is the name and opening year for the branch that registered the most members in 2016? | member : member_id , card_number , name , hometown , level | branch : branch_id , name , open_year , address_road , city , membership_amount | membership_register_branch : member_id , branch_id , register_year | purchase : member_id , branch_id , year , total_pounds | membership_register_branch.branch_id = branch.branch_id | membership_register_branch.member_id = member.member_id | purchase.branch_id = branch.branch_id | purchase.member_id = member.member_id | 

### Response:

select branch.name , branch.open_year from membership_register_branch join branch on membership_register_branch.branch_id = branch.branch_id where membership_register_branch.register_year = 2016 group by branch.branch_id order by count ( * ) desc limit 1
### Instruction:

Convert text to sql: Show the member name and hometown who registered a branch in 2016. | member : member_id , card_number , name , hometown , level | branch : branch_id , name , open_year , address_road , city , membership_amount | membership_register_branch : member_id , branch_id , register_year | purchase : member_id , branch_id , year , total_pounds | membership_register_branch.branch_id = branch.branch_id | membership_register_branch.member_id = member.member_id | purchase.branch_id = branch.branch_id | purchase.member_id = member.member_id | 

### Response:

select member.name , member.hometown from membership_register_branch join member on membership_register_branch.member_id = member.member_id where membership_register_branch.register_year = 2016

### Instruction:

Convert text to sql: What are the member names and hometowns of those who registered at a branch in 2016? | member : member_id , card_number , name , hometown , level | branch : branch_id , name , open_year , address_road , city , membership_amount | membership_register_branch : member_id , branch_id , register_year | purchase : member_id , branch_id , year , total_pounds | membership_register_branch.branch_id = branch.branch_id | membership_register_branch.member_id = member.member_id | purchase.branch_id = branch.branch_id | purchase.member_id = member.member_id | 

### Response:

select member.name , member.hometown from membership_register_branch join member on membership_register_branch.member_id = member.member_id where membership_register_branch.register_year = 2016

### Instruction:

Convert text to sql: Show all city with a branch opened in 2001 and a branch with more than 100 membership. | member : member_id , card_number , name , hometown , level | branch : branch_id , name , open_year , address_road , city , membership_amount | membership_register_branch : member_id , branch_id , register_year | purchase : member_id , branch_id , year , total_pounds | membership_register_branch.branch_id = branch.branch_id | membership_register_branch.member_id = member.member_id | purchase.branch_id = branch.branch_id | purchase.member_id = member.member_id | 

### Response:

select city from branch where open_year = 2001 and membership_amount > 100

### Instruction:

Convert text to sql: What are the cities that have a branch that opened in 2001 and a branch with more than 100 members? | member : member_id , card_number , name , hometown , level | branch : branch_id , name , open_year , address_road , city , membership_amount | membership_register_branch : member_id , branch_id , register_year | purchase : member_id , branch_id , year , total_pounds | membership_register_branch.branch_id = branch.branch_id | membership_register_branch.member_id = member.member_id | purchase.branch_id = branch.branch_id | purchase.member_id = member.member_id | 

### Response:

select city from branch where open_year = 2001 and membership_amount > 100
### Instruction:

Convert text to sql: Show all cities without a branch having more than 100 memberships. | member : member_id , card_number , name , hometown , level | branch : branch_id , name , open_year , address_road , city , membership_amount | membership_register_branch : member_id , branch_id , register_year | purchase : member_id , branch_id , year , total_pounds | membership_register_branch.branch_id = branch.branch_id | membership_register_branch.member_id = member.member_id | purchase.branch_id = branch.branch_id | purchase.member_id = member.member_id | 

### Response:

select city from branch except select city from branch where membership_amount > 100

### Instruction:

Convert text to sql: What are the cities that do not have any branches with more than 100 members? | member : member_id , card_number , name , hometown , level | branch : branch_id , name , open_year , address_road , city , membership_amount | membership_register_branch : member_id , branch_id , register_year | purchase : member_id , branch_id , year , total_pounds | membership_register_branch.branch_id = branch.branch_id | membership_register_branch.member_id = member.member_id | purchase.branch_id = branch.branch_id | purchase.member_id = member.member_id | 

### Response:

select city from branch except select city from branch where membership_amount > 100

### Instruction:

Convert text to sql: What is the sum of total pounds of purchase in year 2018 for all branches in London? | member : member_id , card_number , name , hometown , level | branch : branch_id , name , open_year , address_road , city , membership_amount | membership_register_branch : member_id , branch_id , register_year | purchase : member_id , branch_id , year , total_pounds | membership_register_branch.branch_id = branch.branch_id | membership_register_branch.member_id = member.member_id | purchase.branch_id = branch.branch_id | purchase.member_id = member.member_id | 

### Response:

select sum ( total_pounds ) from purchase join branch on purchase.branch_id = branch.branch_id where branch.city = 'London' and purchase.year = 2018

### Instruction:

Convert text to sql: How many total pounds were purchased in the year 2018 at all London branches? | member : member_id , card_number , name , hometown , level | branch : branch_id , name , open_year , address_road , city , membership_amount | membership_register_branch : member_id , branch_id , register_year | purchase : member_id , branch_id , year , total_pounds | membership_register_branch.branch_id = branch.branch_id | membership_register_branch.member_id = member.member_id | purchase.branch_id = branch.branch_id | purchase.member_id = member.member_id | 

### Response:

select sum ( total_pounds ) from purchase join branch on purchase.branch_id = branch.branch_id where branch.city = 'London' and purchase.year = 2018
### Instruction:

Convert text to sql: What is the total number of purchases for members with level 6? | member : member_id , card_number , name , hometown , level | branch : branch_id , name , open_year , address_road , city , membership_amount | membership_register_branch : member_id , branch_id , register_year | purchase : member_id , branch_id , year , total_pounds | membership_register_branch.branch_id = branch.branch_id | membership_register_branch.member_id = member.member_id | purchase.branch_id = branch.branch_id | purchase.member_id = member.member_id | 

### Response:

select count ( * ) from purchase join member on purchase.member_id = member.member_id where member.level = 6

### Instruction:

Convert text to sql: What are the total purchases for members rated at level 6? | member : member_id , card_number , name , hometown , level | branch : branch_id , name , open_year , address_road , city , membership_amount | membership_register_branch : member_id , branch_id , register_year | purchase : member_id , branch_id , year , total_pounds | membership_register_branch.branch_id = branch.branch_id | membership_register_branch.member_id = member.member_id | purchase.branch_id = branch.branch_id | purchase.member_id = member.member_id | 

### Response:

select count ( * ) from purchase join member on purchase.member_id = member.member_id where member.level = 6

### Instruction:

Convert text to sql: Find the name of branches where have some members whose hometown is in Louisville, Kentucky and some in Hiram, Georgia. | member : member_id , card_number , name , hometown , level | branch : branch_id , name , open_year , address_road , city , membership_amount | membership_register_branch : member_id , branch_id , register_year | purchase : member_id , branch_id , year , total_pounds | membership_register_branch.branch_id = branch.branch_id | membership_register_branch.member_id = member.member_id | purchase.branch_id = branch.branch_id | purchase.member_id = member.member_id | 

### Response:

select branch.name from membership_register_branch join branch on membership_register_branch.branch_id = branch.branch_id join member on membership_register_branch.member_id = member.member_id where member.hometown = 'Louisville ,  Kentucky' intersect select branch.name from membership_register_branch join branch on membership_register_branch.branch_id = branch.branch_id join member on membership_register_branch.member_id = member.member_id where member.hometown = 'Hiram ,  Georgia'
### Instruction:

Convert text to sql: What are the names of the branches that have some members with a hometown in Louisville, Kentucky and also those from Hiram, Goergia? | member : member_id , card_number , name , hometown , level | branch : branch_id , name , open_year , address_road , city , membership_amount | membership_register_branch : member_id , branch_id , register_year | purchase : member_id , branch_id , year , total_pounds | membership_register_branch.branch_id = branch.branch_id | membership_register_branch.member_id = member.member_id | purchase.branch_id = branch.branch_id | purchase.member_id = member.member_id | 

### Response:

select branch.name from membership_register_branch join branch on membership_register_branch.branch_id = branch.branch_id join member on membership_register_branch.member_id = member.member_id where member.hometown = 'Louisville ,  Kentucky' intersect select branch.name from membership_register_branch join branch on membership_register_branch.branch_id = branch.branch_id join member on membership_register_branch.member_id = member.member_id where member.hometown = 'Hiram ,  Georgia'

### Instruction:

Convert text to sql: list the card number of all members whose hometown address includes word "Kentucky". | member : member_id , card_number , name , hometown , level | branch : branch_id , name , open_year , address_road , city , membership_amount | membership_register_branch : member_id , branch_id , register_year | purchase : member_id , branch_id , year , total_pounds | membership_register_branch.branch_id = branch.branch_id | membership_register_branch.member_id = member.member_id | purchase.branch_id = branch.branch_id | purchase.member_id = member.member_id | 

### Response:

select card_number from member where hometown like '%Kentucky%'

### Instruction:

Convert text to sql: What are the card numbers of members from Kentucky? | member : member_id , card_number , name , hometown , level | branch : branch_id , name , open_year , address_road , city , membership_amount | membership_register_branch : member_id , branch_id , register_year | purchase : member_id , branch_id , year , total_pounds | membership_register_branch.branch_id = branch.branch_id | membership_register_branch.member_id = member.member_id | purchase.branch_id = branch.branch_id | purchase.member_id = member.member_id | 

### Response:

select card_number from member where hometown like '%Kentucky%'
### Instruction:

Convert text to sql: Find the number of students in total. | student : stuid , lname , fname , age , sex , major , advisor , city_code | voting_record : stuid , registration_date , election_cycle , president_vote , vice_president_vote , secretary_vote , treasurer_vote , class_president_vote , class_senator_vote | voting_record.class_senator_vote = student.stuid | voting_record.class_president_vote = student.stuid | voting_record.treasurer_vote = student.stuid | voting_record.secretary_vote = student.stuid | voting_record.vice_president_vote = student.stuid | voting_record.president_vote = student.stuid | voting_record.stuid = student.stuid | 

### Response:

select count ( * ) from student

### Instruction:

Convert text to sql: How many students are there in total? | student : stuid , lname , fname , age , sex , major , advisor , city_code | voting_record : stuid , registration_date , election_cycle , president_vote , vice_president_vote , secretary_vote , treasurer_vote , class_president_vote , class_senator_vote | voting_record.class_senator_vote = student.stuid | voting_record.class_president_vote = student.stuid | voting_record.treasurer_vote = student.stuid | voting_record.secretary_vote = student.stuid | voting_record.vice_president_vote = student.stuid | voting_record.president_vote = student.stuid | voting_record.stuid = student.stuid | 

### Response:

select count ( * ) from student

### Instruction:

Convert text to sql: Find the number of voting records in total. | student : stuid , lname , fname , age , sex , major , advisor , city_code | voting_record : stuid , registration_date , election_cycle , president_vote , vice_president_vote , secretary_vote , treasurer_vote , class_president_vote , class_senator_vote | voting_record.class_senator_vote = student.stuid | voting_record.class_president_vote = student.stuid | voting_record.treasurer_vote = student.stuid | voting_record.secretary_vote = student.stuid | voting_record.vice_president_vote = student.stuid | voting_record.president_vote = student.stuid | voting_record.stuid = student.stuid | 

### Response:

select count ( * ) from voting_record

### Instruction:

Convert text to sql: How many voting records do we have? | student : stuid , lname , fname , age , sex , major , advisor , city_code | voting_record : stuid , registration_date , election_cycle , president_vote , vice_president_vote , secretary_vote , treasurer_vote , class_president_vote , class_senator_vote | voting_record.class_senator_vote = student.stuid | voting_record.class_president_vote = student.stuid | voting_record.treasurer_vote = student.stuid | voting_record.secretary_vote = student.stuid | voting_record.vice_president_vote = student.stuid | voting_record.president_vote = student.stuid | voting_record.stuid = student.stuid | 

### Response:

select count ( * ) from voting_record