db_id
stringlengths 4
31
| text
stringlengths 370
4.84k
|
---|---|
election | 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 committees have delegates from both democratic party and liberal party? | county : county_id , county_name , population , zip_code | party : party_id , year , party , governor , lieutenant_governor , comptroller , attorney_general , us_senate | election : election_id , counties_represented , district , delegate , party , first_elected , committee | election.district = county.county_id | election.party = party.party_id |
### Response:
select election.committee from election join party on election.party = party.party_id where party.party = 'Democratic' intersect select election.committee from election join party on election.party = party.party_id where party.party = 'Liberal' |
election | 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 committees that have delegates both from from the democratic party and the liberal party. | county : county_id , county_name , population , zip_code | party : party_id , year , party , governor , lieutenant_governor , comptroller , attorney_general , us_senate | election : election_id , counties_represented , district , delegate , party , first_elected , committee | election.district = county.county_id | election.party = party.party_id |
### Response:
select election.committee from election join party on election.party = party.party_id where party.party = 'Democratic' intersect select election.committee from election join party on election.party = party.party_id where party.party = 'Liberal' |
news_report | 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 journalists are there? | 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 count ( * ) from journalist |
news_report | 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 names of journalists in ascending order of years 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 name from journalist order by years_working asc |
news_report | 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 nationalities and ages of 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 , age from journalist |
news_report | 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 names of journalists from "England" or "Wales". | 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 nationality = 'England' or nationality = 'Wales' |
news_report | 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 number of years spent working as a journalist? | 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 ( years_working ) from journalist |
news_report | 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 nationality of the journalist with the largest number of years 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 order by years_working desc limit 1 |
news_report | 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 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 |
news_report | 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 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 |
news_report | 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 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 |
news_report | 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 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 |
news_report | 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 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 |
news_report | 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 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 |
news_report | 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 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 |
news_report | 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 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 |
news_report | 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 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 ) |
news_report | 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 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 |
news_report | 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 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 |
news_report | 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 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 |
restaurant_1 | 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 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 |
restaurant_1 | 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 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' |
restaurant_1 | 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 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' |
restaurant_1 | 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 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 |
restaurant_1 | 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 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' |
restaurant_1 | 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 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 |
restaurant_1 | 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 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' |
restaurant_1 | 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 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' |
restaurant_1 | 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 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 |
restaurant_1 | 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 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' |
restaurant_1 | 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: 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 |
restaurant_1 | 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 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 |
restaurant_1 | 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 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 |
restaurant_1 | 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 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 |
restaurant_1 | 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 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 |
restaurant_1 | 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 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' |
restaurant_1 | 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 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' |
restaurant_1 | 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 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' |
restaurant_1 | 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 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' |
restaurant_1 | 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: 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' |
restaurant_1 | 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: 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 |
restaurant_1 | 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 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 |
customer_deliveries | 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 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' |
customer_deliveries | 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 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 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 |
customer_deliveries | 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 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 customers |
customer_deliveries | 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 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 payment_method ) from customers |
customer_deliveries | 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 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 truck_details from trucks order by truck_licence_number asc |
customer_deliveries | 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 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 product_name from products order by product_price desc limit 1 |
customer_deliveries | 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 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 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' |
customer_deliveries | 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 names and emails of customers who payed by Visa card. | 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 customer_email , customer_name from customers where payment_method = 'Visa' |
customer_deliveries | 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 names and phone numbers of customers living in California state. | 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 customers.customer_name , customers.customer_phone 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' |
customer_deliveries | 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 states which do not have any employee in their record. | 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 state_province_county from addresses where address_id not in ( select employee_address_id from employees ) |
customer_deliveries | 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 names, phone numbers, and emails of all customers sorted by their dates of becoming customers. | 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 customer_name , customer_phone , customer_email from customers order by date_became_customer asc |
customer_deliveries | 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 the first 5 customers. | 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 customer_name from customers order by date_became_customer asc limit 5 |
customer_deliveries | 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 payment method that is used most frequently. | 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 payment_method from customers group by payment_method order by count ( * ) desc limit 1 |
customer_deliveries | 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 names of all routes in alphabetic order. | 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 route_name from delivery_routes order by route_name asc |
customer_deliveries | 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 route that has the highest number of deliveries. | 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 delivery_routes.route_name from delivery_routes join delivery_route_locations on delivery_routes.route_id = delivery_route_locations.route_id group by delivery_routes.route_id order by count ( * ) desc limit 1 |
customer_deliveries | 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 state names and the number of customers living in each state. | 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 addresses.state_province_county , count ( * ) from customer_addresses join addresses on customer_addresses.address_id = addresses.address_id group by addresses.state_province_county |
icfp_1 | 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 authors are there? | inst : instid , name , country | authors : authid , lname , fname | papers : paperid , title | authorship : authid , instid , paperid , authorder | authorship.paperid = papers.paperid | authorship.instid = inst.instid | authorship.authid = authors.authid |
### Response:
select count ( * ) from authors |
icfp_1 | 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 authors. | inst : instid , name , country | authors : authid , lname , fname | papers : paperid , title | authorship : authid , instid , paperid , authorder | authorship.paperid = papers.paperid | authorship.instid = inst.instid | authorship.authid = authors.authid |
### Response:
select count ( * ) from authors |
icfp_1 | 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 institutions are there? | inst : instid , name , country | authors : authid , lname , fname | papers : paperid , title | authorship : authid , instid , paperid , authorder | authorship.paperid = papers.paperid | authorship.instid = inst.instid | authorship.authid = authors.authid |
### Response:
select count ( * ) from inst |
icfp_1 | 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 institutions. | inst : instid , name , country | authors : authid , lname , fname | papers : paperid , title | authorship : authid , instid , paperid , authorder | authorship.paperid = papers.paperid | authorship.instid = inst.instid | authorship.authid = authors.authid |
### Response:
select count ( * ) from inst |
icfp_1 | 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 papers are published in total? | inst : instid , name , country | authors : authid , lname , fname | papers : paperid , title | authorship : authid , instid , paperid , authorder | authorship.paperid = papers.paperid | authorship.instid = inst.instid | authorship.authid = authors.authid |
### Response:
select count ( * ) from papers |
icfp_1 | 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 total papers. | inst : instid , name , country | authors : authid , lname , fname | papers : paperid , title | authorship : authid , instid , paperid , authorder | authorship.paperid = papers.paperid | authorship.instid = inst.instid | authorship.authid = authors.authid |
### Response:
select count ( * ) from papers |
icfp_1 | 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 titles of papers published by "Jeremy Gibbons"? | inst : instid , name , country | authors : authid , lname , fname | papers : paperid , title | authorship : authid , instid , paperid , authorder | authorship.paperid = papers.paperid | authorship.instid = inst.instid | authorship.authid = authors.authid |
### Response:
select papers.title from authors join authorship on authors.authid = authorship.authid join papers on authorship.paperid = papers.paperid where authors.fname = 'Jeremy' and authors.lname = 'Gibbons' |
icfp_1 | 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 titles of all the papers written by "Jeremy Gibbons" | inst : instid , name , country | authors : authid , lname , fname | papers : paperid , title | authorship : authid , instid , paperid , authorder | authorship.paperid = papers.paperid | authorship.instid = inst.instid | authorship.authid = authors.authid |
### Response:
select papers.title from authors join authorship on authors.authid = authorship.authid join papers on authorship.paperid = papers.paperid where authors.fname = 'Jeremy' and authors.lname = 'Gibbons' |
icfp_1 | 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 all the papers published by "Aaron Turon". | inst : instid , name , country | authors : authid , lname , fname | papers : paperid , title | authorship : authid , instid , paperid , authorder | authorship.paperid = papers.paperid | authorship.instid = inst.instid | authorship.authid = authors.authid |
### Response:
select papers.title from authors join authorship on authors.authid = authorship.authid join papers on authorship.paperid = papers.paperid where authors.fname = 'Aaron' and authors.lname = 'Turon' |
icfp_1 | 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 titles of all the papers written by "Aaron Turon". | inst : instid , name , country | authors : authid , lname , fname | papers : paperid , title | authorship : authid , instid , paperid , authorder | authorship.paperid = papers.paperid | authorship.instid = inst.instid | authorship.authid = authors.authid |
### Response:
select papers.title from authors join authorship on authors.authid = authorship.authid join papers on authorship.paperid = papers.paperid where authors.fname = 'Aaron' and authors.lname = 'Turon' |
icfp_1 | 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 papers have "Atsushi Ohori" published? | inst : instid , name , country | authors : authid , lname , fname | papers : paperid , title | authorship : authid , instid , paperid , authorder | authorship.paperid = papers.paperid | authorship.instid = inst.instid | authorship.authid = authors.authid |
### Response:
select count ( * ) from authors join authorship on authors.authid = authorship.authid join papers on authorship.paperid = papers.paperid where authors.fname = 'Atsushi' and authors.lname = 'Ohori' |
icfp_1 | 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 papers are "Atsushi Ohori" the author of? | inst : instid , name , country | authors : authid , lname , fname | papers : paperid , title | authorship : authid , instid , paperid , authorder | authorship.paperid = papers.paperid | authorship.instid = inst.instid | authorship.authid = authors.authid |
### Response:
select count ( * ) from authors join authorship on authors.authid = authorship.authid join papers on authorship.paperid = papers.paperid where authors.fname = 'Atsushi' and authors.lname = 'Ohori' |
icfp_1 | 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 of the institution that "Matthias Blume" belongs to? | inst : instid , name , country | authors : authid , lname , fname | papers : paperid , title | authorship : authid , instid , paperid , authorder | authorship.paperid = papers.paperid | authorship.instid = inst.instid | authorship.authid = authors.authid |
### Response:
select distinct inst.name from authors join authorship on authors.authid = authorship.authid join inst on authorship.instid = inst.instid where authors.fname = 'Matthias' and authors.lname = 'Blume' |
icfp_1 | 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 institution is the author "Matthias Blume" belong to? Give me the name of the institution. | inst : instid , name , country | authors : authid , lname , fname | papers : paperid , title | authorship : authid , instid , paperid , authorder | authorship.paperid = papers.paperid | authorship.instid = inst.instid | authorship.authid = authors.authid |
### Response:
select distinct inst.name from authors join authorship on authors.authid = authorship.authid join inst on authorship.instid = inst.instid where authors.fname = 'Matthias' and authors.lname = 'Blume' |
icfp_1 | 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 institution does "Katsuhiro Ueno" belong to? | inst : instid , name , country | authors : authid , lname , fname | papers : paperid , title | authorship : authid , instid , paperid , authorder | authorship.paperid = papers.paperid | authorship.instid = inst.instid | authorship.authid = authors.authid |
### Response:
select distinct inst.name from authors join authorship on authors.authid = authorship.authid join inst on authorship.instid = inst.instid where authors.fname = 'Katsuhiro' and authors.lname = 'Ueno' |
icfp_1 | 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 of the institution the author "Katsuhiro Ueno" belongs to? | inst : instid , name , country | authors : authid , lname , fname | papers : paperid , title | authorship : authid , instid , paperid , authorder | authorship.paperid = papers.paperid | authorship.instid = inst.instid | authorship.authid = authors.authid |
### Response:
select distinct inst.name from authors join authorship on authors.authid = authorship.authid join inst on authorship.instid = inst.instid where authors.fname = 'Katsuhiro' and authors.lname = 'Ueno' |
icfp_1 | 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 belong to the institution "University of Oxford"? Show the first names and last names. | inst : instid , name , country | authors : authid , lname , fname | papers : paperid , title | authorship : authid , instid , paperid , authorder | authorship.paperid = papers.paperid | authorship.instid = inst.instid | authorship.authid = authors.authid |
### Response:
select distinct authors.fname , authors.lname from authors join authorship on authors.authid = authorship.authid join inst on authorship.instid = inst.instid where inst.name = 'University of Oxford' |
icfp_1 | 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 and last names of the authors whose institution affiliation is "University of Oxford". | inst : instid , name , country | authors : authid , lname , fname | papers : paperid , title | authorship : authid , instid , paperid , authorder | authorship.paperid = papers.paperid | authorship.instid = inst.instid | authorship.authid = authors.authid |
### Response:
select distinct authors.fname , authors.lname from authors join authorship on authors.authid = authorship.authid join inst on authorship.instid = inst.instid where inst.name = 'University of Oxford' |
icfp_1 | 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 authors belong to the institution "Google"? Show the first names and last names. | inst : instid , name , country | authors : authid , lname , fname | papers : paperid , title | authorship : authid , instid , paperid , authorder | authorship.paperid = papers.paperid | authorship.instid = inst.instid | authorship.authid = authors.authid |
### Response:
select distinct authors.fname , authors.lname from authors join authorship on authors.authid = authorship.authid join inst on authorship.instid = inst.instid where inst.name = 'Google' |
icfp_1 | 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 and last names of the authors whose institution affiliation is "Google". | inst : instid , name , country | authors : authid , lname , fname | papers : paperid , title | authorship : authid , instid , paperid , authorder | authorship.paperid = papers.paperid | authorship.instid = inst.instid | authorship.authid = authors.authid |
### Response:
select distinct authors.fname , authors.lname from authors join authorship on authors.authid = authorship.authid join inst on authorship.instid = inst.instid where inst.name = 'Google' |
icfp_1 | 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 the author of the paper titled "Binders Unbound"? | inst : instid , name , country | authors : authid , lname , fname | papers : paperid , title | authorship : authid , instid , paperid , authorder | authorship.paperid = papers.paperid | authorship.instid = inst.instid | authorship.authid = authors.authid |
### Response:
select authors.lname from authors join authorship on authors.authid = authorship.authid join papers on authorship.paperid = papers.paperid where papers.title = 'Binders Unbound' |
icfp_1 | 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 is the author of the paper titled "Binders Unbound"? Give me the last name. | inst : instid , name , country | authors : authid , lname , fname | papers : paperid , title | authorship : authid , instid , paperid , authorder | authorship.paperid = papers.paperid | authorship.instid = inst.instid | authorship.authid = authors.authid |
### Response:
select authors.lname from authors join authorship on authors.authid = authorship.authid join papers on authorship.paperid = papers.paperid where papers.title = 'Binders Unbound' |
icfp_1 | 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 the author(s) who wrote the paper "Nameless, Painless". | inst : instid , name , country | authors : authid , lname , fname | papers : paperid , title | authorship : authid , instid , paperid , authorder | authorship.paperid = papers.paperid | authorship.instid = inst.instid | authorship.authid = authors.authid |
### Response:
select authors.fname , authors.lname from authors join authorship on authors.authid = authorship.authid join papers on authorship.paperid = papers.paperid where papers.title = 'Nameless , Painless' |
icfp_1 | 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 name of the author who published the paper titled "Nameless, Painless"? | inst : instid , name , country | authors : authid , lname , fname | papers : paperid , title | authorship : authid , instid , paperid , authorder | authorship.paperid = papers.paperid | authorship.instid = inst.instid | authorship.authid = authors.authid |
### Response:
select authors.fname , authors.lname from authors join authorship on authors.authid = authorship.authid join papers on authorship.paperid = papers.paperid where papers.title = 'Nameless , Painless' |
icfp_1 | 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 papers published under the institution "Indiana University"? | inst : instid , name , country | authors : authid , lname , fname | papers : paperid , title | authorship : authid , instid , paperid , authorder | authorship.paperid = papers.paperid | authorship.instid = inst.instid | authorship.authid = authors.authid |
### Response:
select distinct papers.title from papers join authorship on papers.paperid = authorship.paperid join inst on authorship.instid = inst.instid where inst.name = 'Indiana University' |
icfp_1 | 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 titles of the papers whose authors are from the institution "Indiana University". | inst : instid , name , country | authors : authid , lname , fname | papers : paperid , title | authorship : authid , instid , paperid , authorder | authorship.paperid = papers.paperid | authorship.instid = inst.instid | authorship.authid = authors.authid |
### Response:
select distinct papers.title from papers join authorship on papers.paperid = authorship.paperid join inst on authorship.instid = inst.instid where inst.name = 'Indiana University' |
icfp_1 | 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 all the papers published by the institution "Google". | inst : instid , name , country | authors : authid , lname , fname | papers : paperid , title | authorship : authid , instid , paperid , authorder | authorship.paperid = papers.paperid | authorship.instid = inst.instid | authorship.authid = authors.authid |
### Response:
select distinct papers.title from papers join authorship on papers.paperid = authorship.paperid join inst on authorship.instid = inst.instid where inst.name = 'Google' |
icfp_1 | 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 papers were written by authors from the institution "Google"? | inst : instid , name , country | authors : authid , lname , fname | papers : paperid , title | authorship : authid , instid , paperid , authorder | authorship.paperid = papers.paperid | authorship.instid = inst.instid | authorship.authid = authors.authid |
### Response:
select distinct papers.title from papers join authorship on papers.paperid = authorship.paperid join inst on authorship.instid = inst.instid where inst.name = 'Google' |
icfp_1 | 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 papers are published by the institution "Tokohu University"? | inst : instid , name , country | authors : authid , lname , fname | papers : paperid , title | authorship : authid , instid , paperid , authorder | authorship.paperid = papers.paperid | authorship.instid = inst.instid | authorship.authid = authors.authid |
### Response:
select count ( distinct papers.title ) from papers join authorship on papers.paperid = authorship.paperid join inst on authorship.instid = inst.instid where inst.name = 'Tokohu University' |
icfp_1 | 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 papers published by authors from the institution "Tokohu University". | inst : instid , name , country | authors : authid , lname , fname | papers : paperid , title | authorship : authid , instid , paperid , authorder | authorship.paperid = papers.paperid | authorship.instid = inst.instid | authorship.authid = authors.authid |
### Response:
select count ( distinct papers.title ) from papers join authorship on papers.paperid = authorship.paperid join inst on authorship.instid = inst.instid where inst.name = 'Tokohu University' |
icfp_1 | 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 papers published by the institution "University of Pennsylvania". | inst : instid , name , country | authors : authid , lname , fname | papers : paperid , title | authorship : authid , instid , paperid , authorder | authorship.paperid = papers.paperid | authorship.instid = inst.instid | authorship.authid = authors.authid |
### Response:
select count ( distinct papers.title ) from papers join authorship on papers.paperid = authorship.paperid join inst on authorship.instid = inst.instid where inst.name = 'University of Pennsylvania' |
icfp_1 | 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 papers are written by authors from the institution "University of Pennsylvania"? | inst : instid , name , country | authors : authid , lname , fname | papers : paperid , title | authorship : authid , instid , paperid , authorder | authorship.paperid = papers.paperid | authorship.instid = inst.instid | authorship.authid = authors.authid |
### Response:
select count ( distinct papers.title ) from papers join authorship on papers.paperid = authorship.paperid join inst on authorship.instid = inst.instid where inst.name = 'University of Pennsylvania' |
icfp_1 | 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 papers which have "Olin Shivers" as an author. | inst : instid , name , country | authors : authid , lname , fname | papers : paperid , title | authorship : authid , instid , paperid , authorder | authorship.paperid = papers.paperid | authorship.instid = inst.instid | authorship.authid = authors.authid |
### Response:
select papers.title from authors join authorship on authors.authid = authorship.authid join papers on authorship.paperid = papers.paperid where authors.fname = 'Olin' and authors.lname = 'Shivers' |
icfp_1 | 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 papers did the author "Olin Shivers" write? Give me the paper titles. | inst : instid , name , country | authors : authid , lname , fname | papers : paperid , title | authorship : authid , instid , paperid , authorder | authorship.paperid = papers.paperid | authorship.instid = inst.instid | authorship.authid = authors.authid |
### Response:
select papers.title from authors join authorship on authors.authid = authorship.authid join papers on authorship.paperid = papers.paperid where authors.fname = 'Olin' and authors.lname = 'Shivers' |
icfp_1 | 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 papers have "Stephanie Weirich" as an author? | inst : instid , name , country | authors : authid , lname , fname | papers : paperid , title | authorship : authid , instid , paperid , authorder | authorship.paperid = papers.paperid | authorship.instid = inst.instid | authorship.authid = authors.authid |
### Response:
select papers.title from authors join authorship on authors.authid = authorship.authid join papers on authorship.paperid = papers.paperid where authors.fname = 'Stephanie' and authors.lname = 'Weirich' |
icfp_1 | 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 titles of the papers the author "Stephanie Weirich" wrote. | inst : instid , name , country | authors : authid , lname , fname | papers : paperid , title | authorship : authid , instid , paperid , authorder | authorship.paperid = papers.paperid | authorship.instid = inst.instid | authorship.authid = authors.authid |
### Response:
select papers.title from authors join authorship on authors.authid = authorship.authid join papers on authorship.paperid = papers.paperid where authors.fname = 'Stephanie' and authors.lname = 'Weirich' |
icfp_1 | 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 paper is published in an institution in "USA" and have "Turon" as its second author? | inst : instid , name , country | authors : authid , lname , fname | papers : paperid , title | authorship : authid , instid , paperid , authorder | authorship.paperid = papers.paperid | authorship.instid = inst.instid | authorship.authid = authors.authid |
### Response:
select papers.title from authors join authorship on authors.authid = authorship.authid join papers on authorship.paperid = papers.paperid join inst on authorship.instid = inst.instid where inst.country = 'USA' and authorship.authorder = 2 and authors.lname = 'Turon' |
icfp_1 | 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 papers whose second author has last name "Turon" and is affiliated with an institution in the country "USA". | inst : instid , name , country | authors : authid , lname , fname | papers : paperid , title | authorship : authid , instid , paperid , authorder | authorship.paperid = papers.paperid | authorship.instid = inst.instid | authorship.authid = authors.authid |
### Response:
select papers.title from authors join authorship on authors.authid = authorship.authid join papers on authorship.paperid = papers.paperid join inst on authorship.instid = inst.instid where inst.country = 'USA' and authorship.authorder = 2 and authors.lname = 'Turon' |
icfp_1 | 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 titles of papers whose first author is affiliated with an institution in the country "Japan" and has last name "Ohori"? | inst : instid , name , country | authors : authid , lname , fname | papers : paperid , title | authorship : authid , instid , paperid , authorder | authorship.paperid = papers.paperid | authorship.instid = inst.instid | authorship.authid = authors.authid |
### Response:
select papers.title from authors join authorship on authors.authid = authorship.authid join papers on authorship.paperid = papers.paperid join inst on authorship.instid = inst.instid where inst.country = 'Japan' and authorship.authorder = 1 and authors.lname = 'Ohori' |
icfp_1 | 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 papers' first author is affiliated with an institution in the country "Japan" and has last name "Ohori"? Give me the titles of the papers. | inst : instid , name , country | authors : authid , lname , fname | papers : paperid , title | authorship : authid , instid , paperid , authorder | authorship.paperid = papers.paperid | authorship.instid = inst.instid | authorship.authid = authors.authid |
### Response:
select papers.title from authors join authorship on authors.authid = authorship.authid join papers on authorship.paperid = papers.paperid join inst on authorship.instid = inst.instid where inst.country = 'Japan' and authorship.authorder = 1 and authors.lname = 'Ohori' |
icfp_1 | 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 last name of the author that has published the most papers? | inst : instid , name , country | authors : authid , lname , fname | papers : paperid , title | authorship : authid , instid , paperid , authorder | authorship.paperid = papers.paperid | authorship.instid = inst.instid | authorship.authid = authors.authid |
### Response:
select authors.lname from authors join authorship on authors.authid = authorship.authid join papers on authorship.paperid = papers.paperid group by authors.fname , authors.lname order by count ( * ) desc limit 1 |
icfp_1 | 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 author has written the most papers? Find his or her last name. | inst : instid , name , country | authors : authid , lname , fname | papers : paperid , title | authorship : authid , instid , paperid , authorder | authorship.paperid = papers.paperid | authorship.instid = inst.instid | authorship.authid = authors.authid |
### Response:
select authors.lname from authors join authorship on authors.authid = authorship.authid join papers on authorship.paperid = papers.paperid group by authors.fname , authors.lname order by count ( * ) desc limit 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.