aherntech/sparc huggingface dataset:
Database: college_1
Question sequence:
What is the total credits of all courses?
Give the number for each department.
SQL query sequence:
SELECT sum(crs_credit) FROM course
SELECT sum(crs_credit) ,  dept_code FROM course GROUP BY dept_code
Final question: How many credits does the department offer?
Final SQL: SELECT sum(crs_credit) ,  dept_code FROM course GROUP BY dept_code
Database: college_1
Question sequence:
For each classroom, how many the classes held there?
How many are there for each classroom with at least 2 classes?
SQL query sequence:
SELECT count(*) ,  class_room FROM CLASS GROUP BY class_room
SELECT count(*) ,  class_room FROM CLASS GROUP BY class_room HAVING count(*)  >=  2
Final question: For each classroom with at least 2 classes, how many classes are offered?
Final SQL: SELECT count(*) ,  class_room FROM CLASS GROUP BY class_room HAVING count(*)  >=  2
Database: college_1
Question sequence:
How many classes are offered?
return the number for each department.
SQL query sequence:
SELECT count(*) FROM CLASS
SELECT count(*) ,  dept_code FROM CLASS AS T1 JOIN course AS T2 ON T1.crs_code  =  T2.crs_code GROUP BY dept_code
Final question: How many classes are held in each department?
Final SQL: SELECT count(*) ,  dept_code FROM CLASS AS T1 JOIN course AS T2 ON T1.crs_code  =  T2.crs_code GROUP BY dept_code
Database: college_1
Question sequence:
What are the different school codes?
How many classes are there for each of them?
SQL query sequence:
SELECT DISTINCT school_code FROM department
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
Final question: How many classes exist for each school?
Final SQL: 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
Database: college_1
Question sequence:
How many professors are there?
How many of them are there for each school?
SQL query sequence:
SELECT count(*) FROM professor
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
Final question: How many different professors are there for the different schools?
Final SQL: 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
Database: college_1
Question sequence:
For each job code, how many employees are there?
Which one has the most?
SQL query sequence:
SELECT emp_jobcode ,  count(*) FROM employee GROUP BY emp_jobcode
SELECT emp_jobcode ,  count(*) FROM employee GROUP BY emp_jobcode ORDER BY count(*) DESC LIMIT 1
Final question: What is the count and code of the job with the most employee?
Final SQL: SELECT emp_jobcode ,  count(*) FROM employee GROUP BY emp_jobcode ORDER BY count(*) DESC LIMIT 1
Database: college_1
Question sequence:
What are the different school codes?
For each one, how many professors does it have?
Which one has the most?
SQL query sequence:
SELECT DISTINCT school_code FROM department
SELECT T1.school_code ,  count(*) FROM department AS T1 JOIN professor AS T2 ON T1.dept_code  =  T2.dept_code GROUP BY T1.school_code
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
Final question: Which school has the fewest professors?
Final SQL: 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
Database: college_1
Question sequence:
How many professors do have a Ph.D.?
Count the number of these professors for each department.
SQL query sequence:
SELECT count(*) FROM professor WHERE prof_high_degree  =  'Ph.D.'
SELECT count(*) ,  dept_code FROM professor WHERE prof_high_degree  =  'Ph.D.' GROUP BY dept_code
Final question: How many professors have a Ph.D. in each department?
Final SQL: SELECT count(*) ,  dept_code FROM professor WHERE prof_high_degree  =  'Ph.D.' GROUP BY dept_code
Database: college_1
Question sequence:
What are all students?
How many of them?
How many are there in each department?
SQL query sequence:
SELECT * FROM student
SELECT count(*) FROM student
SELECT count(*) ,  dept_code FROM student GROUP BY dept_code
Final question: How many students are in each department?
Final SQL: SELECT count(*) ,  dept_code FROM student GROUP BY dept_code
Database: college_1
Question sequence:
For each department, how many students does it have?
For each department, what is the total hours worked by those students?
SQL query sequence:
SELECT count(*) ,  dept_code FROM student GROUP BY dept_code
SELECT sum(stu_hrs) ,  dept_code FROM student GROUP BY dept_code
Final question: How many hours do the students spend studying in each department?
Final SQL: SELECT sum(stu_hrs) ,  dept_code FROM student GROUP BY dept_code
Database: college_1
Question sequence:
what are the student GPAs?
What is average for each department?
Also, find the highest and lowest pga?
SQL query sequence:
SELECT stu_gpa FROM student
SELECT avg(stu_gpa) ,  dept_code FROM student GROUP BY dept_code
SELECT max(stu_gpa) ,  avg(stu_gpa) ,  min(stu_gpa) ,  dept_code FROM student GROUP BY dept_code
Final question: What is the highest, lowest, and average student GPA for every department?
Final SQL: SELECT max(stu_gpa) ,  avg(stu_gpa) ,  min(stu_gpa) ,  dept_code FROM student GROUP BY dept_code
Database: college_1
Question sequence:
What is the average GPA of all students?
How about the average GPA of students in each department?
Also, find the corresponding name of each department?
Which one has the highest average GPA?
SQL query sequence:
SELECT avg(stu_gpa) FROM student
SELECT dept_code ,  avg(stu_gpa) FROM student GROUP BY dept_code
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
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
Final question: Which department has the highest average student GPA, and what is the average gpa?
Final SQL: 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
Database: college_1
Question sequence:
What are the school codes?
Remove any repeating ones.
How many are there?
SQL query sequence:
SELECT school_code FROM department
SELECT DISTINCT school_code FROM department
SELECT count(DISTINCT school_code) FROM department
Final question: How many schools are there in the department?
Final SQL: SELECT count(DISTINCT school_code) FROM department
Database: college_1
Question sequence:
What are the different class codes?
How many of them are there?
SQL query sequence:
SELECT DISTINCT class_code FROM CLASS
SELECT count(DISTINCT class_code) FROM CLASS
Final question: How many unique classes are offered?
Final SQL: SELECT count(DISTINCT class_code) FROM CLASS
Database: college_1
Question sequence:
What are the course codes?
What are the unique ones?
How many are there?
SQL query sequence:
SELECT crs_code FROM CLASS
SELECT DISTINCT crs_code FROM CLASS
SELECT count(DISTINCT crs_code) FROM CLASS
Final question: What are the number of different course codes?
Final SQL: SELECT count(DISTINCT crs_code) FROM CLASS
Database: college_1
Question sequence:
What are the different department names?
How many does it offer?
SQL query sequence:
SELECT DISTINCT dept_name FROM department
SELECT count(DISTINCT dept_name) FROM department
Final question: How many different departments are there?
Final SQL: SELECT count(DISTINCT dept_name) FROM department
Database: college_1
Question sequence:
What can you tell me about the Computer Info. Systems department?
What courses does it offer?
How many courses is that?
SQL query sequence:
SELECT * FROM department WHERE dept_name  =  "Computer Info. Systems"
SELECT * FROM department AS T1 JOIN course AS T2 ON T1.dept_code  =  T2.dept_code WHERE dept_name  =  "Computer Info. Systems"
SELECT count(*) FROM department AS T1 JOIN course AS T2 ON T1.dept_code  =  T2.dept_code WHERE dept_name  =  "Computer Info. Systems"
Final question: How many courses does the department of Computer Information Systmes offer?
Final SQL: SELECT count(*) FROM department AS T1 JOIN course AS T2 ON T1.dept_code  =  T2.dept_code WHERE dept_name  =  "Computer Info. Systems"
Database: college_1
Question sequence:
What are the different class sections?
What about for the course ACCT-211?
How many different ones does it offer?
SQL query sequence:
SELECT DISTINCT class_section FROM CLASS
SELECT DISTINCT class_section FROM CLASS WHERE crs_code  =  'ACCT-211'
SELECT count(DISTINCT class_section) FROM CLASS WHERE crs_code  =  'ACCT-211'
Final question: What is the number of different class sections offered in the course ACCT-211?
Final SQL: SELECT count(DISTINCT class_section) FROM CLASS WHERE crs_code  =  'ACCT-211'
Database: college_1
Question sequence:
List codes of all courses and their credits.
What is the total number of credits for each department?
SQL query sequence:
SELECT crs_credit ,  crs_code FROM course
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
Final question: What are the total number of credits offered by each department?
Final SQL: 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
Database: college_1
Question sequence:
how many total course credits does each department offer?
Find the department that offers the most number of credits of classes?
What is the name of that department?
SQL query sequence:
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
SELECT * FROM course AS T1 JOIN CLASS AS T2 ON T1.crs_code  =  T2.crs_code GROUP BY T1.dept_code ORDER BY sum(T1.crs_credit) DESC LIMIT 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
Final question: Which department offers the most credits all together?
Final SQL: 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
Database: college_1
Question sequence:
Can you tell me about course ACCT-211?
How many students are enrolled in this class?
SQL query sequence:
SELECT * FROM CLASS WHERE crs_code  =  'ACCT-211'
SELECT count(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code  =  T2.class_code WHERE T1.crs_code  =  'ACCT-211'
Final question: What are the total number of students enrolled in ACCT-211?
Final SQL: SELECT count(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code  =  T2.class_code WHERE T1.crs_code  =  'ACCT-211'
Database: college_1
Question sequence:
Can you tell me about course ACCT-211?
How many students are enrolled in this class?
What are their corresponding first names?
SQL query sequence:
SELECT * FROM CLASS WHERE crs_code  =  'ACCT-211'
SELECT count(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code  =  T2.class_code WHERE T1.crs_code  =  'ACCT-211'
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'
Final question: What are the first names of all students in course ACCT-211?
Final SQL: 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'
Database: college_1
Question sequence:
Which students were enrollment in the course ACCT-211?
Which of those received C's as grades?
What are their first names?
SQL query sequence:
SELECT * 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'
SELECT * 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'
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'
Final question: What are the first names of all students who took ACCT-211 and received a C?
Final SQL: 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'
Database: college_1
Question sequence:
Tell me everything about the employees.
How many of them are there?
SQL query sequence:
SELECT * FROM employee
SELECT count(*) FROM employee
Final question: How many employees are there all together?
Final SQL: SELECT count(*) FROM employee
Database: college_1
Question sequence:
Who are all professors?
What about those who have a Ph.D. degree.
How many of them are there?
SQL query sequence:
SELECT * FROM professor
SELECT * FROM professor WHERE prof_high_degree  =  'Ph.D.'
SELECT count(*) FROM professor WHERE prof_high_degree  =  'Ph.D.'
Final question: What is the total number of professors with a Ph.D. ?
Final SQL: SELECT count(*) FROM professor WHERE prof_high_degree  =  'Ph.D.'
Database: college_1
Question sequence:
Find the all info about the accounting department.
Which classes are taught the department?
How many students are enrolled in those classes?
SQL query sequence:
SELECT * FROM department WHERE dept_name  =  'Accounting'
SELECT * FROM CLASS AS T1 JOIN course AS T2 ON T1.crs_code  =  T2.crs_code JOIN department AS T3 ON T3.dept_code  =  T2.dept_code WHERE T3.dept_name  =  'Accounting'
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'
Final question: How many students are enrolled in some classes that are taught by an accounting professor?
Final SQL: 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'
Database: college_1
Question sequence:
Find number of students enrolled in some classes offered by each department.
Which department has the most number of students enrolled?
What is the corresponding department name?
SQL query sequence:
SELECT count(*) ,  T3.dept_code 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 GROUP BY T3.dept_code
SELECT * 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 GROUP BY T3.dept_code ORDER BY count(*) DESC LIMIT 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
Final question: What is the name of the department with the most students enrolled?
Final SQL: 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
Database: college_1
Question sequence:
What are the names of each department?
Order them alphabetically.
SQL query sequence:
SELECT dept_name FROM department
SELECT dept_name FROM department ORDER BY dept_name
Final question: What are the names of all departments in alphabetical order?
Final SQL: SELECT dept_name FROM department ORDER BY dept_name
Database: college_1
Question sequence:
Tell me about all classes.
Which of those take place in room KLR209?
What are their codes?
SQL query sequence:
SELECT * FROM CLASS
SELECT * FROM CLASS WHERE class_room  =  'KLR209'
SELECT class_code FROM CLASS WHERE class_room  =  'KLR209'
Final question: What are the codes of all the courses that are located in room KLR209?
Final SQL: SELECT class_code FROM CLASS WHERE class_room  =  'KLR209'
Database: college_1
Question sequence:
Order the employee information by date of birth.
Which of these employees have jobs as professors?
What are their first names?
SQL query sequence:
SELECT * FROM employee ORDER BY emp_dob
SELECT * FROM employee WHERE emp_jobcode  =  'PROF' ORDER BY emp_dob
SELECT emp_fname FROM employee WHERE emp_jobcode  =  'PROF' ORDER BY emp_dob
Final question: What are the first names of all employees that are professors ordered by date of birth?
Final SQL: SELECT emp_fname FROM employee WHERE emp_jobcode  =  'PROF' ORDER BY emp_dob
Database: college_1
Question sequence:
Order the employees alphabetically by first name
Which of those are professors?
What are their first names and office locations?
SQL query sequence:
SELECT * FROM employee ORDER BY emp_fname
SELECT * FROM professor AS T1 JOIN employee AS T2 ON T1.emp_num  =  T2.emp_num ORDER BY T2.emp_fname
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
Final question: What are the first names and office locations for all professors sorted alphabetically by first name?
Final SQL: 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
Database: college_1
Question sequence:
What are the employees' first names?
Also, what are their last names?
Which of those refer to the oldest employee?
SQL query sequence:
SELECT emp_fname FROM employee
SELECT emp_fname ,  emp_lname FROM employee
SELECT emp_fname ,  emp_lname FROM employee ORDER BY emp_dob LIMIT 1
Final question: What are the first and last names of the employee with the earliest date of birth?
Final SQL: SELECT emp_fname ,  emp_lname FROM employee ORDER BY emp_dob LIMIT 1
Database: college_1
Question sequence:
List all information on students with a higher GPA than 3
What information is for the youngest student?
What are their first name, last name, and GPA?
SQL query sequence:
SELECT * FROM student WHERE stu_gpa  >  3
SELECT * FROM student WHERE stu_gpa  >  3 ORDER BY stu_dob DESC LIMIT 1
SELECT stu_fname ,  stu_lname ,  stu_gpa FROM student WHERE stu_gpa  >  3 ORDER BY stu_dob DESC LIMIT 1
Final question: What is the first and last name of the youngest student with a GPA above 3, and what is their GPA?
Final SQL: SELECT stu_fname ,  stu_lname ,  stu_gpa FROM student WHERE stu_gpa  >  3 ORDER BY stu_dob DESC LIMIT 1
Database: college_1
Question sequence:
What are the student ids of all students who received an enrollment grade of C?
What are the first names that correspond to each student id?
What is a list of distinct first names?
SQL query sequence:
SELECT stu_num FROM enroll WHERE enroll_grade  =  'C'
SELECT stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num  =  T2.stu_num WHERE enroll_grade  =  'C'
SELECT DISTINCT stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num  =  T2.stu_num WHERE enroll_grade  =  'C'
Final question: What are the first names of all students who got a grade C in a class?
Final SQL: SELECT DISTINCT stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num  =  T2.stu_num WHERE enroll_grade  =  'C'
Database: college_1
Question sequence:
For each department, what is the corresponding number of professors?
For the department with the fewest professors, what is its name and code?
SQL query sequence:
SELECT count(*) ,  T1.dept_code FROM professor AS T1 JOIN department AS T2 ON T1.dept_code  =  T2.dept_code GROUP BY T1.dept_code
SELECT T2.dept_name ,  T1.dept_code 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
Final question: What is the name of the department with the fewest professors?
Final SQL: 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
Database: college_1
Question sequence:
Which professors do have a Ph.D. degree?
How many of those professors are in each department?
Find the code of the department that has the most of them.
What is the name of that department?
SQL query sequence:
SELECT * FROM professor WHERE prof_high_degree  =  'Ph.D.'
SELECT count(*) ,  dept_code FROM professor WHERE prof_high_degree  =  'Ph.D.' GROUP BY dept_code
SELECT dept_code FROM professor WHERE prof_high_degree  =  'Ph.D.' GROUP BY dept_code ORDER BY count(*) DESC LIMIT 1
SELECT T2.dept_name 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
Final question: Which department has the most professors with a Ph.D.?
Final SQL: 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
Database: college_1
Question sequence:
What is the first names of employees whose job code is PROF?
Which of them are not teaching any class?
SQL query sequence:
SELECT emp_fname FROM employee WHERE emp_jobcode  =  'PROF'
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
Final question: What are the first names of all professors not teaching any classes?
Final SQL: 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
Database: college_1
Question sequence:
What are the first names of all employees who are teaching classes?
Please list the first names of all other professors.
Which of these refer to teachers in the history department?
SQL query sequence:
SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num  =  T2.prof_num
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 EXCEPT SELECT T4.emp_fname FROM employee AS T4 JOIN CLASS AS T5 ON T4.emp_num  =  T5.prof_num
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
Final question: What are the first names of all history professors who do not teach?
Final SQL: 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
Database: college_1
Question sequence:
What is all the information about the history department?
What are the names of professors in this department?
Also, where are their offices located?
SQL query sequence:
SELECT * FROM department WHERE dept_name  =  'History'
SELECT T1.emp_lname 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'
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'
Final question: What are the last name and office of all history professors?
Final SQL: 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'