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

Convert text to sql: Show the different nationalities and the number of journalists of each nationality. | event : event_id , date , venue , name , event_attendance | journalist : journalist_id , name , nationality , age , years_working | news_report : journalist_id , event_id , work_type | news_report.event_id = event.event_id | news_report.journalist_id = journalist.journalist_id | 

### Response:

select nationality , count ( * ) from journalist group by nationality

### Instruction:

Convert text to sql: Show the most common nationality for journalists. | event : event_id , date , venue , name , event_attendance | journalist : journalist_id , name , nationality , age , years_working | news_report : journalist_id , event_id , work_type | news_report.event_id = event.event_id | news_report.journalist_id = journalist.journalist_id | 

### Response:

select nationality from journalist group by nationality order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: Show the nations that have both journalists with more than 10 years of working and journalists with less than 3 years of working. | event : event_id , date , venue , name , event_attendance | journalist : journalist_id , name , nationality , age , years_working | news_report : journalist_id , event_id , work_type | news_report.event_id = event.event_id | news_report.journalist_id = journalist.journalist_id | 

### Response:

select nationality from journalist where years_working > 10 intersect select nationality from journalist where years_working < 3

### Instruction:

Convert text to sql: Show the dates, places, and names of events in descending order of the attendance. | event : event_id , date , venue , name , event_attendance | journalist : journalist_id , name , nationality , age , years_working | news_report : journalist_id , event_id , work_type | news_report.event_id = event.event_id | news_report.journalist_id = journalist.journalist_id | 

### Response:

select date , name , venue from event order by event_attendance desc

### Instruction:

Convert text to sql: Show the names of journalists and the dates of the events they reported. | event : event_id , date , venue , name , event_attendance | journalist : journalist_id , name , nationality , age , years_working | news_report : journalist_id , event_id , work_type | news_report.event_id = event.event_id | news_report.journalist_id = journalist.journalist_id | 

### Response:

select journalist.name , event.date from news_report join event on news_report.event_id = event.event_id join journalist on news_report.journalist_id = journalist.journalist_id
### Instruction:

Convert text to sql: Show the names of journalists and the names of the events they reported in ascending order | event : event_id , date , venue , name , event_attendance | journalist : journalist_id , name , nationality , age , years_working | news_report : journalist_id , event_id , work_type | news_report.event_id = event.event_id | news_report.journalist_id = journalist.journalist_id | 

### Response:

select journalist.name , event.name from news_report join event on news_report.event_id = event.event_id join journalist on news_report.journalist_id = journalist.journalist_id order by event.event_attendance asc

### Instruction:

Convert text to sql: Show the names of journalists and the number of events they reported. | event : event_id , date , venue , name , event_attendance | journalist : journalist_id , name , nationality , age , years_working | news_report : journalist_id , event_id , work_type | news_report.event_id = event.event_id | news_report.journalist_id = journalist.journalist_id | 

### Response:

select journalist.name , count ( * ) from news_report join event on news_report.event_id = event.event_id join journalist on news_report.journalist_id = journalist.journalist_id group by journalist.name

### Instruction:

Convert text to sql: Show the names of journalists that have reported more than one event. | event : event_id , date , venue , name , event_attendance | journalist : journalist_id , name , nationality , age , years_working | news_report : journalist_id , event_id , work_type | news_report.event_id = event.event_id | news_report.journalist_id = journalist.journalist_id | 

### Response:

select journalist.name from news_report join event on news_report.event_id = event.event_id join journalist on news_report.journalist_id = journalist.journalist_id group by journalist.name having count ( * ) > 1

### Instruction:

Convert text to sql: List the names of journalists who have not reported any event. | event : event_id , date , venue , name , event_attendance | journalist : journalist_id , name , nationality , age , years_working | news_report : journalist_id , event_id , work_type | news_report.event_id = event.event_id | news_report.journalist_id = journalist.journalist_id | 

### Response:

select name from journalist where journalist_id not in ( select journalist_id from news_report )

### Instruction:

Convert text to sql: what are the average and maximum attendances of all events? | event : event_id , date , venue , name , event_attendance | journalist : journalist_id , name , nationality , age , years_working | news_report : journalist_id , event_id , work_type | news_report.event_id = event.event_id | news_report.journalist_id = journalist.journalist_id | 

### Response:

select avg ( event_attendance ) , max ( event_attendance ) from event
### Instruction:

Convert text to sql: Find the average age and experience working length of journalists working on different role type. | event : event_id , date , venue , name , event_attendance | journalist : journalist_id , name , nationality , age , years_working | news_report : journalist_id , event_id , work_type | news_report.event_id = event.event_id | news_report.journalist_id = journalist.journalist_id | 

### Response:

select avg ( journalist.age ) , avg ( years_working ) , news_report.work_type from journalist join news_report on journalist.journalist_id = news_report.journalist_id group by news_report.work_type

### Instruction:

Convert text to sql: List the event venues and names that have the top 2 most number of people attended. | event : event_id , date , venue , name , event_attendance | journalist : journalist_id , name , nationality , age , years_working | news_report : journalist_id , event_id , work_type | news_report.event_id = event.event_id | news_report.journalist_id = journalist.journalist_id | 

### Response:

select venue , name from event order by event_attendance desc limit 2
### Instruction:

Convert text to sql: Show me all the restaurants. | 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 resname from restaurant

### Instruction:

Convert text to sql: What is the address of the restaurant 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 address from restaurant where resname = 'Subway'

### Instruction:

Convert text to sql: What is the rating of the restaurant 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 rating from restaurant where resname = 'Subway'

### Instruction:

Convert text to sql: List all restaurant types. | 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 restypename from restaurant_type

### Instruction:

Convert text to sql: What is the description of the restaurant type Sandwich? | 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 restypedescription from restaurant_type where restypename = 'Sandwich'
### Instruction:

Convert text to sql: Which restaurants have highest rating? List the restaurant name and its rating. | 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 resname , rating from restaurant order by rating desc limit 1

### Instruction:

Convert text to sql: What is the age of student Linda Smith? | 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 age from student where fname = 'Linda' and lname = 'Smith'

### Instruction:

Convert text to sql: What is the gender of the student Linda Smith? | 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 sex from student where fname = 'Linda' and lname = 'Smith'

### Instruction:

Convert text to sql: List all students' first names and last names who majored in 600. | 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 fname , lname from student where major = 600
### Instruction:

Convert text to sql: Which city does student Linda Smith live in? | 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 city_code from student where fname = 'Linda' and lname = 'Smith'

### Instruction:

Convert text to sql: Advisor 1121 has how many students? | 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 student where advisor = 1121

### Instruction:

Convert text to sql: Which Advisor has most of students? List advisor and the number of students. | 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 advisor , count ( * ) from student group by advisor order by count ( advisor ) desc limit 1

### Instruction:

Convert text to sql: Which major has least number of students? List the major and the number of students. | 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 major , count ( * ) from student group by major order by count ( major ) asc limit 1
### Instruction:

Convert text to sql: Which major has between 2 and 30 number of students? List major and the number of students. | 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 major , count ( * ) from student group by major having count ( major ) between 2 and 30

### 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 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 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 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 ( 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 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 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 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 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 actual_order_id from actual_orders where order_status_code = 'Success'