db_id stringlengths 4 31 | SQL stringlengths 18 1.45k | input_sequence stringlengths 148 11k | question stringlengths 16 325 |
|---|---|---|---|
college_1 | select count(*) , crs_code from class group by crs_code | Question: how many sections does each course have? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_NUM, EMP_LNAME,... | how many sections does each course have? |
college_1 | select sum(crs_credit) , dept_code from course group by dept_code | Question: what is the total credit does each department offer? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_NUM... | what is the total credit does each department offer? |
college_1 | select sum(crs_credit) , dept_code from course group by dept_code | Question: how many credits does the department offer? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_NUM, EMP_LNA... | how many credits does the department offer? |
college_1 | select count(*) , class_room from class group by class_room having count(*) >= 2 | Question: find the number of classes offered for all class rooms that held at least 2 classes. | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEP... | find the number of classes offered for all class rooms that held at least 2 classes. |
college_1 | select count(*) , class_room from class group by class_room having count(*) >= 2 | Question: for each classroom with at least 2 classes, how many classes are offered? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION... | for each classroom with at least 2 classes, how many classes are offered? |
college_1 | select count(*) , dept_code from class as t1 join course as t2 on t1.crs_code = t2.crs_code group by dept_code | Question: find the number of classes in each department. | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_NUM, EMP_... | find the number of classes in each department. |
college_1 | select count(*) , dept_code from class as t1 join course as t2 on t1.crs_code = t2.crs_code group by dept_code | Question: how many classes are held in each department? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_NUM, EMP_L... | how many classes are held in each department? |
college_1 | select count(*) , t3.school_code from class as t1 join course as t2 on t1.crs_code = t2.crs_code join department as t3 on t2.dept_code = t3.dept_code group by t3.school_code | Question: find the number of classes in each school. | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_NUM, EMP_LNAM... | find the number of classes in each school. |
college_1 | select count(*) , t3.school_code from class as t1 join course as t2 on t1.crs_code = t2.crs_code join department as t3 on t2.dept_code = t3.dept_code group by t3.school_code | Question: how many classes exist for each school? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_NUM, EMP_LNAME, ... | how many classes exist for each school? |
college_1 | select count(*) , t1.school_code from department as t1 join professor as t2 on t1.dept_code = t2.dept_code group by t1.school_code | Question: what is the number of professors for different school? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_N... | what is the number of professors for different school? |
college_1 | select count(*) , t1.school_code from department as t1 join professor as t2 on t1.dept_code = t2.dept_code group by t1.school_code | Question: how many different professors are there for the different schools? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLO... | how many different professors are there for the different schools? |
college_1 | select emp_jobcode , count(*) from employee group by emp_jobcode order by count(*) desc limit 1 | Question: find the count and code of the job has most employees. | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_N... | find the count and code of the job has most employees. |
college_1 | select emp_jobcode , count(*) from employee group by emp_jobcode order by count(*) desc limit 1 | Question: what is the count and code of the job with the most employee? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -... | what is the count and code of the job with the most employee? |
college_1 | select t1.school_code from department as t1 join professor as t2 on t1.dept_code = t2.dept_code group by t1.school_code order by count(*) limit 1 | Question: which school has the smallest amount of professors? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_NUM,... | which school has the smallest amount of professors? |
college_1 | select t1.school_code from department as t1 join professor as t2 on t1.dept_code = t2.dept_code group by t1.school_code order by count(*) limit 1 | Question: which school has the fewest professors? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_NUM, EMP_LNAME, ... | which school has the fewest professors? |
college_1 | select count(*) , dept_code from professor where prof_high_degree = 'ph.d.' group by dept_code | Question: find the number of professors with a ph.d. degree in each department. | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EM... | find the number of professors with a ph.d. degree in each department. |
college_1 | select count(*) , dept_code from professor where prof_high_degree = 'ph.d.' group by dept_code | Question: how many professors have a ph.d. in each department? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_NUM... | how many professors have a ph.d. in each department? |
college_1 | select count(*) , dept_code from student group by dept_code | Question: find the number of students for each department. | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_NUM, EM... | find the number of students for each department. |
college_1 | select count(*) , dept_code from student group by dept_code | Question: how many students are in each department? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_NUM, EMP_LNAME... | how many students are in each department? |
college_1 | select sum(stu_hrs) , dept_code from student group by dept_code | Question: find the total number of hours have done for all students in each department. | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTEN... | find the total number of hours have done for all students in each department. |
college_1 | select sum(stu_hrs) , dept_code from student group by dept_code | Question: how many hours do the students spend studying in each department? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOY... | how many hours do the students spend studying in each department? |
college_1 | select max(stu_gpa) , avg(stu_gpa) , min(stu_gpa) , dept_code from student group by dept_code | Question: find the max, average, and minimum gpa of all students in each department. | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSIO... | find the max, average, and minimum gpa of all students in each department. |
college_1 | select max(stu_gpa) , avg(stu_gpa) , min(stu_gpa) , dept_code from student group by dept_code | Question: what is the highest, lowest, and average student gpa for every department? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSIO... | what is the highest, lowest, and average student gpa for every department? |
college_1 | select t2.dept_name , avg(t1.stu_gpa) from student as t1 join department as t2 on t1.dept_code = t2.dept_code group by t1.dept_code order by avg(t1.stu_gpa) desc limit 1 | Question: what is the name and the average gpa of department whose students have the highest average gpa? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_A... | what is the name and the average gpa of department whose students have the highest average gpa? |
college_1 | select t2.dept_name , avg(t1.stu_gpa) from student as t1 join department as t2 on t1.dept_code = t2.dept_code group by t1.dept_code order by avg(t1.stu_gpa) desc limit 1 | Question: which department has the highest average student gpa, and what is the average gpa? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_... | which department has the highest average student gpa, and what is the average gpa? |
college_1 | select count(distinct school_code) from department | Question: how many schools exist in total? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_NUM, EMP_LNAME, EMP_FNA... | how many schools exist in total? |
college_1 | select count(distinct school_code) from department | Question: how many schools are there in the department? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_NUM, EMP_L... | how many schools are there in the department? |
college_1 | select count(distinct class_code) from class | Question: how many different classes are there? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_NUM, EMP_LNAME, EM... | how many different classes are there? |
college_1 | select count(distinct class_code) from class | Question: how many unique classes are offered? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_NUM, EMP_LNAME, EMP... | how many unique classes are offered? |
college_1 | select count(distinct crs_code) from class | Question: how many courses are offered? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_NUM, EMP_LNAME, EMP_FNAME,... | how many courses are offered? |
college_1 | select count(distinct crs_code) from class | Question: what are the number of different course codes? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_NUM, EMP_... | what are the number of different course codes? |
college_1 | select count(distinct dept_name) from department | Question: how many departments does the college has? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_NUM, EMP_LNAM... | how many departments does the college has? |
college_1 | select count(distinct dept_name) from department | Question: how many different departments are there? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_NUM, EMP_LNAME... | how many different departments are there? |
college_1 | select count(*) from department as t1 join course as t2 on t1.dept_code = t2.dept_code where dept_name = 'computer info. systems' | Question: how many courses are offered by the computer info. systems department? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. E... | how many courses are offered by the computer info. systems department? |
college_1 | select count(*) from department as t1 join course as t2 on t1.dept_code = t2.dept_code where dept_name = 'computer info. systems' | Question: how many courses does the department of computer information systmes offer? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSI... | how many courses does the department of computer information systmes offer? |
college_1 | select count(distinct class_section) from class where crs_code = 'acct-211' | Question: how many sections does course acct-211 has? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_NUM, EMP_LNA... | how many sections does course acct-211 has? |
college_1 | select count(distinct class_section) from class where crs_code = 'acct-211' | Question: what is the number of different class sections offered in the course acct-211? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTE... | what is the number of different class sections offered in the course acct-211? |
college_1 | select sum(t1.crs_credit) , t1.dept_code from course as t1 join class as t2 on t1.crs_code = t2.crs_code group by t1.dept_code | Question: find the total credits of all classes offered by each department. | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOY... | find the total credits of all classes offered by each department. |
college_1 | select sum(t1.crs_credit) , t1.dept_code from course as t1 join class as t2 on t1.crs_code = t2.crs_code group by t1.dept_code | Question: what are the total number of credits offered by each department? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYE... | what are the total number of credits offered by each department? |
college_1 | select t3.dept_name from course as t1 join class as t2 on t1.crs_code = t2.crs_code join department as t3 on t1.dept_code = t3.dept_code group by t1.dept_code order by sum(t1.crs_credit) desc limit 1 | Question: find the name of the department that offers the largest number of credits of all classes. | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS... | find the name of the department that offers the largest number of credits of all classes. |
college_1 | select t3.dept_name from course as t1 join class as t2 on t1.crs_code = t2.crs_code join department as t3 on t1.dept_code = t3.dept_code group by t1.dept_code order by sum(t1.crs_credit) desc limit 1 | Question: which department offers the most credits all together? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_N... | which department offers the most credits all together? |
college_1 | select count(*) from class as t1 join enroll as t2 on t1.class_code = t2.class_code where t1.crs_code = 'acct-211' | Question: how many students enrolled in class acct-211? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_NUM, EMP_L... | how many students enrolled in class acct-211? |
college_1 | select count(*) from class as t1 join enroll as t2 on t1.class_code = t2.class_code where t1.crs_code = 'acct-211' | Question: what are the total number of students enrolled in acct-211? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> ... | what are the total number of students enrolled in acct-211? |
college_1 | select t3.stu_fname from class as t1 join enroll as t2 on t1.class_code = t2.class_code join student as t3 on t2.stu_num = t3.stu_num where t1.crs_code = 'acct-211' | Question: what is the first name of each student enrolled in class acct-211? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLO... | what is the first name of each student enrolled in class acct-211? |
college_1 | select t3.stu_fname from class as t1 join enroll as t2 on t1.class_code = t2.class_code join student as t3 on t2.stu_num = t3.stu_num where t1.crs_code = 'acct-211' | Question: what are the first names of all students in course acct-211? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE ->... | what are the first names of all students in course acct-211? |
college_1 | select t3.stu_fname from class as t1 join enroll as t2 on t1.class_code = t2.class_code join student as t3 on t2.stu_num = t3.stu_num where t1.crs_code = 'acct-211' and t2.enroll_grade = 'c' | Question: what is the first name of students enrolled in class acct-211 and got grade c? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTE... | what is the first name of students enrolled in class acct-211 and got grade c? |
college_1 | select t3.stu_fname from class as t1 join enroll as t2 on t1.class_code = t2.class_code join student as t3 on t2.stu_num = t3.stu_num where t1.crs_code = 'acct-211' and t2.enroll_grade = 'c' | Question: what are the first names of all students who took acct-211 and received a c? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENS... | what are the first names of all students who took acct-211 and received a c? |
college_1 | select count(*) from employee | Question: find the total number of employees. | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_NUM, EMP_LNAME, EMP_... | find the total number of employees. |
college_1 | select count(*) from employee | Question: how many employees are there all together? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_NUM, EMP_LNAM... | how many employees are there all together? |
college_1 | select count(*) from professor where prof_high_degree = 'ph.d.' | Question: how many professors do have a ph.d. degree? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_NUM, EMP_LNA... | how many professors do have a ph.d. degree? |
college_1 | select count(*) from professor where prof_high_degree = 'ph.d.' | Question: what is the total number of professors with a ph.d. ? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_NU... | what is the total number of professors with a ph.d. ? |
college_1 | select count(*) from class as t1 join enroll as t2 on t1.class_code = t2.class_code join course as t3 on t1.crs_code = t3.crs_code join department as t4 on t3.dept_code = t4.dept_code where t4.dept_name = 'accounting' | Question: how many students are enrolled in the class taught by some professor from the accounting department? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, D... | how many students are enrolled in the class taught by some professor from the accounting department? |
college_1 | select count(*) from class as t1 join enroll as t2 on t1.class_code = t2.class_code join course as t3 on t1.crs_code = t3.crs_code join department as t4 on t3.dept_code = t4.dept_code where t4.dept_name = 'accounting' | Question: how many students are enrolled in some classes that are taught by an accounting professor? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRES... | how many students are enrolled in some classes that are taught by an accounting professor? |
college_1 | select t4.dept_name from class as t1 join enroll as t2 on t1.class_code = t2.class_code join course as t3 on t1.crs_code = t3.crs_code join department as t4 on t3.dept_code = t4.dept_code group by t3.dept_code order by count(*) desc limit 1 | Question: what is the name of the department that has the largest number of students enrolled? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEP... | what is the name of the department that has the largest number of students enrolled? |
college_1 | select t4.dept_name from class as t1 join enroll as t2 on t1.class_code = t2.class_code join course as t3 on t1.crs_code = t3.crs_code join department as t4 on t3.dept_code = t4.dept_code group by t3.dept_code order by count(*) desc limit 1 | Question: what is the name of the department with the most students enrolled? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPL... | what is the name of the department with the most students enrolled? |
college_1 | select dept_name from department order by dept_name | Question: list names of all departments ordered by their names. | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_NU... | list names of all departments ordered by their names. |
college_1 | select dept_name from department order by dept_name | Question: what are the names of all departments in alphabetical order? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE ->... | what are the names of all departments in alphabetical order? |
college_1 | select class_code from class where class_room = 'klr209' | Question: list the codes of all courses that take place in room klr209. | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -... | list the codes of all courses that take place in room klr209. |
college_1 | select class_code from class where class_room = 'klr209' | Question: what are the codes of all the courses that are located in room klr209? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. E... | what are the codes of all the courses that are located in room klr209? |
college_1 | select emp_fname from employee where emp_jobcode = 'prof' order by emp_dob | Question: list the first name of all employees with job code prof ordered by their date of birth. | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, ... | list the first name of all employees with job code prof ordered by their date of birth. |
college_1 | select emp_fname from employee where emp_jobcode = 'prof' order by emp_dob | Question: what are the first names of all employees that are professors ordered by date of birth? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, ... | what are the first names of all employees that are professors ordered by date of birth? |
college_1 | select t2.emp_fname , t1.prof_office from professor as t1 join employee as t2 on t1.emp_num = t2.emp_num order by t2.emp_fname | Question: find the first names and offices of all professors sorted by alphabetical order of their first name. | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, D... | find the first names and offices of all professors sorted by alphabetical order of their first name. |
college_1 | select t2.emp_fname , t1.prof_office from professor as t1 join employee as t2 on t1.emp_num = t2.emp_num order by t2.emp_fname | Question: what are the first names and office locations for all professors sorted alphabetically by first name? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, ... | what are the first names and office locations for all professors sorted alphabetically by first name? |
college_1 | select emp_fname , emp_lname from employee order by emp_dob limit 1 | Question: what is the first and last name of the oldest employee? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_... | what is the first and last name of the oldest employee? |
college_1 | select emp_fname , emp_lname from employee order by emp_dob limit 1 | Question: what are the first and last names of the employee with the earliest date of birth? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_... | what are the first and last names of the employee with the earliest date of birth? |
college_1 | select stu_fname , stu_lname , stu_gpa from student where stu_gpa > 3 order by stu_dob desc limit 1 | Question: what is the first, last name, gpa of the youngest one among students whose gpa is above 3? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRES... | what is the first, last name, gpa of the youngest one among students whose gpa is above 3? |
college_1 | select stu_fname , stu_lname , stu_gpa from student where stu_gpa > 3 order by stu_dob desc limit 1 | Question: what is the first and last name of the youngest student with a gpa above 3, and what is their gpa? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEP... | what is the first and last name of the youngest student with a gpa above 3, and what is their gpa? |
college_1 | select distinct stu_fname from student as t1 join enroll as t2 on t1.stu_num = t2.stu_num where enroll_grade = 'c' | Question: what is the first name of students who got grade c in any class? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYE... | what is the first name of students who got grade c in any class? |
college_1 | select distinct stu_fname from student as t1 join enroll as t2 on t1.stu_num = t2.stu_num where enroll_grade = 'c' | Question: what are the first names of all students who got a grade c in a class? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. E... | what are the first names of all students who got a grade c in a class? |
college_1 | select t2.dept_name from professor as t1 join department as t2 on t1.dept_code = t2.dept_code group by t1.dept_code order by count(*) limit 1 | Question: what is the name of department where has the smallest number of professors? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSI... | what is the name of department where has the smallest number of professors? |
college_1 | select t2.dept_name from professor as t1 join department as t2 on t1.dept_code = t2.dept_code group by t1.dept_code order by count(*) limit 1 | Question: what is the name of the department with the fewest professors? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE ... | what is the name of the department with the fewest professors? |
college_1 | select t2.dept_name , t1.dept_code from professor as t1 join department as t2 on t1.dept_code = t2.dept_code where t1.prof_high_degree = 'ph.d.' group by t1.dept_code order by count(*) desc limit 1 | Question: what is the name of department where has the largest number of professors with a ph.d. degree? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_AD... | what is the name of department where has the largest number of professors with a ph.d. degree? |
college_1 | select t2.dept_name , t1.dept_code from professor as t1 join department as t2 on t1.dept_code = t2.dept_code where t1.prof_high_degree = 'ph.d.' group by t1.dept_code order by count(*) desc limit 1 | Question: which department has the most professors with a ph.d.? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_N... | which department has the most professors with a ph.d.? |
college_1 | select emp_fname from employee where emp_jobcode = 'prof' except select t1.emp_fname from employee as t1 join class as t2 on t1.emp_num = t2.prof_num | Question: what are the first names of the professors who do not teach a class. | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMP... | what are the first names of the professors who do not teach a class. |
college_1 | select emp_fname from employee where emp_jobcode = 'prof' except select t1.emp_fname from employee as t1 join class as t2 on t1.emp_num = t2.prof_num | Question: what are the first names of all professors not teaching any classes? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMP... | what are the first names of all professors not teaching any classes? |
college_1 | select t1.emp_fname from employee as t1 join professor as t2 on t1.emp_num = t2.emp_num join department as t3 on t2.dept_code = t3.dept_code where t3.dept_name = 'history' except select t4.emp_fname from employee as t4 join class as t5 on t4.emp_num = t5.prof_num | Question: what is the first names of the professors from the history department who do not teach a class. | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_A... | what is the first names of the professors from the history department who do not teach a class. |
college_1 | select t1.emp_fname from employee as t1 join professor as t2 on t1.emp_num = t2.emp_num join department as t3 on t2.dept_code = t3.dept_code where t3.dept_name = 'history' except select t4.emp_fname from employee as t4 join class as t5 on t4.emp_num = t5.prof_num | Question: what are the first names of all history professors who do not teach? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMP... | what are the first names of all history professors who do not teach? |
college_1 | select t1.emp_lname , t2.prof_office from employee as t1 join professor as t2 on t1.emp_num = t2.emp_num join department as t3 on t2.dept_code = t3.dept_code where t3.dept_name = 'history' | Question: what is the last name and office of the professor from the history department? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTE... | what is the last name and office of the professor from the history department? |
college_1 | select t1.emp_lname , t2.prof_office from employee as t1 join professor as t2 on t1.emp_num = t2.emp_num join department as t3 on t2.dept_code = t3.dept_code where t3.dept_name = 'history' | Question: what are the last name and office of all history professors? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE ->... | what are the last name and office of all history professors? |
college_1 | select t3.dept_name , t2.prof_office from employee as t1 join professor as t2 on t1.emp_num = t2.emp_num join department as t3 on t2.dept_code = t3.dept_code where t1.emp_lname = 'heffington' | Question: what is department name and office for the professor whose last name is heffington? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT... | what is department name and office for the professor whose last name is heffington? |
college_1 | select t3.dept_name , t2.prof_office from employee as t1 join professor as t2 on t1.emp_num = t2.emp_num join department as t3 on t2.dept_code = t3.dept_code where t1.emp_lname = 'heffington' | Question: what is the name of the department and office location for the professor with the last name of heffington? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_... | what is the name of the department and office location for the professor with the last name of heffington? |
college_1 | select t1.emp_lname , t1.emp_hiredate from employee as t1 join professor as t2 on t1.emp_num = t2.emp_num where t2.prof_office = 'dre 102' | Question: find the last name and hire date of the professor who is in office dre 102. | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSI... | find the last name and hire date of the professor who is in office dre 102. |
college_1 | select t1.emp_lname , t1.emp_hiredate from employee as t1 join professor as t2 on t1.emp_num = t2.emp_num where t2.prof_office = 'dre 102' | Question: what is the last name of the professor whose office is located in dre 102, and when were they hired? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, D... | what is the last name of the professor whose office is located in dre 102, and when were they hired? |
college_1 | select t1.crs_code from class as t1 join enroll as t2 on t1.class_code = t2.class_code join student as t3 on t3.stu_num = t2.stu_num where t3.stu_lname = 'smithson' | Question: what is the code of the course which the student whose last name is smithson took? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_... | what is the code of the course which the student whose last name is smithson took? |
college_1 | select t1.crs_code from class as t1 join enroll as t2 on t1.class_code = t2.class_code join student as t3 on t3.stu_num = t2.stu_num where t3.stu_lname = 'smithson' | Question: what are the course codes for every class that the student with the last name smithson took? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDR... | what are the course codes for every class that the student with the last name smithson took? |
college_1 | select t4.crs_description , t4.crs_credit from class as t1 join enroll as t2 on t1.class_code = t2.class_code join student as t3 on t3.stu_num = t2.stu_num join course as t4 on t4.crs_code = t1.crs_code where t3.stu_lname = 'smithson' | Question: what are the description and credit of the course which the student whose last name is smithson took? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, ... | what are the description and credit of the course which the student whose last name is smithson took? |
college_1 | select t4.crs_description , t4.crs_credit from class as t1 join enroll as t2 on t1.class_code = t2.class_code join student as t3 on t3.stu_num = t2.stu_num join course as t4 on t4.crs_code = t1.crs_code where t3.stu_lname = 'smithson' | Question: how many credits is the course that the student with the last name smithson took, and what is its description? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, ... | how many credits is the course that the student with the last name smithson took, and what is its description? |
college_1 | select count(*) from professor where prof_high_degree = 'ph.d.' or prof_high_degree = 'ma' | Question: how many professors who has a either ph.d. or ma degree? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP... | how many professors who has a either ph.d. or ma degree? |
college_1 | select count(*) from professor where prof_high_degree = 'ph.d.' or prof_high_degree = 'ma' | Question: how many professors attained either ph.d. or masters degrees? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -... | how many professors attained either ph.d. or masters degrees? |
college_1 | select count(*) from professor as t1 join department as t2 on t1.dept_code = t2.dept_code where t2.dept_name = 'accounting' or t2.dept_name = 'biology' | Question: how many professors who are from either accounting or biology department? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION... | how many professors who are from either accounting or biology department? |
college_1 | select count(*) from professor as t1 join department as t2 on t1.dept_code = t2.dept_code where t2.dept_name = 'accounting' or t2.dept_name = 'biology' | Question: what is the number of professors who are in the accounting or biology departments? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_... | what is the number of professors who are in the accounting or biology departments? |
college_1 | select t1.emp_fname from employee as t1 join class as t2 on t1.emp_num = t2.prof_num where crs_code = 'cis-220' intersect select t1.emp_fname from employee as t1 join class as t2 on t1.emp_num = t2.prof_num where crs_code = 'qm-261' | Question: find the first name of the professor who is teaching two courses with code cis-220 and qm-261. | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_AD... | find the first name of the professor who is teaching two courses with code cis-220 and qm-261. |
college_1 | select t1.emp_fname from employee as t1 join class as t2 on t1.emp_num = t2.prof_num where crs_code = 'cis-220' intersect select t1.emp_fname from employee as t1 join class as t2 on t1.emp_num = t2.prof_num where crs_code = 'qm-261' | Question: what is the first name of the professor who is teaching cis-220 and qm-261? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSI... | what is the first name of the professor who is teaching cis-220 and qm-261? |
college_1 | select t1.stu_fname from student as t1 join enroll as t2 on t1.stu_num = t2.stu_num join class as t3 on t2.class_code = t3.class_code join course as t4 on t3.crs_code = t4.crs_code join department as t5 on t5.dept_code = t4.dept_code where t5.dept_name = 'accounting' intersect select t1.stu_fname from student... | Question: find the first name of student who is taking classes from accounting and computer info. systems departments | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP... | find the first name of student who is taking classes from accounting and computer info. systems departments |
college_1 | select t1.stu_fname from student as t1 join enroll as t2 on t1.stu_num = t2.stu_num join class as t3 on t2.class_code = t3.class_code join course as t4 on t3.crs_code = t4.crs_code join department as t5 on t5.dept_code = t4.dept_code where t5.dept_name = 'accounting' intersect select t1.stu_fname from student... | Question: what are the first names of all students taking accoutning and computer information systems classes? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, D... | what are the first names of all students taking accoutning and computer information systems classes? |
college_1 | select avg(t2.stu_gpa) from enroll as t1 join student as t2 on t1.stu_num = t2.stu_num join class as t3 on t1.class_code = t3.class_code where t3.crs_code = 'acct-211' | Question: what is the average gpa of the students enrolled in the course with code acct-211? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_... | what is the average gpa of the students enrolled in the course with code acct-211? |
college_1 | select avg(t2.stu_gpa) from enroll as t1 join student as t2 on t1.stu_num = t2.stu_num join class as t3 on t1.class_code = t3.class_code where t3.crs_code = 'acct-211' | Question: what is the average gpa of students taking acct-211? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_NUM... | what is the average gpa of students taking acct-211? |
college_1 | select stu_gpa , stu_phone , stu_fname from student order by stu_gpa desc limit 5 | Question: what is the first name, gpa and phone number of the top 5 students with highest gpa? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEP... | what is the first name, gpa and phone number of the top 5 students with highest gpa? |
college_1 | select stu_gpa , stu_phone , stu_fname from student order by stu_gpa desc limit 5 | Question: what is the first name, gpa, and phone number of the students with the top 5 gpas? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_... | what is the first name, gpa, and phone number of the students with the top 5 gpas? |
college_1 | select t2.dept_name from student as t1 join department as t2 on t1.dept_code = t2.dept_code order by stu_gpa limit 1 | Question: what is the department name of the students with lowest gpa belongs to? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. ... | what is the department name of the students with lowest gpa belongs to? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.