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

Convert text to sql: What are the distinct salaries of all instructors who earned less than the maximum salary? | classroom : building , room_number , capacity | department : dept_name , building , budget | course : course_id , title , dept_name , credits | instructor : id , name , dept_name , salary | section : course_id , sec_id , semester , year , building , room_number , time_slot_id | teaches : id , course_id , sec_id , semester , year | student : id , name , dept_name , tot_cred | takes : id , course_id , sec_id , semester , year , grade | advisor : s_id , i_id | time_slot : time_slot_id , day , start_hr , start_min , end_hr , end_min | prereq : course_id , prereq_id | course.dept_name = department.dept_name | instructor.dept_name = department.dept_name | section.building = classroom.building | section.room_number = classroom.room_number | section.course_id = course.course_id | teaches.id = instructor.id | teaches.course_id = section.course_id | teaches.sec_id = section.sec_id | teaches.semester = section.semester | teaches.year = section.year | student.dept_name = department.dept_name | takes.id = student.id | takes.course_id = section.course_id | takes.sec_id = section.sec_id | takes.semester = section.semester | takes.year = section.year | advisor.s_id = student.id | advisor.i_id = instructor.id | prereq.prereq_id = course.course_id | prereq.course_id = course.course_id | 

### Response:

select distinct salary from instructor where salary < ( select max ( salary ) from instructor )

### Instruction:

Convert text to sql: Find the total number of instructors who teach a course in the Spring 2010 semester. | classroom : building , room_number , capacity | department : dept_name , building , budget | course : course_id , title , dept_name , credits | instructor : id , name , dept_name , salary | section : course_id , sec_id , semester , year , building , room_number , time_slot_id | teaches : id , course_id , sec_id , semester , year | student : id , name , dept_name , tot_cred | takes : id , course_id , sec_id , semester , year , grade | advisor : s_id , i_id | time_slot : time_slot_id , day , start_hr , start_min , end_hr , end_min | prereq : course_id , prereq_id | course.dept_name = department.dept_name | instructor.dept_name = department.dept_name | section.building = classroom.building | section.room_number = classroom.room_number | section.course_id = course.course_id | teaches.id = instructor.id | teaches.course_id = section.course_id | teaches.sec_id = section.sec_id | teaches.semester = section.semester | teaches.year = section.year | student.dept_name = department.dept_name | takes.id = student.id | takes.course_id = section.course_id | takes.sec_id = section.sec_id | takes.semester = section.semester | takes.year = section.year | advisor.s_id = student.id | advisor.i_id = instructor.id | prereq.prereq_id = course.course_id | prereq.course_id = course.course_id | 

### Response:

select count ( distinct id ) from teaches where semester = 'Spring' and year = 2010
### Instruction:

Convert text to sql: How many instructors teach a course in the Spring of 2010? | classroom : building , room_number , capacity | department : dept_name , building , budget | course : course_id , title , dept_name , credits | instructor : id , name , dept_name , salary | section : course_id , sec_id , semester , year , building , room_number , time_slot_id | teaches : id , course_id , sec_id , semester , year | student : id , name , dept_name , tot_cred | takes : id , course_id , sec_id , semester , year , grade | advisor : s_id , i_id | time_slot : time_slot_id , day , start_hr , start_min , end_hr , end_min | prereq : course_id , prereq_id | course.dept_name = department.dept_name | instructor.dept_name = department.dept_name | section.building = classroom.building | section.room_number = classroom.room_number | section.course_id = course.course_id | teaches.id = instructor.id | teaches.course_id = section.course_id | teaches.sec_id = section.sec_id | teaches.semester = section.semester | teaches.year = section.year | student.dept_name = department.dept_name | takes.id = student.id | takes.course_id = section.course_id | takes.sec_id = section.sec_id | takes.semester = section.semester | takes.year = section.year | advisor.s_id = student.id | advisor.i_id = instructor.id | prereq.prereq_id = course.course_id | prereq.course_id = course.course_id | 

### Response:

select count ( distinct id ) from teaches where semester = 'Spring' and year = 2010

### Instruction:

Convert text to sql: Find the names and average salaries of all departments whose average salary is greater than 42000. | classroom : building , room_number , capacity | department : dept_name , building , budget | course : course_id , title , dept_name , credits | instructor : id , name , dept_name , salary | section : course_id , sec_id , semester , year , building , room_number , time_slot_id | teaches : id , course_id , sec_id , semester , year | student : id , name , dept_name , tot_cred | takes : id , course_id , sec_id , semester , year , grade | advisor : s_id , i_id | time_slot : time_slot_id , day , start_hr , start_min , end_hr , end_min | prereq : course_id , prereq_id | course.dept_name = department.dept_name | instructor.dept_name = department.dept_name | section.building = classroom.building | section.room_number = classroom.room_number | section.course_id = course.course_id | teaches.id = instructor.id | teaches.course_id = section.course_id | teaches.sec_id = section.sec_id | teaches.semester = section.semester | teaches.year = section.year | student.dept_name = department.dept_name | takes.id = student.id | takes.course_id = section.course_id | takes.sec_id = section.sec_id | takes.semester = section.semester | takes.year = section.year | advisor.s_id = student.id | advisor.i_id = instructor.id | prereq.prereq_id = course.course_id | prereq.course_id = course.course_id | 

### Response:

select dept_name , avg ( salary ) from instructor group by dept_name having avg ( salary ) > 42000
### Instruction:

Convert text to sql: What are the names and average salaries for departments with average salary higher than 42000? | classroom : building , room_number , capacity | department : dept_name , building , budget | course : course_id , title , dept_name , credits | instructor : id , name , dept_name , salary | section : course_id , sec_id , semester , year , building , room_number , time_slot_id | teaches : id , course_id , sec_id , semester , year | student : id , name , dept_name , tot_cred | takes : id , course_id , sec_id , semester , year , grade | advisor : s_id , i_id | time_slot : time_slot_id , day , start_hr , start_min , end_hr , end_min | prereq : course_id , prereq_id | course.dept_name = department.dept_name | instructor.dept_name = department.dept_name | section.building = classroom.building | section.room_number = classroom.room_number | section.course_id = course.course_id | teaches.id = instructor.id | teaches.course_id = section.course_id | teaches.sec_id = section.sec_id | teaches.semester = section.semester | teaches.year = section.year | student.dept_name = department.dept_name | takes.id = student.id | takes.course_id = section.course_id | takes.sec_id = section.sec_id | takes.semester = section.semester | takes.year = section.year | advisor.s_id = student.id | advisor.i_id = instructor.id | prereq.prereq_id = course.course_id | prereq.course_id = course.course_id | 

### Response:

select dept_name , avg ( salary ) from instructor group by dept_name having avg ( salary ) > 42000

### Instruction:

Convert text to sql: Find names of instructors with salary greater than that of some (at least one) instructor in the Biology department. | classroom : building , room_number , capacity | department : dept_name , building , budget | course : course_id , title , dept_name , credits | instructor : id , name , dept_name , salary | section : course_id , sec_id , semester , year , building , room_number , time_slot_id | teaches : id , course_id , sec_id , semester , year | student : id , name , dept_name , tot_cred | takes : id , course_id , sec_id , semester , year , grade | advisor : s_id , i_id | time_slot : time_slot_id , day , start_hr , start_min , end_hr , end_min | prereq : course_id , prereq_id | course.dept_name = department.dept_name | instructor.dept_name = department.dept_name | section.building = classroom.building | section.room_number = classroom.room_number | section.course_id = course.course_id | teaches.id = instructor.id | teaches.course_id = section.course_id | teaches.sec_id = section.sec_id | teaches.semester = section.semester | teaches.year = section.year | student.dept_name = department.dept_name | takes.id = student.id | takes.course_id = section.course_id | takes.sec_id = section.sec_id | takes.semester = section.semester | takes.year = section.year | advisor.s_id = student.id | advisor.i_id = instructor.id | prereq.prereq_id = course.course_id | prereq.course_id = course.course_id | 

### Response:

select name from instructor where salary > ( select min ( salary ) from instructor where dept_name = 'Biology' )
### Instruction:

Convert text to sql: What are the names of instructors who earn more than at least one instructor from the Biology department? | classroom : building , room_number , capacity | department : dept_name , building , budget | course : course_id , title , dept_name , credits | instructor : id , name , dept_name , salary | section : course_id , sec_id , semester , year , building , room_number , time_slot_id | teaches : id , course_id , sec_id , semester , year | student : id , name , dept_name , tot_cred | takes : id , course_id , sec_id , semester , year , grade | advisor : s_id , i_id | time_slot : time_slot_id , day , start_hr , start_min , end_hr , end_min | prereq : course_id , prereq_id | course.dept_name = department.dept_name | instructor.dept_name = department.dept_name | section.building = classroom.building | section.room_number = classroom.room_number | section.course_id = course.course_id | teaches.id = instructor.id | teaches.course_id = section.course_id | teaches.sec_id = section.sec_id | teaches.semester = section.semester | teaches.year = section.year | student.dept_name = department.dept_name | takes.id = student.id | takes.course_id = section.course_id | takes.sec_id = section.sec_id | takes.semester = section.semester | takes.year = section.year | advisor.s_id = student.id | advisor.i_id = instructor.id | prereq.prereq_id = course.course_id | prereq.course_id = course.course_id | 

### Response:

select name from instructor where salary > ( select min ( salary ) from instructor where dept_name = 'Biology' )

### Instruction:

Convert text to sql: Find the names of all instructors whose salary is greater than the salary of all instructors in the Biology department. | classroom : building , room_number , capacity | department : dept_name , building , budget | course : course_id , title , dept_name , credits | instructor : id , name , dept_name , salary | section : course_id , sec_id , semester , year , building , room_number , time_slot_id | teaches : id , course_id , sec_id , semester , year | student : id , name , dept_name , tot_cred | takes : id , course_id , sec_id , semester , year , grade | advisor : s_id , i_id | time_slot : time_slot_id , day , start_hr , start_min , end_hr , end_min | prereq : course_id , prereq_id | course.dept_name = department.dept_name | instructor.dept_name = department.dept_name | section.building = classroom.building | section.room_number = classroom.room_number | section.course_id = course.course_id | teaches.id = instructor.id | teaches.course_id = section.course_id | teaches.sec_id = section.sec_id | teaches.semester = section.semester | teaches.year = section.year | student.dept_name = department.dept_name | takes.id = student.id | takes.course_id = section.course_id | takes.sec_id = section.sec_id | takes.semester = section.semester | takes.year = section.year | advisor.s_id = student.id | advisor.i_id = instructor.id | prereq.prereq_id = course.course_id | prereq.course_id = course.course_id | 

### Response:

select name from instructor where salary > ( select max ( salary ) from instructor where dept_name = 'Biology' )
### Instruction:

Convert text to sql: What are the names of all instructors with a higher salary than any of the instructors in the Biology department? | classroom : building , room_number , capacity | department : dept_name , building , budget | course : course_id , title , dept_name , credits | instructor : id , name , dept_name , salary | section : course_id , sec_id , semester , year , building , room_number , time_slot_id | teaches : id , course_id , sec_id , semester , year | student : id , name , dept_name , tot_cred | takes : id , course_id , sec_id , semester , year , grade | advisor : s_id , i_id | time_slot : time_slot_id , day , start_hr , start_min , end_hr , end_min | prereq : course_id , prereq_id | course.dept_name = department.dept_name | instructor.dept_name = department.dept_name | section.building = classroom.building | section.room_number = classroom.room_number | section.course_id = course.course_id | teaches.id = instructor.id | teaches.course_id = section.course_id | teaches.sec_id = section.sec_id | teaches.semester = section.semester | teaches.year = section.year | student.dept_name = department.dept_name | takes.id = student.id | takes.course_id = section.course_id | takes.sec_id = section.sec_id | takes.semester = section.semester | takes.year = section.year | advisor.s_id = student.id | advisor.i_id = instructor.id | prereq.prereq_id = course.course_id | prereq.course_id = course.course_id | 

### Response:

select name from instructor where salary > ( select max ( salary ) from instructor where dept_name = 'Biology' )
### Instruction:

Convert text to sql: How many debates are there? | people : people_id , district , name , party , age | debate : debate_id , date , venue , num_of_audience | debate_people : debate_id , affirmative , negative , if_affirmative_win | debate_people.negative = people.people_id | debate_people.affirmative = people.people_id | debate_people.debate_id = debate.debate_id | 

### Response:

select count ( * ) from debate

### Instruction:

Convert text to sql: List the venues of debates in ascending order of the number of audience. | people : people_id , district , name , party , age | debate : debate_id , date , venue , num_of_audience | debate_people : debate_id , affirmative , negative , if_affirmative_win | debate_people.negative = people.people_id | debate_people.affirmative = people.people_id | debate_people.debate_id = debate.debate_id | 

### Response:

select venue from debate order by num_of_audience asc

### Instruction:

Convert text to sql: What are the date and venue of each debate? | people : people_id , district , name , party , age | debate : debate_id , date , venue , num_of_audience | debate_people : debate_id , affirmative , negative , if_affirmative_win | debate_people.negative = people.people_id | debate_people.affirmative = people.people_id | debate_people.debate_id = debate.debate_id | 

### Response:

select date , venue from debate

### Instruction:

Convert text to sql: List the dates of debates with number of audience bigger than 150 | people : people_id , district , name , party , age | debate : debate_id , date , venue , num_of_audience | debate_people : debate_id , affirmative , negative , if_affirmative_win | debate_people.negative = people.people_id | debate_people.affirmative = people.people_id | debate_people.debate_id = debate.debate_id | 

### Response:

select date from debate where num_of_audience > 150

### Instruction:

Convert text to sql: Show the names of people aged either 35 or 36. | people : people_id , district , name , party , age | debate : debate_id , date , venue , num_of_audience | debate_people : debate_id , affirmative , negative , if_affirmative_win | debate_people.negative = people.people_id | debate_people.affirmative = people.people_id | debate_people.debate_id = debate.debate_id | 

### Response:

select name from people where age = 35 or age = 36

### Instruction:

Convert text to sql: What is the party of the youngest people? | people : people_id , district , name , party , age | debate : debate_id , date , venue , num_of_audience | debate_people : debate_id , affirmative , negative , if_affirmative_win | debate_people.negative = people.people_id | debate_people.affirmative = people.people_id | debate_people.debate_id = debate.debate_id | 

### Response:

select party from people order by age asc limit 1
### Instruction:

Convert text to sql: Show different parties of people along with the number of people in each party. | people : people_id , district , name , party , age | debate : debate_id , date , venue , num_of_audience | debate_people : debate_id , affirmative , negative , if_affirmative_win | debate_people.negative = people.people_id | debate_people.affirmative = people.people_id | debate_people.debate_id = debate.debate_id | 

### Response:

select party , count ( * ) from people group by party

### Instruction:

Convert text to sql: Show the party that has the most people. | people : people_id , district , name , party , age | debate : debate_id , date , venue , num_of_audience | debate_people : debate_id , affirmative , negative , if_affirmative_win | debate_people.negative = people.people_id | debate_people.affirmative = people.people_id | debate_people.debate_id = debate.debate_id | 

### Response:

select party from people group by party order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: Show the distinct venues of debates | people : people_id , district , name , party , age | debate : debate_id , date , venue , num_of_audience | debate_people : debate_id , affirmative , negative , if_affirmative_win | debate_people.negative = people.people_id | debate_people.affirmative = people.people_id | debate_people.debate_id = debate.debate_id | 

### Response:

select distinct venue from debate

### Instruction:

Convert text to sql: Show the names of people, and dates and venues of debates they are on the affirmative side. | people : people_id , district , name , party , age | debate : debate_id , date , venue , num_of_audience | debate_people : debate_id , affirmative , negative , if_affirmative_win | debate_people.negative = people.people_id | debate_people.affirmative = people.people_id | debate_people.debate_id = debate.debate_id | 

### Response:

select people.name , debate.date , debate.venue from debate_people join debate on debate_people.debate_id = debate.debate_id join people on debate_people.affirmative = people.people_id

### Instruction:

Convert text to sql: Show the names of people, and dates and venues of debates they are on the negative side, ordered in ascending alphabetical order of name. | people : people_id , district , name , party , age | debate : debate_id , date , venue , num_of_audience | debate_people : debate_id , affirmative , negative , if_affirmative_win | debate_people.negative = people.people_id | debate_people.affirmative = people.people_id | debate_people.debate_id = debate.debate_id | 

### Response:

select people.name , debate.date , debate.venue from debate_people join debate on debate_people.debate_id = debate.debate_id join people on debate_people.negative = people.people_id order by people.name asc
### Instruction:

Convert text to sql: Show the names of people that are on affirmative side of debates with number of audience bigger than 200. | people : people_id , district , name , party , age | debate : debate_id , date , venue , num_of_audience | debate_people : debate_id , affirmative , negative , if_affirmative_win | debate_people.negative = people.people_id | debate_people.affirmative = people.people_id | debate_people.debate_id = debate.debate_id | 

### Response:

select people.name from debate_people join debate on debate_people.debate_id = debate.debate_id join people on debate_people.affirmative = people.people_id where debate.num_of_audience > 200

### Instruction:

Convert text to sql: Show the names of people and the number of times they have been on the affirmative side of debates. | people : people_id , district , name , party , age | debate : debate_id , date , venue , num_of_audience | debate_people : debate_id , affirmative , negative , if_affirmative_win | debate_people.negative = people.people_id | debate_people.affirmative = people.people_id | debate_people.debate_id = debate.debate_id | 

### Response:

select people.name , count ( * ) from debate_people join people on debate_people.affirmative = people.people_id group by people.name

### Instruction:

Convert text to sql: Show the names of people who have been on the negative side of debates at least twice. | people : people_id , district , name , party , age | debate : debate_id , date , venue , num_of_audience | debate_people : debate_id , affirmative , negative , if_affirmative_win | debate_people.negative = people.people_id | debate_people.affirmative = people.people_id | debate_people.debate_id = debate.debate_id | 

### Response:

select people.name from debate_people join people on debate_people.negative = people.people_id group by people.name having count ( * ) >= 2

### Instruction:

Convert text to sql: List the names of people that have not been on the affirmative side of debates. | people : people_id , district , name , party , age | debate : debate_id , date , venue , num_of_audience | debate_people : debate_id , affirmative , negative , if_affirmative_win | debate_people.negative = people.people_id | debate_people.affirmative = people.people_id | debate_people.debate_id = debate.debate_id | 

### Response:

select name from people where people_id not in ( select affirmative from debate_people )
### Instruction:

Convert text to sql: List the names of all the customers in alphabetical order. | customers : customer_id , customer_details | staff : staff_id , staff_details | policies : policy_id , customer_id , policy_type_code , start_date , end_date | claim_headers : claim_header_id , claim_status_code , claim_type_code , policy_id , date_of_claim , date_of_settlement , amount_claimed , amount_piad | claims_documents : claim_id , document_type_code , created_by_staff_id , created_date | claims_processing_stages : claim_stage_id , next_claim_stage_id , claim_status_name , claim_status_description | claims_processing : claim_processing_id , claim_id , claim_outcome_code , claim_stage_id , staff_id | policies.customer_id = customers.customer_id | claim_headers.policy_id = policies.policy_id | claims_documents.created_by_staff_id = staff.staff_id | claims_documents.claim_id = claim_headers.claim_header_id | claims_processing.staff_id = staff.staff_id | claims_processing.claim_id = claim_headers.claim_header_id | 

### Response:

select customer_details from customers order by customer_details asc

### Instruction:

Convert text to sql: Sort the customer names in alphabetical order. | customers : customer_id , customer_details | staff : staff_id , staff_details | policies : policy_id , customer_id , policy_type_code , start_date , end_date | claim_headers : claim_header_id , claim_status_code , claim_type_code , policy_id , date_of_claim , date_of_settlement , amount_claimed , amount_piad | claims_documents : claim_id , document_type_code , created_by_staff_id , created_date | claims_processing_stages : claim_stage_id , next_claim_stage_id , claim_status_name , claim_status_description | claims_processing : claim_processing_id , claim_id , claim_outcome_code , claim_stage_id , staff_id | policies.customer_id = customers.customer_id | claim_headers.policy_id = policies.policy_id | claims_documents.created_by_staff_id = staff.staff_id | claims_documents.claim_id = claim_headers.claim_header_id | claims_processing.staff_id = staff.staff_id | claims_processing.claim_id = claim_headers.claim_header_id | 

### Response:

select customer_details from customers order by customer_details asc