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

Convert text to sql: How many members have the black membership card? | shop : shop_id , address , num_of_staff , score , open_year | member : member_id , name , membership_card , age , time_of_purchase , level_of_membership , address | happy_hour : hh_id , shop_id , month , num_of_shaff_in_charge | happy_hour_member : hh_id , member_id , total_amount | happy_hour.shop_id = shop.shop_id | happy_hour_member.member_id = member.member_id | 

### Response:

select count ( * ) from member where membership_card = 'Black'

### Instruction:

Convert text to sql: Find the number of members living in each address. | shop : shop_id , address , num_of_staff , score , open_year | member : member_id , name , membership_card , age , time_of_purchase , level_of_membership , address | happy_hour : hh_id , shop_id , month , num_of_shaff_in_charge | happy_hour_member : hh_id , member_id , total_amount | happy_hour.shop_id = shop.shop_id | happy_hour_member.member_id = member.member_id | 

### Response:

select count ( * ) , address from member group by address

### Instruction:

Convert text to sql: Give me the names of members whose address is in Harford or Waterbury. | shop : shop_id , address , num_of_staff , score , open_year | member : member_id , name , membership_card , age , time_of_purchase , level_of_membership , address | happy_hour : hh_id , shop_id , month , num_of_shaff_in_charge | happy_hour_member : hh_id , member_id , total_amount | happy_hour.shop_id = shop.shop_id | happy_hour_member.member_id = member.member_id | 

### Response:

select name from member where address = 'Harford' or address = 'Waterbury'

### Instruction:

Convert text to sql: Find the ids and names of members who are under age 30 or with black membership card. | shop : shop_id , address , num_of_staff , score , open_year | member : member_id , name , membership_card , age , time_of_purchase , level_of_membership , address | happy_hour : hh_id , shop_id , month , num_of_shaff_in_charge | happy_hour_member : hh_id , member_id , total_amount | happy_hour.shop_id = shop.shop_id | happy_hour_member.member_id = member.member_id | 

### Response:

select name , member_id from member where membership_card = 'Black' or age < 30

### Instruction:

Convert text to sql: Find the purchase time, age and address of each member, and show the results in the order of purchase time. | shop : shop_id , address , num_of_staff , score , open_year | member : member_id , name , membership_card , age , time_of_purchase , level_of_membership , address | happy_hour : hh_id , shop_id , month , num_of_shaff_in_charge | happy_hour_member : hh_id , member_id , total_amount | happy_hour.shop_id = shop.shop_id | happy_hour_member.member_id = member.member_id | 

### Response:

select time_of_purchase , age , address from member order by time_of_purchase asc
### Instruction:

Convert text to sql: Which membership card has more than 5 members? | shop : shop_id , address , num_of_staff , score , open_year | member : member_id , name , membership_card , age , time_of_purchase , level_of_membership , address | happy_hour : hh_id , shop_id , month , num_of_shaff_in_charge | happy_hour_member : hh_id , member_id , total_amount | happy_hour.shop_id = shop.shop_id | happy_hour_member.member_id = member.member_id | 

### Response:

select membership_card from member group by membership_card having count ( * ) > 5

### Instruction:

Convert text to sql: Which address has both members younger than 30 and members older than 40? | shop : shop_id , address , num_of_staff , score , open_year | member : member_id , name , membership_card , age , time_of_purchase , level_of_membership , address | happy_hour : hh_id , shop_id , month , num_of_shaff_in_charge | happy_hour_member : hh_id , member_id , total_amount | happy_hour.shop_id = shop.shop_id | happy_hour_member.member_id = member.member_id | 

### Response:

select address from member where age < 30 intersect select address from member where age > 40

### Instruction:

Convert text to sql: What is the membership card held by both members living in Hartford and ones living in Waterbury address? | shop : shop_id , address , num_of_staff , score , open_year | member : member_id , name , membership_card , age , time_of_purchase , level_of_membership , address | happy_hour : hh_id , shop_id , month , num_of_shaff_in_charge | happy_hour_member : hh_id , member_id , total_amount | happy_hour.shop_id = shop.shop_id | happy_hour_member.member_id = member.member_id | 

### Response:

select membership_card from member where address = 'Hartford' intersect select membership_card from member where address = 'Waterbury'

### Instruction:

Convert text to sql: How many members are not living in Hartford? | shop : shop_id , address , num_of_staff , score , open_year | member : member_id , name , membership_card , age , time_of_purchase , level_of_membership , address | happy_hour : hh_id , shop_id , month , num_of_shaff_in_charge | happy_hour_member : hh_id , member_id , total_amount | happy_hour.shop_id = shop.shop_id | happy_hour_member.member_id = member.member_id | 

### Response:

select count ( * ) from member where address != 'Hartford'

### Instruction:

Convert text to sql: Which address do not have any member with the black membership card? | shop : shop_id , address , num_of_staff , score , open_year | member : member_id , name , membership_card , age , time_of_purchase , level_of_membership , address | happy_hour : hh_id , shop_id , month , num_of_shaff_in_charge | happy_hour_member : hh_id , member_id , total_amount | happy_hour.shop_id = shop.shop_id | happy_hour_member.member_id = member.member_id | 

### Response:

select address from member except select address from member where membership_card = 'Black'
### Instruction:

Convert text to sql: Show the shop addresses ordered by their opening year. | shop : shop_id , address , num_of_staff , score , open_year | member : member_id , name , membership_card , age , time_of_purchase , level_of_membership , address | happy_hour : hh_id , shop_id , month , num_of_shaff_in_charge | happy_hour_member : hh_id , member_id , total_amount | happy_hour.shop_id = shop.shop_id | happy_hour_member.member_id = member.member_id | 

### Response:

select address from shop order by open_year asc

### Instruction:

Convert text to sql: What are the average score and average staff number of all shops? | shop : shop_id , address , num_of_staff , score , open_year | member : member_id , name , membership_card , age , time_of_purchase , level_of_membership , address | happy_hour : hh_id , shop_id , month , num_of_shaff_in_charge | happy_hour_member : hh_id , member_id , total_amount | happy_hour.shop_id = shop.shop_id | happy_hour_member.member_id = member.member_id | 

### Response:

select avg ( num_of_staff ) , avg ( score ) from shop

### Instruction:

Convert text to sql: Find the id and address of the shops whose score is below the average score. | shop : shop_id , address , num_of_staff , score , open_year | member : member_id , name , membership_card , age , time_of_purchase , level_of_membership , address | happy_hour : hh_id , shop_id , month , num_of_shaff_in_charge | happy_hour_member : hh_id , member_id , total_amount | happy_hour.shop_id = shop.shop_id | happy_hour_member.member_id = member.member_id | 

### Response:

select shop_id , address from shop where score < ( select avg ( score ) from shop )

### Instruction:

Convert text to sql: Find the address and staff number of the shops that do not have any happy hour. | shop : shop_id , address , num_of_staff , score , open_year | member : member_id , name , membership_card , age , time_of_purchase , level_of_membership , address | happy_hour : hh_id , shop_id , month , num_of_shaff_in_charge | happy_hour_member : hh_id , member_id , total_amount | happy_hour.shop_id = shop.shop_id | happy_hour_member.member_id = member.member_id | 

### Response:

select address , num_of_staff from shop where shop_id not in ( select shop_id from happy_hour )

### Instruction:

Convert text to sql: What are the id and address of the shops which have a happy hour in May? | shop : shop_id , address , num_of_staff , score , open_year | member : member_id , name , membership_card , age , time_of_purchase , level_of_membership , address | happy_hour : hh_id , shop_id , month , num_of_shaff_in_charge | happy_hour_member : hh_id , member_id , total_amount | happy_hour.shop_id = shop.shop_id | happy_hour_member.member_id = member.member_id | 

### Response:

select shop.address , shop.shop_id from shop join happy_hour on shop.shop_id = happy_hour.shop_id where month = 'May'
### Instruction:

Convert text to sql: which shop has happy hour most frequently? List its id and number of happy hours. | shop : shop_id , address , num_of_staff , score , open_year | member : member_id , name , membership_card , age , time_of_purchase , level_of_membership , address | happy_hour : hh_id , shop_id , month , num_of_shaff_in_charge | happy_hour_member : hh_id , member_id , total_amount | happy_hour.shop_id = shop.shop_id | happy_hour_member.member_id = member.member_id | 

### Response:

select shop_id , count ( * ) from happy_hour group by shop_id order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: Which month has the most happy hours? | shop : shop_id , address , num_of_staff , score , open_year | member : member_id , name , membership_card , age , time_of_purchase , level_of_membership , address | happy_hour : hh_id , shop_id , month , num_of_shaff_in_charge | happy_hour_member : hh_id , member_id , total_amount | happy_hour.shop_id = shop.shop_id | happy_hour_member.member_id = member.member_id | 

### Response:

select month from happy_hour group by month order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: Which months have more than 2 happy hours? | shop : shop_id , address , num_of_staff , score , open_year | member : member_id , name , membership_card , age , time_of_purchase , level_of_membership , address | happy_hour : hh_id , shop_id , month , num_of_shaff_in_charge | happy_hour_member : hh_id , member_id , total_amount | happy_hour.shop_id = shop.shop_id | happy_hour_member.member_id = member.member_id | 

### Response:

select month from happy_hour group by month having count ( * ) > 2
### Instruction:

Convert text to sql: How many albums are there? | album : albumid , title , artistid | artist : artistid , name | customer : customerid , firstname , lastname , company , address , city , state , country , postalcode , phone , fax , email , supportrepid | employee : employeeid , lastname , firstname , title , reportsto , birthdate , hiredate , address , city , state , country , postalcode , phone , fax , email | genre : genreid , name | invoice : invoiceid , customerid , invoicedate , billingaddress , billingcity , billingstate , billingcountry , billingpostalcode , total | invoiceline : invoicelineid , invoiceid , trackid , unitprice , quantity | mediatype : mediatypeid , name | playlist : playlistid , name | playlisttrack : playlistid , trackid | track : trackid , name , albumid , mediatypeid , genreid , composer , milliseconds , bytes , unitprice | album.artistid = artist.artistid | customer.supportrepid = employee.employeeid | employee.reportsto = employee.employeeid | invoice.customerid = customer.customerid | invoiceline.trackid = track.trackid | invoiceline.invoiceid = invoice.invoiceid | playlisttrack.trackid = track.trackid | playlisttrack.playlistid = playlist.playlistid | track.mediatypeid = mediatype.mediatypeid | track.genreid = genre.genreid | track.albumid = album.albumid | 

### Response:

select count ( * ) from album

### Instruction:

Convert text to sql: Find the number of albums. | album : albumid , title , artistid | artist : artistid , name | customer : customerid , firstname , lastname , company , address , city , state , country , postalcode , phone , fax , email , supportrepid | employee : employeeid , lastname , firstname , title , reportsto , birthdate , hiredate , address , city , state , country , postalcode , phone , fax , email | genre : genreid , name | invoice : invoiceid , customerid , invoicedate , billingaddress , billingcity , billingstate , billingcountry , billingpostalcode , total | invoiceline : invoicelineid , invoiceid , trackid , unitprice , quantity | mediatype : mediatypeid , name | playlist : playlistid , name | playlisttrack : playlistid , trackid | track : trackid , name , albumid , mediatypeid , genreid , composer , milliseconds , bytes , unitprice | album.artistid = artist.artistid | customer.supportrepid = employee.employeeid | employee.reportsto = employee.employeeid | invoice.customerid = customer.customerid | invoiceline.trackid = track.trackid | invoiceline.invoiceid = invoice.invoiceid | playlisttrack.trackid = track.trackid | playlisttrack.playlistid = playlist.playlistid | track.mediatypeid = mediatype.mediatypeid | track.genreid = genre.genreid | track.albumid = album.albumid | 

### Response:

select count ( * ) from album
### Instruction:

Convert text to sql: List the names of all music genres. | album : albumid , title , artistid | artist : artistid , name | customer : customerid , firstname , lastname , company , address , city , state , country , postalcode , phone , fax , email , supportrepid | employee : employeeid , lastname , firstname , title , reportsto , birthdate , hiredate , address , city , state , country , postalcode , phone , fax , email | genre : genreid , name | invoice : invoiceid , customerid , invoicedate , billingaddress , billingcity , billingstate , billingcountry , billingpostalcode , total | invoiceline : invoicelineid , invoiceid , trackid , unitprice , quantity | mediatype : mediatypeid , name | playlist : playlistid , name | playlisttrack : playlistid , trackid | track : trackid , name , albumid , mediatypeid , genreid , composer , milliseconds , bytes , unitprice | album.artistid = artist.artistid | customer.supportrepid = employee.employeeid | employee.reportsto = employee.employeeid | invoice.customerid = customer.customerid | invoiceline.trackid = track.trackid | invoiceline.invoiceid = invoice.invoiceid | playlisttrack.trackid = track.trackid | playlisttrack.playlistid = playlist.playlistid | track.mediatypeid = mediatype.mediatypeid | track.genreid = genre.genreid | track.albumid = album.albumid | 

### Response:

select name from genre

### Instruction:

Convert text to sql: What are the names of different music genres? | album : albumid , title , artistid | artist : artistid , name | customer : customerid , firstname , lastname , company , address , city , state , country , postalcode , phone , fax , email , supportrepid | employee : employeeid , lastname , firstname , title , reportsto , birthdate , hiredate , address , city , state , country , postalcode , phone , fax , email | genre : genreid , name | invoice : invoiceid , customerid , invoicedate , billingaddress , billingcity , billingstate , billingcountry , billingpostalcode , total | invoiceline : invoicelineid , invoiceid , trackid , unitprice , quantity | mediatype : mediatypeid , name | playlist : playlistid , name | playlisttrack : playlistid , trackid | track : trackid , name , albumid , mediatypeid , genreid , composer , milliseconds , bytes , unitprice | album.artistid = artist.artistid | customer.supportrepid = employee.employeeid | employee.reportsto = employee.employeeid | invoice.customerid = customer.customerid | invoiceline.trackid = track.trackid | invoiceline.invoiceid = invoice.invoiceid | playlisttrack.trackid = track.trackid | playlisttrack.playlistid = playlist.playlistid | track.mediatypeid = mediatype.mediatypeid | track.genreid = genre.genreid | track.albumid = album.albumid | 

### Response:

select name from genre
### Instruction:

Convert text to sql: Find all the customer information in state NY. | album : albumid , title , artistid | artist : artistid , name | customer : customerid , firstname , lastname , company , address , city , state , country , postalcode , phone , fax , email , supportrepid | employee : employeeid , lastname , firstname , title , reportsto , birthdate , hiredate , address , city , state , country , postalcode , phone , fax , email | genre : genreid , name | invoice : invoiceid , customerid , invoicedate , billingaddress , billingcity , billingstate , billingcountry , billingpostalcode , total | invoiceline : invoicelineid , invoiceid , trackid , unitprice , quantity | mediatype : mediatypeid , name | playlist : playlistid , name | playlisttrack : playlistid , trackid | track : trackid , name , albumid , mediatypeid , genreid , composer , milliseconds , bytes , unitprice | album.artistid = artist.artistid | customer.supportrepid = employee.employeeid | employee.reportsto = employee.employeeid | invoice.customerid = customer.customerid | invoiceline.trackid = track.trackid | invoiceline.invoiceid = invoice.invoiceid | playlisttrack.trackid = track.trackid | playlisttrack.playlistid = playlist.playlistid | track.mediatypeid = mediatype.mediatypeid | track.genreid = genre.genreid | track.albumid = album.albumid | 

### Response:

select * from customer where state = 'NY'

### Instruction:

Convert text to sql: What is all the customer information for customers in NY state? | album : albumid , title , artistid | artist : artistid , name | customer : customerid , firstname , lastname , company , address , city , state , country , postalcode , phone , fax , email , supportrepid | employee : employeeid , lastname , firstname , title , reportsto , birthdate , hiredate , address , city , state , country , postalcode , phone , fax , email | genre : genreid , name | invoice : invoiceid , customerid , invoicedate , billingaddress , billingcity , billingstate , billingcountry , billingpostalcode , total | invoiceline : invoicelineid , invoiceid , trackid , unitprice , quantity | mediatype : mediatypeid , name | playlist : playlistid , name | playlisttrack : playlistid , trackid | track : trackid , name , albumid , mediatypeid , genreid , composer , milliseconds , bytes , unitprice | album.artistid = artist.artistid | customer.supportrepid = employee.employeeid | employee.reportsto = employee.employeeid | invoice.customerid = customer.customerid | invoiceline.trackid = track.trackid | invoiceline.invoiceid = invoice.invoiceid | playlisttrack.trackid = track.trackid | playlisttrack.playlistid = playlist.playlistid | track.mediatypeid = mediatype.mediatypeid | track.genreid = genre.genreid | track.albumid = album.albumid | 

### Response:

select * from customer where state = 'NY'
### Instruction:

Convert text to sql: What are the first names and last names of the employees who live in Calgary city. | album : albumid , title , artistid | artist : artistid , name | customer : customerid , firstname , lastname , company , address , city , state , country , postalcode , phone , fax , email , supportrepid | employee : employeeid , lastname , firstname , title , reportsto , birthdate , hiredate , address , city , state , country , postalcode , phone , fax , email | genre : genreid , name | invoice : invoiceid , customerid , invoicedate , billingaddress , billingcity , billingstate , billingcountry , billingpostalcode , total | invoiceline : invoicelineid , invoiceid , trackid , unitprice , quantity | mediatype : mediatypeid , name | playlist : playlistid , name | playlisttrack : playlistid , trackid | track : trackid , name , albumid , mediatypeid , genreid , composer , milliseconds , bytes , unitprice | album.artistid = artist.artistid | customer.supportrepid = employee.employeeid | employee.reportsto = employee.employeeid | invoice.customerid = customer.customerid | invoiceline.trackid = track.trackid | invoiceline.invoiceid = invoice.invoiceid | playlisttrack.trackid = track.trackid | playlisttrack.playlistid = playlist.playlistid | track.mediatypeid = mediatype.mediatypeid | track.genreid = genre.genreid | track.albumid = album.albumid | 

### Response:

select firstname , lastname from employee where city = 'Calgary'

### Instruction:

Convert text to sql: Find the full names of employees living in the city of Calgary. | album : albumid , title , artistid | artist : artistid , name | customer : customerid , firstname , lastname , company , address , city , state , country , postalcode , phone , fax , email , supportrepid | employee : employeeid , lastname , firstname , title , reportsto , birthdate , hiredate , address , city , state , country , postalcode , phone , fax , email | genre : genreid , name | invoice : invoiceid , customerid , invoicedate , billingaddress , billingcity , billingstate , billingcountry , billingpostalcode , total | invoiceline : invoicelineid , invoiceid , trackid , unitprice , quantity | mediatype : mediatypeid , name | playlist : playlistid , name | playlisttrack : playlistid , trackid | track : trackid , name , albumid , mediatypeid , genreid , composer , milliseconds , bytes , unitprice | album.artistid = artist.artistid | customer.supportrepid = employee.employeeid | employee.reportsto = employee.employeeid | invoice.customerid = customer.customerid | invoiceline.trackid = track.trackid | invoiceline.invoiceid = invoice.invoiceid | playlisttrack.trackid = track.trackid | playlisttrack.playlistid = playlist.playlistid | track.mediatypeid = mediatype.mediatypeid | track.genreid = genre.genreid | track.albumid = album.albumid | 

### Response:

select firstname , lastname from employee where city = 'Calgary'