db_id
stringlengths 4
31
| text
stringlengths 370
4.84k
|
---|---|
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many branches where have more than average number of memberships are there? | 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 branch where membership_amount > ( select avg ( membership_amount ) from branch ) |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the number of branches that have more than the average number of 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 count ( * ) from branch where membership_amount > ( select avg ( membership_amount ) from branch ) |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show name, address road, and city for all branches sorted by open 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 name , address_road , city from branch order by open_year asc |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the names, address roads, and cities of the branches ordered by opening 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 name , address_road , city from branch order by open_year asc |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are names for top three branches with most number of 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 name from branch order by membership_amount desc limit 3 |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the names for the 3 branches that have the most 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 name from branch order by membership_amount desc limit 3 |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show all distinct city where branches with at least 100 memberships are located. | 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 distinct city from branch where membership_amount >= 100 |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the different cities that have 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 distinct city from branch where membership_amount >= 100 |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: List all open years when at least two shops are opened. | 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 open_year from branch group by open_year having count ( * ) >= 2 |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the opening years in which at least two shops opened? | 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 open_year from branch group by open_year having count ( * ) >= 2 |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show minimum and maximum amount of memberships for all branches opened in 2011 or located at city 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 min ( membership_amount ) , max ( membership_amount ) from branch where open_year = 2011 or city = 'London' |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the minimum and maximum membership amounts for all branches that either opened in 2011 or are located 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 min ( membership_amount ) , max ( membership_amount ) from branch where open_year = 2011 or city = 'London' |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show the city and the number of branches opened before 2010 for each city. | 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 , count ( * ) from branch where open_year < 2010 group by city |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: For each city, how many branches opened before 2010? | 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 , count ( * ) from branch where open_year < 2010 group by city |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many different levels do members have? | 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 ( distinct level ) from member |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the different membership levels? | 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 ( distinct level ) from member |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show card number, name, and hometown for all members in a descending order of level. | 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 , name , hometown from member order by level desc |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the card numbers, names, and hometowns of every member ordered by descending level? | 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 , name , hometown from member order by level desc |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show the membership level with most number of 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 level from member group by level order by count ( * ) desc limit 1 |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the membership level with the most people? | 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 level from member group by level order by count ( * ) desc limit 1 |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 ) |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 ) |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 ) |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 ) |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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' |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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' |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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%' |
shop_membership | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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%' |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### 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 |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the distinct number of president votes. | 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 ( distinct president_vote ) from voting_record |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many distinct president votes are recorded? | 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 ( distinct president_vote ) from voting_record |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the maximum age of all the students. | 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 max ( age ) from student |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the oldest age among the students? | 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 max ( age ) from student |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the last names of students with major 50. | 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 lname from student where major = 50 |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the last names of students studying major 50? | 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 lname from student where major = 50 |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the first names of students with age above 22. | 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 fname from student where age > 22 |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the first names of all the students aged above 22? | 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 fname from student where age > 22 |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the majors of male (sex is M) students? | 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 major from student where sex = 'M' |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: List the major of each male student. | 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 major from student where sex = 'M' |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the average age of female (sex is F) students? | 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 avg ( age ) from student where sex = 'F' |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the average age of female students. | 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 avg ( age ) from student where sex = 'F' |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the maximum and minimum age of students with major 600? | 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 max ( age ) , min ( age ) from student where major = 600 |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Tell me the ages of the oldest and youngest students studying major 600. | 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 max ( age ) , min ( age ) from student where major = 600 |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Who are the advisors for students that live in a city with city code "BAL"? | 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 advisor from student where city_code = 'BAL' |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show the advisors of the students whose city of residence has city code "BAL". | 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 advisor from student where city_code = 'BAL' |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the distinct secretary votes in the fall election cycle? | 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 distinct secretary_vote from voting_record where election_cycle = 'Fall' |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Return all the distinct secretary votes made in the fall election cycle. | 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 distinct secretary_vote from voting_record where election_cycle = 'Fall' |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the distinct president votes on 08/30/2015? | 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 distinct president_vote from voting_record where registration_date = '08/30/2015' |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Show all the distinct president votes made on 08/30/2015. | 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 distinct president_vote from voting_record where registration_date = '08/30/2015' |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Report the distinct registration date and the election cycle. | 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 distinct registration_date , election_cycle from voting_record |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the distinct registration dates and the election cycles? | 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 distinct registration_date , election_cycle from voting_record |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Report the distinct president vote and the vice president vote. | 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 distinct president_vote , vice_president_vote from voting_record |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: List all the distinct president votes and the vice president votes. | 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 distinct president_vote , vice_president_vote from voting_record |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the distinct last names of the students who have class president votes. | 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 distinct student.lname from student join voting_record on student.stuid = voting_record.class_president_vote |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the distinct last names of the students who have class president votes? | 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 distinct student.lname from student join voting_record on student.stuid = voting_record.class_president_vote |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the distinct first names of the students who have class senator votes. | 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 distinct student.fname from student join voting_record on student.stuid = voting_record.class_senator_vote |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the distinct first names of the students who have class president votes? | 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 distinct student.fname from student join voting_record on student.stuid = voting_record.class_senator_vote |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the distinct ages of students who have secretary votes in the fall election cycle. | 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 distinct student.age from student join voting_record on student.stuid = voting_record.secretary_vote where voting_record.election_cycle = 'Fall' |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the distinct ages of students who have secretary votes in the fall election cycle? | 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 distinct student.age from student join voting_record on student.stuid = voting_record.secretary_vote where voting_record.election_cycle = 'Fall' |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the distinct Advisor of students who have treasurer votes in the spring election cycle. | 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 distinct student.advisor from student join voting_record on student.stuid = voting_record.treasurer_vote where voting_record.election_cycle = 'Spring' |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Who served as an advisor for students who have treasurer votes in the spring election cycle? | 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 distinct student.advisor from student join voting_record on student.stuid = voting_record.treasurer_vote where voting_record.election_cycle = 'Spring' |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the distinct majors of students who have treasurer votes. | 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 distinct student.major from student join voting_record on student.stuid = voting_record.treasurer_vote |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the distinct majors that students with treasurer votes are studying? | 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 distinct student.major from student join voting_record on student.stuid = voting_record.treasurer_vote |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the first and last names of all the female (sex is F) students who have president votes. | 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 distinct student.fname , student.lname from student join voting_record on student.stuid = voting_record.president_vote where student.sex = 'F' |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the first and last names of all the female students who have president votes? | 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 distinct student.fname , student.lname from student join voting_record on student.stuid = voting_record.president_vote where student.sex = 'F' |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the first and last name of all the students of age 18 who have vice president votes. | 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 distinct student.fname , student.lname from student join voting_record on student.stuid = voting_record.vice_president_vote where student.age = 18 |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the first names and last names of the students who are 18 years old and have vice president votes. | 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 distinct student.fname , student.lname from student join voting_record on student.stuid = voting_record.vice_president_vote where student.age = 18 |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: How many male (sex is M) students have class senator votes in the fall election cycle? | 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 join voting_record on student.stuid = class_senator_vote where student.sex = 'M' and voting_record.election_cycle = 'Fall' |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Count the number of male students who had class senator votes in the fall election cycle. | 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 join voting_record on student.stuid = class_senator_vote where student.sex = 'M' and voting_record.election_cycle = 'Fall' |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the number of students whose city code is NYC and who have class senator votes in the spring election cycle. | 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 join voting_record on student.stuid = class_senator_vote where student.city_code = 'NYC' and voting_record.election_cycle = 'Spring' |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Which students live in the city with code "NYC" and have class senator votes in the spring election cycle? Count the numbers. | 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 join voting_record on student.stuid = class_senator_vote where student.city_code = 'NYC' and voting_record.election_cycle = 'Spring' |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the average age of students who live in the city with code "NYC" and have secretary votes in the spring election cycle. | 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 avg ( student.age ) from student join voting_record on student.stuid = secretary_vote where student.city_code = 'NYC' and voting_record.election_cycle = 'Spring' |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the average age of students who have city code "NYC" and have secretary votes for the spring election cycle? | 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 avg ( student.age ) from student join voting_record on student.stuid = secretary_vote where student.city_code = 'NYC' and voting_record.election_cycle = 'Spring' |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the average age of female (sex is F) students who have secretary votes in the spring election cycle. | 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 avg ( student.age ) from student join voting_record on student.stuid = secretary_vote where student.sex = 'F' and voting_record.election_cycle = 'Spring' |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What is the average age of the female students with secretary votes in the spring election cycle? | 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 avg ( student.age ) from student join voting_record on student.stuid = secretary_vote where student.sex = 'F' and voting_record.election_cycle = 'Spring' |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the distinct first names of all the students who have vice president votes and whose city code is not PIT. | 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 distinct student.fname from student join voting_record on student.stuid = voting_record.vice_president_vote except select distinct fname from student where city_code = 'PIT' |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the distinct first names of the students who have vice president votes and reside in a city whose city code is not PIT? | 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 distinct student.fname from student join voting_record on student.stuid = voting_record.vice_president_vote except select distinct fname from student where city_code = 'PIT' |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the distinct last names of all the students who have president votes and whose advisor is not 2192. | 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 distinct student.lname from student join voting_record on student.stuid = president_vote except select distinct lname from student where advisor = '2192' |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the distinct last names of the students who have president votes but do not have 2192 as the advisor? | 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 distinct student.lname from student join voting_record on student.stuid = president_vote except select distinct lname from student where advisor = '2192' |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: Find the distinct last names of all the students who have president votes and whose advisor is 8741. | 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 distinct student.lname from student join voting_record on student.stuid = president_vote intersect select distinct lname from student where advisor = '8741' |
voter_2 | Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
Convert text to sql: What are the distinct last names of the students who have president votes and have 8741 as the advisor? | 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 distinct student.lname from student join voting_record on student.stuid = president_vote intersect select distinct lname from student where advisor = '8741' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.