db_id stringlengths 4 31 | SQL stringlengths 18 1.45k | input_sequence stringlengths 148 11k | question stringlengths 16 325 |
|---|---|---|---|
college_2 | select min(salary) , dept_name from instructor group by dept_name having avg(salary) > (select avg(salary) from instructor) | Question: find the minimum salary for the departments whose average salary is above the average payment of all instructors. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. sectio... | find the minimum salary for the departments whose average salary is above the average payment of all instructors. |
college_2 | select min(salary) , dept_name from instructor group by dept_name having avg(salary) > (select avg(salary) from instructor) | Question: what is the lowest salary in departments with average salary greater than the overall average. | Tables: 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... | what is the lowest salary in departments with average salary greater than the overall average. |
college_2 | select count(*) , semester , year from section group by semester , year | Question: find the number of courses provided in each semester and year. | Tables: 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, r... | find the number of courses provided in each semester and year. |
college_2 | select count(*) , semester , year from section group by semester , year | Question: how many courses are provided in each semester and year? | Tables: 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_nu... | how many courses are provided in each semester and year? |
college_2 | select year from section group by year order by count(*) desc limit 1 | Question: find the year which offers the largest number of courses. | Tables: 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_n... | find the year which offers the largest number of courses. |
college_2 | select year from section group by year order by count(*) desc limit 1 | Question: which year had the greatest number of courses? | Tables: 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... | which year had the greatest number of courses? |
college_2 | select semester , year from section group by semester , year order by count(*) desc limit 1 | Question: find the year and semester when offers the largest number of courses. | Tables: 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, buil... | find the year and semester when offers the largest number of courses. |
college_2 | select semester , year from section group by semester , year order by count(*) desc limit 1 | Question: what is the year and semester with the most courses? | Tables: 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... | what is the year and semester with the most courses? |
college_2 | select dept_name from student group by dept_name order by count(*) desc limit 1 | Question: find the name of department has the highest amount of students? | Tables: 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, ... | find the name of department has the highest amount of students? |
college_2 | select dept_name from student group by dept_name order by count(*) desc limit 1 | Question: what is the name of the deparment with the highest enrollment? | Tables: 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, r... | what is the name of the deparment with the highest enrollment? |
college_2 | select count(*) , dept_name from student group by dept_name | Question: find the total number of students in each department. | Tables: 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_numbe... | find the total number of students in each department. |
college_2 | select count(*) , dept_name from student group by dept_name | Question: how many students are in each department? | Tables: 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... | how many students are in each department? |
college_2 | select semester , year from takes group by semester , year order by count(*) limit 1 | Question: find the semester and year which has the least number of student taking any class. | Tables: 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, semeste... | find the semester and year which has the least number of student taking any class. |
college_2 | select semester , year from takes group by semester , year order by count(*) limit 1 | Question: which semeseter and year had the fewest students? | Tables: 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, t... | which semeseter and year had the fewest students? |
college_2 | select i_id from advisor as t1 join student as t2 on t1.s_id = t2.id where t2.dept_name = 'history' | Question: what is the id of the instructor who advises of all students from history department? | Tables: 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, seme... | what is the id of the instructor who advises of all students from history department? |
college_2 | select i_id from advisor as t1 join student as t2 on t1.s_id = t2.id where t2.dept_name = 'history' | Question: give id of the instructor who advises students in the history department. | Tables: 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, ... | give id of the instructor who advises students in the history department. |
college_2 | select t2.name , t2.salary from advisor as t1 join instructor as t2 on t1.i_id = t2.id join student as t3 on t1.s_id = t3.id where t3.dept_name = 'history' | Question: find the name and salary of the instructors who are advisors of any student from history department? | Tables: 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_i... | find the name and salary of the instructors who are advisors of any student from history department? |
college_2 | select t2.name , t2.salary from advisor as t1 join instructor as t2 on t1.i_id = t2.id join student as t3 on t1.s_id = t3.id where t3.dept_name = 'history' | Question: what are the names and salaries of instructors who advises students in the history department? | Tables: 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... | what are the names and salaries of instructors who advises students in the history department? |
college_2 | select course_id from course except select course_id from prereq | Question: find the id of the courses that do not have any prerequisite? | Tables: 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, ro... | find the id of the courses that do not have any prerequisite? |
college_2 | select course_id from course except select course_id from prereq | Question: what are the ids of courses without prerequisites? | Tables: 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, ... | what are the ids of courses without prerequisites? |
college_2 | select title from course where course_id not in (select course_id from prereq) | Question: find the name of the courses that do not have any prerequisite? | Tables: 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, ... | find the name of the courses that do not have any prerequisite? |
college_2 | select title from course where course_id not in (select course_id from prereq) | Question: what are the names of courses without prerequisites? | Tables: 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... | what are the names of courses without prerequisites? |
college_2 | select title from course where course_id in (select t1.prereq_id from prereq as t1 join course as t2 on t1.course_id = t2.course_id where t2.title = 'international finance') | Question: what is the title of the prerequisite class of international finance course? | Tables: 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, yea... | what is the title of the prerequisite class of international finance course? |
college_2 | select title from course where course_id in (select t1.prereq_id from prereq as t1 join course as t2 on t1.course_id = t2.course_id where t2.title = 'international finance') | Question: give the title of the prerequisite to the course international finance. | Tables: 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, bu... | give the title of the prerequisite to the course international finance. |
college_2 | select title from course where course_id in (select t1.course_id from prereq as t1 join course as t2 on t1.prereq_id = t2.course_id where t2.title = 'differential geometry') | Question: find the title of course whose prerequisite is course differential geometry. | Tables: 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, yea... | find the title of course whose prerequisite is course differential geometry. |
college_2 | select title from course where course_id in (select t1.course_id from prereq as t1 join course as t2 on t1.prereq_id = t2.course_id where t2.title = 'differential geometry') | Question: what is the title of the course with differential geometry as a prerequisite? | Tables: 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, ye... | what is the title of the course with differential geometry as a prerequisite? |
college_2 | select name from student where id in (select id from takes where semester = 'fall' and year = 2003) | Question: find the names of students who have taken any course in the fall semester of year 2003. | Tables: 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, se... | find the names of students who have taken any course in the fall semester of year 2003. |
college_2 | select name from student where id in (select id from takes where semester = 'fall' and year = 2003) | Question: what are the names of students who took a course in the fall of 2003? | Tables: 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, buil... | what are the names of students who took a course in the fall of 2003? |
college_2 | select t1.title from course as t1 join section as t2 on t1.course_id = t2.course_id where building = 'chandler' and semester = 'fall' and year = 2010 | Question: what is the title of the course that was offered at building chandler during the fall semester in the year of 2010? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. sect... | what is the title of the course that was offered at building chandler during the fall semester in the year of 2010? |
college_2 | select t1.title from course as t1 join section as t2 on t1.course_id = t2.course_id where building = 'chandler' and semester = 'fall' and year = 2010 | Question: give the title of the course offered in chandler during the fall of 2010. | Tables: 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, ... | give the title of the course offered in chandler during the fall of 2010. |
college_2 | select t1.name from instructor as t1 join teaches as t2 on t1.id = t2.id join course as t3 on t2.course_id = t3.course_id where t3.title = 'c programming' | Question: find the name of the instructors who taught c programming course before. | Tables: 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, b... | find the name of the instructors who taught c programming course before. |
college_2 | select t1.name from instructor as t1 join teaches as t2 on t1.id = t2.id join course as t3 on t2.course_id = t3.course_id where t3.title = 'c programming' | Question: what are the names of instructors who have taught c programming courses? | Tables: 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, b... | what are the names of instructors who have taught c programming courses? |
college_2 | select t2.name , t2.salary from advisor as t1 join instructor as t2 on t1.i_id = t2.id join student as t3 on t1.s_id = t3.id where t3.dept_name = 'math' | Question: find the name and salary of instructors who are advisors of the students from the math department. | Tables: 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,... | find the name and salary of instructors who are advisors of the students from the math department. |
college_2 | select t2.name , t2.salary from advisor as t1 join instructor as t2 on t1.i_id = t2.id join student as t3 on t1.s_id = t3.id where t3.dept_name = 'math' | Question: what are the names and salaries of instructors who advise students in the math department? | Tables: 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,... | what are the names and salaries of instructors who advise students in the math department? |
college_2 | select t2.name from advisor as t1 join instructor as t2 on t1.i_id = t2.id join student as t3 on t1.s_id = t3.id where t3.dept_name = 'math' order by t3.tot_cred | Question: find the name of instructors who are advisors of the students from the math department, and sort the results by students' total credit. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dep... | find the name of instructors who are advisors of the students from the math department, and sort the results by students' total credit. |
college_2 | select t2.name from advisor as t1 join instructor as t2 on t1.i_id = t2.id join student as t3 on t1.s_id = t3.id where t3.dept_name = 'math' order by t3.tot_cred | Question: what are the names of all instructors who advise students in the math depart sorted by total credits of the student. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. sec... | what are the names of all instructors who advise students in the math depart sorted by total credits of the student. |
college_2 | select title from course where course_id in (select t1.prereq_id from prereq as t1 join course as t2 on t1.course_id = t2.course_id where t2.title = 'mobile computing') | Question: what is the course title of the prerequisite of course mobile computing? | Tables: 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, b... | what is the course title of the prerequisite of course mobile computing? |
college_2 | select title from course where course_id in (select t1.prereq_id from prereq as t1 join course as t2 on t1.course_id = t2.course_id where t2.title = 'mobile computing') | Question: what is the title of the course that is a prerequisite for mobile computing? | Tables: 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, yea... | what is the title of the course that is a prerequisite for mobile computing? |
college_2 | select t2.name from advisor as t1 join instructor as t2 on t1.i_id = t2.id join student as t3 on t1.s_id = t3.id order by t3.tot_cred desc limit 1 | Question: find the name of instructor who is the advisor of the student who has the highest number of total credits. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> co... | find the name of instructor who is the advisor of the student who has the highest number of total credits. |
college_2 | select t2.name from advisor as t1 join instructor as t2 on t1.i_id = t2.id join student as t3 on t1.s_id = t3.id order by t3.tot_cred desc limit 1 | Question: what is the name of the instructor who advises the student with the greatest number of total credits? | Tables: 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_... | what is the name of the instructor who advises the student with the greatest number of total credits? |
college_2 | select name from instructor where id not in (select id from teaches) | Question: find the name of instructors who didn't teach any courses? | Tables: 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_... | find the name of instructors who didn't teach any courses? |
college_2 | select name from instructor where id not in (select id from teaches) | Question: what are the names of instructors who didn't teach? | Tables: 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,... | what are the names of instructors who didn't teach? |
college_2 | select id from instructor except select id from teaches | Question: find the id of instructors who didn't teach any courses? | Tables: 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_nu... | find the id of instructors who didn't teach any courses? |
college_2 | select id from instructor except select id from teaches | Question: what are the ids of instructors who didnt' teach? | Tables: 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, t... | what are the ids of instructors who didnt' teach? |
college_2 | select name from instructor where id not in (select id from teaches where semester = 'spring') | Question: find the names of instructors who didn't each any courses in any spring semester. | Tables: 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... | find the names of instructors who didn't each any courses in any spring semester. |
college_2 | select name from instructor where id not in (select id from teaches where semester = 'spring') | Question: what are the names of instructors who didn't teach courses in the spring? | Tables: 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, ... | what are the names of instructors who didn't teach courses in the spring? |
college_2 | select dept_name from instructor group by dept_name order by avg(salary) desc limit 1 | Question: find the name of the department which has the highest average salary of professors. | Tables: 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, semest... | find the name of the department which has the highest average salary of professors. |
college_2 | select dept_name from instructor group by dept_name order by avg(salary) desc limit 1 | Question: which department has the highest average instructor salary? | Tables: 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... | which department has the highest average instructor salary? |
college_2 | select avg(t1.salary) , count(*) from instructor as t1 join department as t2 on t1.dept_name = t2.dept_name order by t2.budget desc limit 1 | Question: find the number and averaged salary of all instructors who are in the department with the highest budget. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> cou... | find the number and averaged salary of all instructors who are in the department with the highest budget. |
college_2 | select avg(t1.salary) , count(*) from instructor as t1 join department as t2 on t1.dept_name = t2.dept_name order by t2.budget desc limit 1 | Question: how many instructors are in the department with the highest budget, and what is their average salary? | Tables: 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_... | how many instructors are in the department with the highest budget, and what is their average salary? |
college_2 | select t3.title , t3.credits from classroom as t1 join section as t2 on t1.building = t2.building and t1.room_number = t2.room_number join course as t3 on t2.course_id = t3.course_id where t1.capacity = (select max(capacity) from classroom) | Question: what is the title and credits of the course that is taught in the largest classroom (with the highest capacity)? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section... | what is the title and credits of the course that is taught in the largest classroom (with the highest capacity)? |
college_2 | select t3.title , t3.credits from classroom as t1 join section as t2 on t1.building = t2.building and t1.room_number = t2.room_number join course as t3 on t2.course_id = t3.course_id where t1.capacity = (select max(capacity) from classroom) | Question: give the title and credits for the course that is taught in the classroom with the greatest capacity. | Tables: 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_... | give the title and credits for the course that is taught in the classroom with the greatest capacity. |
college_2 | select name from student where id not in (select t1.id from takes as t1 join course as t2 on t1.course_id = t2.course_id where t2.dept_name = 'biology') | Question: find the name of students who didn't take any course from biology department. | Tables: 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, ye... | find the name of students who didn't take any course from biology department. |
college_2 | select name from student where id not in (select t1.id from takes as t1 join course as t2 on t1.course_id = t2.course_id where t2.dept_name = 'biology') | Question: what are the names of students who haven't taken any biology courses? | Tables: 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, buil... | what are the names of students who haven't taken any biology courses? |
college_2 | select count(distinct t2.id) , count(distinct t3.id) , t3.dept_name from department as t1 join student as t2 on t1.dept_name = t2.dept_name join instructor as t3 on t1.dept_name = t3.dept_name group by t3.dept_name | Question: find the total number of students and total number of instructors for each department. | Tables: 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, sem... | find the total number of students and total number of instructors for each department. |
college_2 | select count(distinct t2.id) , count(distinct t3.id) , t3.dept_name from department as t1 join student as t2 on t1.dept_name = t2.dept_name join instructor as t3 on t1.dept_name = t3.dept_name group by t3.dept_name | Question: how many students and instructors are in each department? | Tables: 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_n... | how many students and instructors are in each department? |
college_2 | select t1.name from student as t1 join takes as t2 on t1.id = t2.id where t2.course_id in (select t4.prereq_id from course as t3 join prereq as t4 on t3.course_id = t4.course_id where t3.title = 'international finance') | Question: find the name of students who have taken the prerequisite course of the course with title international finance. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section... | find the name of students who have taken the prerequisite course of the course with title international finance. |
college_2 | select t1.name from student as t1 join takes as t2 on t1.id = t2.id where t2.course_id in (select t4.prereq_id from course as t3 join prereq as t4 on t3.course_id = t4.course_id where t3.title = 'international finance') | Question: what are the names of students who have taken the prerequisite for the course international finance? | Tables: 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_i... | what are the names of students who have taken the prerequisite for the course international finance? |
college_2 | select name , salary from instructor where salary < (select avg(salary) from instructor where dept_name = 'physics') | Question: find the name and salary of instructors whose salary is below the average salary of the instructors in the physics department. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, s... | find the name and salary of instructors whose salary is below the average salary of the instructors in the physics department. |
college_2 | select name , salary from instructor where salary < (select avg(salary) from instructor where dept_name = 'physics') | Question: what are the names and salaries for instructors who earn less than the average salary of instructors in the physics department? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, ... | what are the names and salaries for instructors who earn less than the average salary of instructors in the physics department? |
college_2 | select t3.name from course as t1 join takes as t2 on t1.course_id = t2.course_id join student as t3 on t2.id = t3.id where t1.dept_name = 'statistics' | Question: find the name of students who took some course offered by statistics department. | Tables: 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,... | find the name of students who took some course offered by statistics department. |
college_2 | select t3.name from course as t1 join takes as t2 on t1.course_id = t2.course_id join student as t3 on t2.id = t3.id where t1.dept_name = 'statistics' | Question: what are the names of students who have taken statistics courses? | Tables: 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... | what are the names of students who have taken statistics courses? |
college_2 | select t2.building , t2.room_number , t2.semester , t2.year from course as t1 join section as t2 on t1.course_id = t2.course_id where t1.dept_name = 'psychology' order by t1.title | Question: find the building, room number, semester and year of all courses offered by psychology department sorted by course titles. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salar... | find the building, room number, semester and year of all courses offered by psychology department sorted by course titles. |
college_2 | select t2.building , t2.room_number , t2.semester , t2.year from course as t1 join section as t2 on t1.course_id = t2.course_id where t1.dept_name = 'psychology' order by t1.title | Question: what are the building, room number, semester and year of courses in the psychology department, sorted using course title? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary... | what are the building, room number, semester and year of courses in the psychology department, sorted using course title? |
college_2 | select name from instructor where dept_name = 'comp. sci.' | Question: find the names of all instructors in computer science department | Tables: 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,... | find the names of all instructors in computer science department |
college_2 | select name from instructor where dept_name = 'comp. sci.' | Question: what are the names of all instructors in the comp. sci. department? | Tables: 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, buildi... | what are the names of all instructors in the comp. sci. department? |
college_2 | select name from instructor where dept_name = 'comp. sci.' and salary > 80000 | Question: find the names of all instructors in comp. sci. department with salary > 80000. | Tables: 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, ... | find the names of all instructors in comp. sci. department with salary > 80000. |
college_2 | select name from instructor where dept_name = 'comp. sci.' and salary > 80000 | Question: what are the names of the instructors in the comp. sci. department who earn more than 80000? | Tables: 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_i... | what are the names of the instructors in the comp. sci. department who earn more than 80000? |
college_2 | select name , course_id from instructor as t1 join teaches as t2 on t1.id = t2.id | Question: find the names of all instructors who have taught some course and the course_id. | Tables: 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,... | find the names of all instructors who have taught some course and the course_id. |
college_2 | select name , course_id from instructor as t1 join teaches as t2 on t1.id = t2.id | Question: what are the names of all instructors who have taught a course, as well as the corresponding course id? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> cours... | what are the names of all instructors who have taught a course, as well as the corresponding course id? |
college_2 | select name , course_id from instructor as t1 join teaches as t2 on t1.id = t2.id where t1.dept_name = 'art' | Question: find the names of all instructors in the art department who have taught some course and the course_id. | Tables: 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... | find the names of all instructors in the art department who have taught some course and the course_id. |
college_2 | select name , course_id from instructor as t1 join teaches as t2 on t1.id = t2.id where t1.dept_name = 'art' | Question: what are the names of art instructors who have taught a course, and the corresponding course id? | Tables: 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, s... | what are the names of art instructors who have taught a course, and the corresponding course id? |
college_2 | select name from instructor where name like '%dar%' | Question: find the names of all instructors whose name includes the substring dar. | Tables: 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, b... | find the names of all instructors whose name includes the substring dar. |
college_2 | select name from instructor where name like '%dar%' | Question: what are the names of all instructors with names that include 'dar'? | Tables: 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, build... | what are the names of all instructors with names that include 'dar'? |
college_2 | select distinct name from instructor order by name | Question: list in alphabetic order the names of all distinct instructors. | Tables: 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, ... | list in alphabetic order the names of all distinct instructors. |
college_2 | select distinct name from instructor order by name | Question: list the distinct names of the instructors, ordered by name. | Tables: 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, roo... | list the distinct names of the instructors, ordered by name. |
college_2 | select course_id from section where semester = 'fall' and year = 2009 union select course_id from section where semester = 'spring' and year = 2010 | Question: find courses that ran in fall 2009 or in spring 2010. | Tables: 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_numbe... | find courses that ran in fall 2009 or in spring 2010. |
college_2 | select course_id from section where semester = 'fall' and year = 2009 union select course_id from section where semester = 'spring' and year = 2010 | Question: what are the ids for courses in the fall of 2009 or the spring of 2010? | Tables: 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, bu... | what are the ids for courses in the fall of 2009 or the spring of 2010? |
college_2 | select course_id from section where semester = 'fall' and year = 2009 intersect select course_id from section where semester = 'spring' and year = 2010 | Question: find courses that ran in fall 2009 and in spring 2010. | Tables: 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_numb... | find courses that ran in fall 2009 and in spring 2010. |
college_2 | select course_id from section where semester = 'fall' and year = 2009 intersect select course_id from section where semester = 'spring' and year = 2010 | Question: what are the ids for courses that were offered in both fall of 2009 and spring of 2010? | Tables: 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, se... | what are the ids for courses that were offered in both fall of 2009 and spring of 2010? |
college_2 | select course_id from section where semester = 'fall' and year = 2009 except select course_id from section where semester = 'spring' and year = 2010 | Question: find courses that ran in fall 2009 but not in spring 2010. | Tables: 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_... | find courses that ran in fall 2009 but not in spring 2010. |
college_2 | select course_id from section where semester = 'fall' and year = 2009 except select course_id from section where semester = 'spring' and year = 2010 | Question: what are the ids of courses offered in fall of 2009 but not in spring of 2010? | Tables: 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, y... | what are the ids of courses offered in fall of 2009 but not in spring of 2010? |
college_2 | select distinct salary from instructor where salary < (select max(salary) from instructor) | Question: find the salaries of all distinct instructors that are less than the largest salary. | Tables: 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, semes... | find the salaries of all distinct instructors that are less than the largest salary. |
college_2 | select distinct salary from instructor where salary < (select max(salary) from instructor) | Question: what are the distinct salaries of all instructors who earned less than the maximum salary? | Tables: 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,... | what are the distinct salaries of all instructors who earned less than the maximum salary? |
college_2 | select count (distinct id) from teaches where semester = 'spring' and year = 2010 | Question: find the total number of instructors who teach a course in the spring 2010 semester. | Tables: 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, semes... | find the total number of instructors who teach a course in the spring 2010 semester. |
college_2 | select count (distinct id) from teaches where semester = 'spring' and year = 2010 | Question: how many instructors teach a course in the spring of 2010? | Tables: 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_... | how many instructors teach a course in the spring of 2010? |
college_2 | select dept_name , avg (salary) from instructor group by dept_name having avg (salary) > 42000 | Question: find the names and average salaries of all departments whose average salary is greater than 42000. | Tables: 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,... | find the names and average salaries of all departments whose average salary is greater than 42000. |
college_2 | select dept_name , avg (salary) from instructor group by dept_name having avg (salary) > 42000 | Question: what are the names and average salaries for departments with average salary higher than 42000? | Tables: 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... | what are the names and average salaries for departments with average salary higher than 42000? |
college_2 | select name from instructor where salary > (select min(salary) from instructor where dept_name = 'biology') | Question: find names of instructors with salary greater than that of some (at least one) instructor in the biology department. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. sec... | find names of instructors with salary greater than that of some (at least one) instructor in the biology department. |
college_2 | select name from instructor where salary > (select min(salary) from instructor where dept_name = 'biology') | Question: what are the names of instructors who earn more than at least one instructor from the biology department? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> cou... | what are the names of instructors who earn more than at least one instructor from the biology department? |
college_2 | select name from instructor where salary > (select max(salary) from instructor where dept_name = 'biology') | Question: find the names of all instructors whose salary is greater than the salary of all instructors in the biology department. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. ... | find the names of all instructors whose salary is greater than the salary of all instructors in the biology department. |
college_2 | select name from instructor where salary > (select max(salary) from instructor where dept_name = 'biology') | Question: what are the names of all instructors with a higher salary than any of the instructors in the biology department? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. sectio... | what are the names of all instructors with a higher salary than any of the instructors in the biology department? |
debate | select count(*) from debate | Question: how many debates are there? | Tables: people -> People_ID, District, Name, Party, Age. debate -> Debate_ID, Date, Venue, Num_of_Audience. debate_people -> Debate_ID, Affirmative, Negative, If_Affirmative_Win. | Joins: debate_people.Negative = people.People_ID, debate_people.Affirmative = people.People_ID, deb... | how many debates are there? |
debate | select venue from debate order by num_of_audience asc | Question: list the venues of debates in ascending order of the number of audience. | Tables: people -> People_ID, District, Name, Party, Age. debate -> Debate_ID, Date, Venue, Num_of_Audience. debate_people -> Debate_ID, Affirmative, Negative, If_Affirmative_Win. | Joins: debate_people.Negative = people.People_ID, deba... | list the venues of debates in ascending order of the number of audience. |
debate | select date , venue from debate | Question: what are the date and venue of each debate? | Tables: people -> People_ID, District, Name, Party, Age. debate -> Debate_ID, Date, Venue, Num_of_Audience. debate_people -> Debate_ID, Affirmative, Negative, If_Affirmative_Win. | Joins: debate_people.Negative = people.People_ID, debate_people.Affirmative = peopl... | what are the date and venue of each debate? |
debate | select date from debate where num_of_audience > 150 | Question: list the dates of debates with number of audience bigger than 150 | Tables: people -> People_ID, District, Name, Party, Age. debate -> Debate_ID, Date, Venue, Num_of_Audience. debate_people -> Debate_ID, Affirmative, Negative, If_Affirmative_Win. | Joins: debate_people.Negative = people.People_ID, debate_peop... | list the dates of debates with number of audience bigger than 150 |
debate | select name from people where age = 35 or age = 36 | Question: show the names of people aged either 35 or 36. | Tables: people -> People_ID, District, Name, Party, Age. debate -> Debate_ID, Date, Venue, Num_of_Audience. debate_people -> Debate_ID, Affirmative, Negative, If_Affirmative_Win. | Joins: debate_people.Negative = people.People_ID, debate_people.Affirmative = pe... | show the names of people aged either 35 or 36. |
debate | select party from people order by age asc limit 1 | Question: what is the party of the youngest people? | Tables: people -> People_ID, District, Name, Party, Age. debate -> Debate_ID, Date, Venue, Num_of_Audience. debate_people -> Debate_ID, Affirmative, Negative, If_Affirmative_Win. | Joins: debate_people.Negative = people.People_ID, debate_people.Affirmative = people.... | what is the party of the youngest people? |
debate | select party , count(*) from people group by party | Question: show different parties of people along with the number of people in each party. | Tables: people -> People_ID, District, Name, Party, Age. debate -> Debate_ID, Date, Venue, Num_of_Audience. debate_people -> Debate_ID, Affirmative, Negative, If_Affirmative_Win. | Joins: debate_people.Negative = people.People_I... | show different parties of people along with the number of people in each party. |
debate | select party from people group by party order by count(*) desc limit 1 | Question: show the party that has the most people. | Tables: people -> People_ID, District, Name, Party, Age. debate -> Debate_ID, Date, Venue, Num_of_Audience. debate_people -> Debate_ID, Affirmative, Negative, If_Affirmative_Win. | Joins: debate_people.Negative = people.People_ID, debate_people.Affirmative = people.P... | show the party that has the most people. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.