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

Convert text to sql: Find the name of the customers who have at most two orders. | customers : customer_id , customer_name , customer_details | invoices : invoice_number , invoice_date , invoice_details | orders : order_id , customer_id , order_status , date_order_placed , order_details | products : product_id , product_name , product_details | order_items : order_item_id , product_id , order_id , order_item_status , order_item_details | shipments : shipment_id , order_id , invoice_number , shipment_tracking_number , shipment_date , other_shipment_details | shipment_items : shipment_id , order_item_id | orders.customer_id = customers.customer_id | order_items.product_id = products.product_id | order_items.order_id = orders.order_id | shipments.invoice_number = invoices.invoice_number | shipments.order_id = orders.order_id | shipment_items.shipment_id = shipments.shipment_id | shipment_items.order_item_id = order_items.order_item_id | 

### Response:

select customers.customer_name from orders join customers on orders.customer_id = customers.customer_id group by customers.customer_id having count ( * ) <= 2

### Instruction:

Convert text to sql: What are the names of the customers who have made two or less orders? | customers : customer_id , customer_name , customer_details | invoices : invoice_number , invoice_date , invoice_details | orders : order_id , customer_id , order_status , date_order_placed , order_details | products : product_id , product_name , product_details | order_items : order_item_id , product_id , order_id , order_item_status , order_item_details | shipments : shipment_id , order_id , invoice_number , shipment_tracking_number , shipment_date , other_shipment_details | shipment_items : shipment_id , order_item_id | orders.customer_id = customers.customer_id | order_items.product_id = products.product_id | order_items.order_id = orders.order_id | shipments.invoice_number = invoices.invoice_number | shipments.order_id = orders.order_id | shipment_items.shipment_id = shipments.shipment_id | shipment_items.order_item_id = order_items.order_item_id | 

### Response:

select customers.customer_name from orders join customers on orders.customer_id = customers.customer_id group by customers.customer_id having count ( * ) <= 2
### Instruction:

Convert text to sql: List the names of the customers who have once bought product "food". | customers : customer_id , customer_name , customer_details | invoices : invoice_number , invoice_date , invoice_details | orders : order_id , customer_id , order_status , date_order_placed , order_details | products : product_id , product_name , product_details | order_items : order_item_id , product_id , order_id , order_item_status , order_item_details | shipments : shipment_id , order_id , invoice_number , shipment_tracking_number , shipment_date , other_shipment_details | shipment_items : shipment_id , order_item_id | orders.customer_id = customers.customer_id | order_items.product_id = products.product_id | order_items.order_id = orders.order_id | shipments.invoice_number = invoices.invoice_number | shipments.order_id = orders.order_id | shipment_items.shipment_id = shipments.shipment_id | shipment_items.order_item_id = order_items.order_item_id | 

### Response:

select customers.customer_name from customers join orders join order_items join products on customers.customer_id = orders.customer_id and orders.order_id = order_items.order_id and order_items.product_id = products.product_id where products.product_name = 'food' group by customers.customer_id having count ( * ) >= 1

### Instruction:

Convert text to sql: What are the names of the customers who bought product "food" at least once? | customers : customer_id , customer_name , customer_details | invoices : invoice_number , invoice_date , invoice_details | orders : order_id , customer_id , order_status , date_order_placed , order_details | products : product_id , product_name , product_details | order_items : order_item_id , product_id , order_id , order_item_status , order_item_details | shipments : shipment_id , order_id , invoice_number , shipment_tracking_number , shipment_date , other_shipment_details | shipment_items : shipment_id , order_item_id | orders.customer_id = customers.customer_id | order_items.product_id = products.product_id | order_items.order_id = orders.order_id | shipments.invoice_number = invoices.invoice_number | shipments.order_id = orders.order_id | shipment_items.shipment_id = shipments.shipment_id | shipment_items.order_item_id = order_items.order_item_id | 

### Response:

select customers.customer_name from customers join orders join order_items join products on customers.customer_id = orders.customer_id and orders.order_id = order_items.order_id and order_items.product_id = products.product_id where products.product_name = 'food' group by customers.customer_id having count ( * ) >= 1
### Instruction:

Convert text to sql: List the names of customers who have once canceled the purchase of the product "food" (the item status is "Cancel"). | customers : customer_id , customer_name , customer_details | invoices : invoice_number , invoice_date , invoice_details | orders : order_id , customer_id , order_status , date_order_placed , order_details | products : product_id , product_name , product_details | order_items : order_item_id , product_id , order_id , order_item_status , order_item_details | shipments : shipment_id , order_id , invoice_number , shipment_tracking_number , shipment_date , other_shipment_details | shipment_items : shipment_id , order_item_id | orders.customer_id = customers.customer_id | order_items.product_id = products.product_id | order_items.order_id = orders.order_id | shipments.invoice_number = invoices.invoice_number | shipments.order_id = orders.order_id | shipment_items.shipment_id = shipments.shipment_id | shipment_items.order_item_id = order_items.order_item_id | 

### Response:

select customers.customer_name from customers join orders join order_items join products on customers.customer_id = orders.customer_id and orders.order_id = order_items.order_id and order_items.product_id = products.product_id where order_items.order_item_status = 'Cancel' and products.product_name = 'food' group by customers.customer_id having count ( * ) >= 1

### Instruction:

Convert text to sql: Which customers have ever canceled the purchase of the product "food" (the item status is "Cancel")? | customers : customer_id , customer_name , customer_details | invoices : invoice_number , invoice_date , invoice_details | orders : order_id , customer_id , order_status , date_order_placed , order_details | products : product_id , product_name , product_details | order_items : order_item_id , product_id , order_id , order_item_status , order_item_details | shipments : shipment_id , order_id , invoice_number , shipment_tracking_number , shipment_date , other_shipment_details | shipment_items : shipment_id , order_item_id | orders.customer_id = customers.customer_id | order_items.product_id = products.product_id | order_items.order_id = orders.order_id | shipments.invoice_number = invoices.invoice_number | shipments.order_id = orders.order_id | shipment_items.shipment_id = shipments.shipment_id | shipment_items.order_item_id = order_items.order_item_id | 

### Response:

select customers.customer_name from customers join orders join order_items join products on customers.customer_id = orders.customer_id and orders.order_id = order_items.order_id and order_items.product_id = products.product_id where order_items.order_item_status = 'Cancel' and products.product_name = 'food' group by customers.customer_id having count ( * ) >= 1
### Instruction:

Convert text to sql: How many architects are female? | architect : id , name , nationality , gender | bridge : architect_id , id , name , location , length_meters , length_feet | mill : architect_id , id , location , name , type , built_year , notes | bridge.architect_id = architect.id | mill.architect_id = architect.id | 

### Response:

select count ( * ) from architect where gender = 'female'

### Instruction:

Convert text to sql: List the name, nationality and id of all male architects ordered by their names lexicographically. | architect : id , name , nationality , gender | bridge : architect_id , id , name , location , length_meters , length_feet | mill : architect_id , id , location , name , type , built_year , notes | bridge.architect_id = architect.id | mill.architect_id = architect.id | 

### Response:

select name , nationality , id from architect where gender = 'male' order by name asc

### Instruction:

Convert text to sql: What is the maximum length in meters for the bridges and what are the architects' names? | architect : id , name , nationality , gender | bridge : architect_id , id , name , location , length_meters , length_feet | mill : architect_id , id , location , name , type , built_year , notes | bridge.architect_id = architect.id | mill.architect_id = architect.id | 

### Response:

select max ( bridge.length_meters ) , architect.name from bridge join architect on bridge.architect_id = architect.id

### Instruction:

Convert text to sql: What is the average length in feet of the bridges? | architect : id , name , nationality , gender | bridge : architect_id , id , name , location , length_meters , length_feet | mill : architect_id , id , location , name , type , built_year , notes | bridge.architect_id = architect.id | mill.architect_id = architect.id | 

### Response:

select avg ( length_feet ) from bridge

### Instruction:

Convert text to sql: What are the names and year of construction for the mills of 'Grondzeiler' type? | architect : id , name , nationality , gender | bridge : architect_id , id , name , location , length_meters , length_feet | mill : architect_id , id , location , name , type , built_year , notes | bridge.architect_id = architect.id | mill.architect_id = architect.id | 

### Response:

select name , built_year from mill where type = 'Grondzeiler'

### Instruction:

Convert text to sql: What are the distinct names and nationalities of the architects who have ever built a mill? | architect : id , name , nationality , gender | bridge : architect_id , id , name , location , length_meters , length_feet | mill : architect_id , id , location , name , type , built_year , notes | bridge.architect_id = architect.id | mill.architect_id = architect.id | 

### Response:

select distinct architect.name , architect.nationality from architect join mill on architect.id = mill.architect_id
### Instruction:

Convert text to sql: What are the names of the mills which are not located in 'Donceel'? | architect : id , name , nationality , gender | bridge : architect_id , id , name , location , length_meters , length_feet | mill : architect_id , id , location , name , type , built_year , notes | bridge.architect_id = architect.id | mill.architect_id = architect.id | 

### Response:

select name from mill where location != 'Donceel'

### Instruction:

Convert text to sql: What are the distinct types of mills that are built by American or Canadian architects? | architect : id , name , nationality , gender | bridge : architect_id , id , name , location , length_meters , length_feet | mill : architect_id , id , location , name , type , built_year , notes | bridge.architect_id = architect.id | mill.architect_id = architect.id | 

### Response:

select distinct mill.type from mill join architect on mill.architect_id = architect.id where architect.nationality = 'American' or architect.nationality = 'Canadian'

### Instruction:

Convert text to sql: What are the ids and names of the architects who built at least 3 bridges ? | architect : id , name , nationality , gender | bridge : architect_id , id , name , location , length_meters , length_feet | mill : architect_id , id , location , name , type , built_year , notes | bridge.architect_id = architect.id | mill.architect_id = architect.id | 

### Response:

select architect.id , architect.name from architect join bridge on architect.id = bridge.architect_id group by architect.id having count ( * ) >= 3

### Instruction:

Convert text to sql: What is the id, name and nationality of the architect who built most mills? | architect : id , name , nationality , gender | bridge : architect_id , id , name , location , length_meters , length_feet | mill : architect_id , id , location , name , type , built_year , notes | bridge.architect_id = architect.id | mill.architect_id = architect.id | 

### Response:

select architect.id , architect.name , architect.nationality from architect join mill on architect.id = mill.architect_id group by architect.id order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: What are the ids, names and genders of the architects who built two bridges or one mill? | architect : id , name , nationality , gender | bridge : architect_id , id , name , location , length_meters , length_feet | mill : architect_id , id , location , name , type , built_year , notes | bridge.architect_id = architect.id | mill.architect_id = architect.id | 

### Response:

select architect.id , architect.name , architect.gender from architect join bridge on architect.id = mill.architect_id group by architect.id having count ( * ) = 2 union select architect.id , architect.name , architect.gender from architect join mill on architect.id = mill.architect_id group by architect.id having count ( * ) = 1
### Instruction:

Convert text to sql: What is the location of the bridge named 'Kolob Arch' or 'Rainbow Bridge'? | architect : id , name , nationality , gender | bridge : architect_id , id , name , location , length_meters , length_feet | mill : architect_id , id , location , name , type , built_year , notes | bridge.architect_id = architect.id | mill.architect_id = architect.id | 

### Response:

select location from bridge where name = 'Kolob Arch' or name = 'Rainbow Bridge'

### Instruction:

Convert text to sql: Which of the mill names contains the french word 'Moulin'? | architect : id , name , nationality , gender | bridge : architect_id , id , name , location , length_meters , length_feet | mill : architect_id , id , location , name , type , built_year , notes | bridge.architect_id = architect.id | mill.architect_id = architect.id | 

### Response:

select name from mill where name like '%Moulin%'

### Instruction:

Convert text to sql: What are the distinct name of the mills built by the architects who have also built a bridge longer than 80 meters? | architect : id , name , nationality , gender | bridge : architect_id , id , name , location , length_meters , length_feet | mill : architect_id , id , location , name , type , built_year , notes | bridge.architect_id = architect.id | mill.architect_id = architect.id | 

### Response:

select distinct mill.name from mill join architect on mill.architect_id = architect.id join bridge on bridge.architect_id = architect.id where bridge.length_meters > 80

### Instruction:

Convert text to sql: What is the most common mill type, and how many are there? | architect : id , name , nationality , gender | bridge : architect_id , id , name , location , length_meters , length_feet | mill : architect_id , id , location , name , type , built_year , notes | bridge.architect_id = architect.id | mill.architect_id = architect.id | 

### Response:

select type , count ( * ) from mill group by type order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: How many architects haven't built a mill before year 1850? | architect : id , name , nationality , gender | bridge : architect_id , id , name , location , length_meters , length_feet | mill : architect_id , id , location , name , type , built_year , notes | bridge.architect_id = architect.id | mill.architect_id = architect.id | 

### Response:

select count ( * ) from architect where id not in ( select architect_id from mill where built_year < 1850 )

### Instruction:

Convert text to sql: show the name of all bridges that was designed by american archtect, and sort the result by the bridge feet length. | architect : id , name , nationality , gender | bridge : architect_id , id , name , location , length_meters , length_feet | mill : architect_id , id , location , name , type , built_year , notes | bridge.architect_id = architect.id | mill.architect_id = architect.id | 

### Response:

select bridge.name from bridge join architect on bridge.architect_id = architect.id where architect.nationality = 'American' order by bridge.length_feet asc
### Instruction:

Convert text to sql: How many book clubs are there? | book_club : book_club_id , year , author_or_editor , book_title , publisher , category , result | movie : movie_id , title , year , director , budget_million , gross_worldwide | culture_company : company_name , type , incorporated_in , group_equity_shareholding , book_club_id , movie_id | culture_company.movie_id = movie.movie_id | culture_company.book_club_id = book_club.book_club_id | 

### Response:

select count ( * ) from book_club

### Instruction:

Convert text to sql: Count the number of book clubs. | book_club : book_club_id , year , author_or_editor , book_title , publisher , category , result | movie : movie_id , title , year , director , budget_million , gross_worldwide | culture_company : company_name , type , incorporated_in , group_equity_shareholding , book_club_id , movie_id | culture_company.movie_id = movie.movie_id | culture_company.book_club_id = book_club.book_club_id | 

### Response:

select count ( * ) from book_club

### Instruction:

Convert text to sql: show the titles, and authors or editors for all books made after the year 1989. | book_club : book_club_id , year , author_or_editor , book_title , publisher , category , result | movie : movie_id , title , year , director , budget_million , gross_worldwide | culture_company : company_name , type , incorporated_in , group_equity_shareholding , book_club_id , movie_id | culture_company.movie_id = movie.movie_id | culture_company.book_club_id = book_club.book_club_id | 

### Response:

select book_title , author_or_editor from book_club where year > 1989

### Instruction:

Convert text to sql: What are the titles and authors or editors that correspond to books made after 1989? | book_club : book_club_id , year , author_or_editor , book_title , publisher , category , result | movie : movie_id , title , year , director , budget_million , gross_worldwide | culture_company : company_name , type , incorporated_in , group_equity_shareholding , book_club_id , movie_id | culture_company.movie_id = movie.movie_id | culture_company.book_club_id = book_club.book_club_id | 

### Response:

select book_title , author_or_editor from book_club where year > 1989

### Instruction:

Convert text to sql: Show all distinct publishers for books. | book_club : book_club_id , year , author_or_editor , book_title , publisher , category , result | movie : movie_id , title , year , director , budget_million , gross_worldwide | culture_company : company_name , type , incorporated_in , group_equity_shareholding , book_club_id , movie_id | culture_company.movie_id = movie.movie_id | culture_company.book_club_id = book_club.book_club_id | 

### Response:

select distinct publisher from book_club
### Instruction:

Convert text to sql: What are all the different book publishers? | book_club : book_club_id , year , author_or_editor , book_title , publisher , category , result | movie : movie_id , title , year , director , budget_million , gross_worldwide | culture_company : company_name , type , incorporated_in , group_equity_shareholding , book_club_id , movie_id | culture_company.movie_id = movie.movie_id | culture_company.book_club_id = book_club.book_club_id | 

### Response:

select distinct publisher from book_club

### Instruction:

Convert text to sql: Show the years, book titles, and publishers for all books, in descending order by year. | book_club : book_club_id , year , author_or_editor , book_title , publisher , category , result | movie : movie_id , title , year , director , budget_million , gross_worldwide | culture_company : company_name , type , incorporated_in , group_equity_shareholding , book_club_id , movie_id | culture_company.movie_id = movie.movie_id | culture_company.book_club_id = book_club.book_club_id | 

### Response:

select year , book_title , publisher from book_club order by year desc

### Instruction:

Convert text to sql: What are the years, titles, and publishers for all books, ordered by year descending? | book_club : book_club_id , year , author_or_editor , book_title , publisher , category , result | movie : movie_id , title , year , director , budget_million , gross_worldwide | culture_company : company_name , type , incorporated_in , group_equity_shareholding , book_club_id , movie_id | culture_company.movie_id = movie.movie_id | culture_company.book_club_id = book_club.book_club_id | 

### Response:

select year , book_title , publisher from book_club order by year desc

### Instruction:

Convert text to sql: Show all publishers and the number of books for each publisher. | book_club : book_club_id , year , author_or_editor , book_title , publisher , category , result | movie : movie_id , title , year , director , budget_million , gross_worldwide | culture_company : company_name , type , incorporated_in , group_equity_shareholding , book_club_id , movie_id | culture_company.movie_id = movie.movie_id | culture_company.book_club_id = book_club.book_club_id | 

### Response:

select publisher , count ( * ) from book_club group by publisher

### Instruction:

Convert text to sql: How many books are there for each publisher? | book_club : book_club_id , year , author_or_editor , book_title , publisher , category , result | movie : movie_id , title , year , director , budget_million , gross_worldwide | culture_company : company_name , type , incorporated_in , group_equity_shareholding , book_club_id , movie_id | culture_company.movie_id = movie.movie_id | culture_company.book_club_id = book_club.book_club_id | 

### Response:

select publisher , count ( * ) from book_club group by publisher