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

Convert text to sql: What is the name of the student who has the highest total credits in the History 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 student where dept_name = 'History' order by tot_cred desc limit 1

### Instruction:

Convert text to sql: Give the name of the student in the History department with the most credits. | 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 student where dept_name = 'History' order by tot_cred desc limit 1
### Instruction:

Convert text to sql: How many rooms does the Lamberton building have? | 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 ( * ) from classroom where building = 'Lamberton'

### Instruction:

Convert text to sql: Count the number of classrooms in Lamberton. | 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 ( * ) from classroom where building = 'Lamberton'
### Instruction:

Convert text to sql: How many students have advisors? | 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 s_id ) from advisor

### Instruction:

Convert text to sql: Count the number of students who have advisors. | 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 s_id ) from advisor
### Instruction:

Convert text to sql: How many departments offer courses? | 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 dept_name ) from course

### Instruction:

Convert text to sql: Count the number of departments which offer courses. | 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 dept_name ) from course
### Instruction:

Convert text to sql: How many different courses offered by Physics 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 count ( distinct course_id ) from course where dept_name = 'Physics'

### Instruction:

Convert text to sql: Count the number of courses in the Physics 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 count ( distinct course_id ) from course where dept_name = 'Physics'
### Instruction:

Convert text to sql: Find the title of courses that have two prerequisites? | 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 course.title from course join prereq on course.course_id = prereq.course_id group by prereq.course_id having count ( * ) = 2

### Instruction:

Convert text to sql: What are the titles for courses with two prerequisites? | 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 course.title from course join prereq on course.course_id = prereq.course_id group by prereq.course_id having count ( * ) = 2
### Instruction:

Convert text to sql: Find the title, credit, and department name of courses that have more than one prerequisites? | 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 course.title , course.credits , course.dept_name from course join prereq on course.course_id = prereq.course_id group by prereq.course_id having count ( * ) > 1
### Instruction:

Convert text to sql: What is the title, credit value, and department name for courses with more than one prerequisite? | 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 course.title , course.credits , course.dept_name from course join prereq on course.course_id = prereq.course_id group by prereq.course_id having count ( * ) > 1

### Instruction:

Convert text to sql: How many courses that do not have prerequisite? | 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 ( * ) from course where course_id not in ( select course_id from prereq )