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

Convert text to sql: Which student's age is older than 18 and is majoring in 600? List each student's first and last name. | student : stuid , lname , fname , age , sex , major , advisor , city_code | restaurant : resid , resname , address , rating | type_of_restaurant : resid , restypeid | restaurant_type : restypeid , restypename , restypedescription | visits_restaurant : stuid , resid , time , spent | type_of_restaurant.restypeid = restaurant_type.restypeid | type_of_restaurant.resid = restaurant.resid | visits_restaurant.resid = restaurant.resid | visits_restaurant.stuid = student.stuid | 

### Response:

select _ from _ where _ | select fname , lname from student where age > 18 and major = 600
### Instruction:

Convert text to sql: List all female students age is older than 18 who is not majoring in 600. List students' first name and last name. | student : stuid , lname , fname , age , sex , major , advisor , city_code | restaurant : resid , resname , address , rating | type_of_restaurant : resid , restypeid | restaurant_type : restypeid , restypename , restypedescription | visits_restaurant : stuid , resid , time , spent | type_of_restaurant.restypeid = restaurant_type.restypeid | type_of_restaurant.resid = restaurant.resid | visits_restaurant.resid = restaurant.resid | visits_restaurant.stuid = student.stuid | 

### Response:

select _ from _ where _ | select fname , lname from student where age > 18 and major != 600 and sex = 'F'
### Instruction:

Convert text to sql: How many restaurant is the Sandwich type restaurant? | student : stuid , lname , fname , age , sex , major , advisor , city_code | restaurant : resid , resname , address , rating | type_of_restaurant : resid , restypeid | restaurant_type : restypeid , restypename , restypedescription | visits_restaurant : stuid , resid , time , spent | type_of_restaurant.restypeid = restaurant_type.restypeid | type_of_restaurant.resid = restaurant.resid | visits_restaurant.resid = restaurant.resid | visits_restaurant.stuid = student.stuid | 

### Response:

select count ( _ ) from _ group by _ having _ | select count ( * ) from restaurant join type_of_restaurant on restaurant.resid = type_of_restaurant.resid join restaurant_type on type_of_restaurant.restypeid = restaurant_type.restypeid group by type_of_restaurant.restypeid having restaurant_type.restypename = 'Sandwich'
### Instruction:

Convert text to sql: How long does student Linda Smith spend on the restaurant in total? | student : stuid , lname , fname , age , sex , major , advisor , city_code | restaurant : resid , resname , address , rating | type_of_restaurant : resid , restypeid | restaurant_type : restypeid , restypename , restypedescription | visits_restaurant : stuid , resid , time , spent | type_of_restaurant.restypeid = restaurant_type.restypeid | type_of_restaurant.resid = restaurant.resid | visits_restaurant.resid = restaurant.resid | visits_restaurant.stuid = student.stuid | 

### Response:

select sum ( _ ) from _ where _ | select sum ( spent ) from student join visits_restaurant on student.stuid = visits_restaurant.stuid where student.fname = 'Linda' and student.lname = 'Smith'
### Instruction:

Convert text to sql: How many times has the student Linda Smith visited Subway? | student : stuid , lname , fname , age , sex , major , advisor , city_code | restaurant : resid , resname , address , rating | type_of_restaurant : resid , restypeid | restaurant_type : restypeid , restypename , restypedescription | visits_restaurant : stuid , resid , time , spent | type_of_restaurant.restypeid = restaurant_type.restypeid | type_of_restaurant.resid = restaurant.resid | visits_restaurant.resid = restaurant.resid | visits_restaurant.stuid = student.stuid | 

### Response:

select count ( _ ) from _ where _ | select count ( * ) from student join visits_restaurant on student.stuid = visits_restaurant.stuid join restaurant on visits_restaurant.resid = restaurant.resid where student.fname = 'Linda' and student.lname = 'Smith' and restaurant.resname = 'Subway'
### Instruction:

Convert text to sql: When did Linda Smith visit Subway? | student : stuid , lname , fname , age , sex , major , advisor , city_code | restaurant : resid , resname , address , rating | type_of_restaurant : resid , restypeid | restaurant_type : restypeid , restypename , restypedescription | visits_restaurant : stuid , resid , time , spent | type_of_restaurant.restypeid = restaurant_type.restypeid | type_of_restaurant.resid = restaurant.resid | visits_restaurant.resid = restaurant.resid | visits_restaurant.stuid = student.stuid | 

### Response:

select _ from _ where _ | select time from student join visits_restaurant on student.stuid = visits_restaurant.stuid join restaurant on visits_restaurant.resid = restaurant.resid where student.fname = 'Linda' and student.lname = 'Smith' and restaurant.resname = 'Subway'
### Instruction:

Convert text to sql: At which restaurant did the students spend the least amount of time? List restaurant and the time students spent on in total. | student : stuid , lname , fname , age , sex , major , advisor , city_code | restaurant : resid , resname , address , rating | type_of_restaurant : resid , restypeid | restaurant_type : restypeid , restypename , restypedescription | visits_restaurant : stuid , resid , time , spent | type_of_restaurant.restypeid = restaurant_type.restypeid | type_of_restaurant.resid = restaurant.resid | visits_restaurant.resid = restaurant.resid | visits_restaurant.stuid = student.stuid | 

### Response:

select _ , sum ( _ ) from _ group by _ order by sum ( _ ) asc limit _ | select restaurant.resname , sum ( visits_restaurant.spent ) from visits_restaurant join restaurant on visits_restaurant.resid = restaurant.resid group by restaurant.resid order by sum ( visits_restaurant.spent ) asc limit 1
### Instruction:

Convert text to sql: Which student visited restaurant most often? List student's first name and last name. | student : stuid , lname , fname , age , sex , major , advisor , city_code | restaurant : resid , resname , address , rating | type_of_restaurant : resid , restypeid | restaurant_type : restypeid , restypename , restypedescription | visits_restaurant : stuid , resid , time , spent | type_of_restaurant.restypeid = restaurant_type.restypeid | type_of_restaurant.resid = restaurant.resid | visits_restaurant.resid = restaurant.resid | visits_restaurant.stuid = student.stuid | 

### Response:

select _ from _ group by _ order by count ( _ ) desc limit _ | select student.fname , student.lname from student join visits_restaurant on student.stuid = visits_restaurant.stuid group by student.stuid order by count ( * ) desc limit 1
### Instruction:

Convert text to sql: Find the ids of orders whose status is 'Success'. | products : product_id , product_name , product_price , product_description | addresses : address_id , address_details , city , zip_postcode , state_province_county , country | customers : customer_id , payment_method , customer_name , customer_phone , customer_email , date_became_customer | regular_orders : regular_order_id , distributer_id | regular_order_products : regular_order_id , product_id | actual_orders : actual_order_id , order_status_code , regular_order_id , actual_order_date | actual_order_products : actual_order_id , product_id | customer_addresses : customer_id , address_id , date_from , address_type , date_to | delivery_routes : route_id , route_name , other_route_details | delivery_route_locations : location_code , route_id , location_address_id , location_name | trucks : truck_id , truck_licence_number , truck_details | employees : employee_id , employee_address_id , employee_name , employee_phone | order_deliveries : location_code , actual_order_id , delivery_status_code , driver_employee_id , truck_id , delivery_date | regular_orders.distributer_id = customers.customer_id | regular_order_products.regular_order_id = regular_orders.regular_order_id | regular_order_products.product_id = products.product_id | actual_orders.regular_order_id = regular_orders.regular_order_id | actual_order_products.actual_order_id = actual_orders.actual_order_id | actual_order_products.product_id = products.product_id | customer_addresses.address_id = addresses.address_id | customer_addresses.customer_id = customers.customer_id | delivery_route_locations.route_id = delivery_routes.route_id | delivery_route_locations.location_address_id = addresses.address_id | employees.employee_address_id = addresses.address_id | order_deliveries.driver_employee_id = employees.employee_id | order_deliveries.location_code = delivery_route_locations.location_code | order_deliveries.actual_order_id = actual_orders.actual_order_id | order_deliveries.truck_id = trucks.truck_id | 

### Response:

select _ from _ where _ | select actual_order_id from actual_orders where order_status_code = 'Success'
### Instruction:

Convert text to sql: Find the name and price of the product that has been ordered the greatest number of times. | products : product_id , product_name , product_price , product_description | addresses : address_id , address_details , city , zip_postcode , state_province_county , country | customers : customer_id , payment_method , customer_name , customer_phone , customer_email , date_became_customer | regular_orders : regular_order_id , distributer_id | regular_order_products : regular_order_id , product_id | actual_orders : actual_order_id , order_status_code , regular_order_id , actual_order_date | actual_order_products : actual_order_id , product_id | customer_addresses : customer_id , address_id , date_from , address_type , date_to | delivery_routes : route_id , route_name , other_route_details | delivery_route_locations : location_code , route_id , location_address_id , location_name | trucks : truck_id , truck_licence_number , truck_details | employees : employee_id , employee_address_id , employee_name , employee_phone | order_deliveries : location_code , actual_order_id , delivery_status_code , driver_employee_id , truck_id , delivery_date | regular_orders.distributer_id = customers.customer_id | regular_order_products.regular_order_id = regular_orders.regular_order_id | regular_order_products.product_id = products.product_id | actual_orders.regular_order_id = regular_orders.regular_order_id | actual_order_products.actual_order_id = actual_orders.actual_order_id | actual_order_products.product_id = products.product_id | customer_addresses.address_id = addresses.address_id | customer_addresses.customer_id = customers.customer_id | delivery_route_locations.route_id = delivery_routes.route_id | delivery_route_locations.location_address_id = addresses.address_id | employees.employee_address_id = addresses.address_id | order_deliveries.driver_employee_id = employees.employee_id | order_deliveries.location_code = delivery_route_locations.location_code | order_deliveries.actual_order_id = actual_orders.actual_order_id | order_deliveries.truck_id = trucks.truck_id | 

### Response:

select _ from _ group by _ order by count ( _ ) desc limit _ | select products.product_name , products.product_price from products join regular_order_products on products.product_id = regular_order_products.product_id group by regular_order_products.product_id order by count ( * ) desc limit 1
### Instruction:

Convert text to sql: Find the number of customers in total. | products : product_id , product_name , product_price , product_description | addresses : address_id , address_details , city , zip_postcode , state_province_county , country | customers : customer_id , payment_method , customer_name , customer_phone , customer_email , date_became_customer | regular_orders : regular_order_id , distributer_id | regular_order_products : regular_order_id , product_id | actual_orders : actual_order_id , order_status_code , regular_order_id , actual_order_date | actual_order_products : actual_order_id , product_id | customer_addresses : customer_id , address_id , date_from , address_type , date_to | delivery_routes : route_id , route_name , other_route_details | delivery_route_locations : location_code , route_id , location_address_id , location_name | trucks : truck_id , truck_licence_number , truck_details | employees : employee_id , employee_address_id , employee_name , employee_phone | order_deliveries : location_code , actual_order_id , delivery_status_code , driver_employee_id , truck_id , delivery_date | regular_orders.distributer_id = customers.customer_id | regular_order_products.regular_order_id = regular_orders.regular_order_id | regular_order_products.product_id = products.product_id | actual_orders.regular_order_id = regular_orders.regular_order_id | actual_order_products.actual_order_id = actual_orders.actual_order_id | actual_order_products.product_id = products.product_id | customer_addresses.address_id = addresses.address_id | customer_addresses.customer_id = customers.customer_id | delivery_route_locations.route_id = delivery_routes.route_id | delivery_route_locations.location_address_id = addresses.address_id | employees.employee_address_id = addresses.address_id | order_deliveries.driver_employee_id = employees.employee_id | order_deliveries.location_code = delivery_route_locations.location_code | order_deliveries.actual_order_id = actual_orders.actual_order_id | order_deliveries.truck_id = trucks.truck_id | 

### Response:

select count ( _ ) from _ | select count ( * ) from customers
### Instruction:

Convert text to sql: How many different payment methods are there? | products : product_id , product_name , product_price , product_description | addresses : address_id , address_details , city , zip_postcode , state_province_county , country | customers : customer_id , payment_method , customer_name , customer_phone , customer_email , date_became_customer | regular_orders : regular_order_id , distributer_id | regular_order_products : regular_order_id , product_id | actual_orders : actual_order_id , order_status_code , regular_order_id , actual_order_date | actual_order_products : actual_order_id , product_id | customer_addresses : customer_id , address_id , date_from , address_type , date_to | delivery_routes : route_id , route_name , other_route_details | delivery_route_locations : location_code , route_id , location_address_id , location_name | trucks : truck_id , truck_licence_number , truck_details | employees : employee_id , employee_address_id , employee_name , employee_phone | order_deliveries : location_code , actual_order_id , delivery_status_code , driver_employee_id , truck_id , delivery_date | regular_orders.distributer_id = customers.customer_id | regular_order_products.regular_order_id = regular_orders.regular_order_id | regular_order_products.product_id = products.product_id | actual_orders.regular_order_id = regular_orders.regular_order_id | actual_order_products.actual_order_id = actual_orders.actual_order_id | actual_order_products.product_id = products.product_id | customer_addresses.address_id = addresses.address_id | customer_addresses.customer_id = customers.customer_id | delivery_route_locations.route_id = delivery_routes.route_id | delivery_route_locations.location_address_id = addresses.address_id | employees.employee_address_id = addresses.address_id | order_deliveries.driver_employee_id = employees.employee_id | order_deliveries.location_code = delivery_route_locations.location_code | order_deliveries.actual_order_id = actual_orders.actual_order_id | order_deliveries.truck_id = trucks.truck_id | 

### Response:

select count ( distinct _ ) from _ | select count ( distinct payment_method ) from customers
### Instruction:

Convert text to sql: Show the details of all trucks in the order of their license number. | products : product_id , product_name , product_price , product_description | addresses : address_id , address_details , city , zip_postcode , state_province_county , country | customers : customer_id , payment_method , customer_name , customer_phone , customer_email , date_became_customer | regular_orders : regular_order_id , distributer_id | regular_order_products : regular_order_id , product_id | actual_orders : actual_order_id , order_status_code , regular_order_id , actual_order_date | actual_order_products : actual_order_id , product_id | customer_addresses : customer_id , address_id , date_from , address_type , date_to | delivery_routes : route_id , route_name , other_route_details | delivery_route_locations : location_code , route_id , location_address_id , location_name | trucks : truck_id , truck_licence_number , truck_details | employees : employee_id , employee_address_id , employee_name , employee_phone | order_deliveries : location_code , actual_order_id , delivery_status_code , driver_employee_id , truck_id , delivery_date | regular_orders.distributer_id = customers.customer_id | regular_order_products.regular_order_id = regular_orders.regular_order_id | regular_order_products.product_id = products.product_id | actual_orders.regular_order_id = regular_orders.regular_order_id | actual_order_products.actual_order_id = actual_orders.actual_order_id | actual_order_products.product_id = products.product_id | customer_addresses.address_id = addresses.address_id | customer_addresses.customer_id = customers.customer_id | delivery_route_locations.route_id = delivery_routes.route_id | delivery_route_locations.location_address_id = addresses.address_id | employees.employee_address_id = addresses.address_id | order_deliveries.driver_employee_id = employees.employee_id | order_deliveries.location_code = delivery_route_locations.location_code | order_deliveries.actual_order_id = actual_orders.actual_order_id | order_deliveries.truck_id = trucks.truck_id | 

### Response:

select _ from _ order by _ asc | select truck_details from trucks order by truck_licence_number asc
### Instruction:

Convert text to sql: Find the name of the most expensive product. | products : product_id , product_name , product_price , product_description | addresses : address_id , address_details , city , zip_postcode , state_province_county , country | customers : customer_id , payment_method , customer_name , customer_phone , customer_email , date_became_customer | regular_orders : regular_order_id , distributer_id | regular_order_products : regular_order_id , product_id | actual_orders : actual_order_id , order_status_code , regular_order_id , actual_order_date | actual_order_products : actual_order_id , product_id | customer_addresses : customer_id , address_id , date_from , address_type , date_to | delivery_routes : route_id , route_name , other_route_details | delivery_route_locations : location_code , route_id , location_address_id , location_name | trucks : truck_id , truck_licence_number , truck_details | employees : employee_id , employee_address_id , employee_name , employee_phone | order_deliveries : location_code , actual_order_id , delivery_status_code , driver_employee_id , truck_id , delivery_date | regular_orders.distributer_id = customers.customer_id | regular_order_products.regular_order_id = regular_orders.regular_order_id | regular_order_products.product_id = products.product_id | actual_orders.regular_order_id = regular_orders.regular_order_id | actual_order_products.actual_order_id = actual_orders.actual_order_id | actual_order_products.product_id = products.product_id | customer_addresses.address_id = addresses.address_id | customer_addresses.customer_id = customers.customer_id | delivery_route_locations.route_id = delivery_routes.route_id | delivery_route_locations.location_address_id = addresses.address_id | employees.employee_address_id = addresses.address_id | order_deliveries.driver_employee_id = employees.employee_id | order_deliveries.location_code = delivery_route_locations.location_code | order_deliveries.actual_order_id = actual_orders.actual_order_id | order_deliveries.truck_id = trucks.truck_id | 

### Response:

select _ from _ order by _ desc limit _ | select product_name from products order by product_price desc limit 1
### Instruction:

Convert text to sql: Find the names of customers who are not living in the state of California. | products : product_id , product_name , product_price , product_description | addresses : address_id , address_details , city , zip_postcode , state_province_county , country | customers : customer_id , payment_method , customer_name , customer_phone , customer_email , date_became_customer | regular_orders : regular_order_id , distributer_id | regular_order_products : regular_order_id , product_id | actual_orders : actual_order_id , order_status_code , regular_order_id , actual_order_date | actual_order_products : actual_order_id , product_id | customer_addresses : customer_id , address_id , date_from , address_type , date_to | delivery_routes : route_id , route_name , other_route_details | delivery_route_locations : location_code , route_id , location_address_id , location_name | trucks : truck_id , truck_licence_number , truck_details | employees : employee_id , employee_address_id , employee_name , employee_phone | order_deliveries : location_code , actual_order_id , delivery_status_code , driver_employee_id , truck_id , delivery_date | regular_orders.distributer_id = customers.customer_id | regular_order_products.regular_order_id = regular_orders.regular_order_id | regular_order_products.product_id = products.product_id | actual_orders.regular_order_id = regular_orders.regular_order_id | actual_order_products.actual_order_id = actual_orders.actual_order_id | actual_order_products.product_id = products.product_id | customer_addresses.address_id = addresses.address_id | customer_addresses.customer_id = customers.customer_id | delivery_route_locations.route_id = delivery_routes.route_id | delivery_route_locations.location_address_id = addresses.address_id | employees.employee_address_id = addresses.address_id | order_deliveries.driver_employee_id = employees.employee_id | order_deliveries.location_code = delivery_route_locations.location_code | order_deliveries.actual_order_id = actual_orders.actual_order_id | order_deliveries.truck_id = trucks.truck_id | 

### Response:

select _ from _ except select _ from _ where _ | select customer_name from customers except select customers.customer_name from customers join customer_addresses on customers.customer_id = customer_addresses.customer_id join addresses on customer_addresses.address_id = addresses.address_id where addresses.state_province_county = 'California'