[
  {
    "db_id": "computer_student",
    "question": "What are the course IDs of courses taught by students in Post_Generals phase?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.inPhase = 'Post_Generals'"
  },
  {
    "db_id": "computer_student",
    "question": "Which professor teaches the most courses?",
    "evidence": "",
    "SQL": "SELECT T1.p_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id GROUP BY T1.p_id ORDER BY COUNT(*) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "Which professors are advising only one student and how many students are they advising in total?",
    "evidence": "",
    "SQL": "SELECT T2.p_id, COUNT(*) AS num_students FROM person AS T1 LEFT JOIN advisedBy AS T2 ON T1.p_id = T2.p_id WHERE T2.p_id IS NOT NULL GROUP BY T2.p_id HAVING COUNT(*) = 1"
  },
  {
    "db_id": "computer_student",
    "question": "How many students are currently in their final phase of the program?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE yearsInProgram = 'Year_5' AND inPhase = 'Post_Quals'"
  },
  {
    "db_id": "computer_student",
    "question": "How many professors have taught more than one course?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id GROUP BY T1.p_id HAVING COUNT(T2.course_id) > 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course taught by professor with ID 319?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course, taughtBy WHERE course.course_id = taughtBy.course_id AND taughtBy.p_id = 319"
  },
  {
    "db_id": "computer_student",
    "question": "List the course IDs of the courses taught by professors with more than 3 years of program and in Phase 0.",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.yearsInProgram > 3 AND T3.inPhase = '0'"
  },
  {
    "db_id": "computer_student",
    "question": "How many undergraduate courses are taught by a professor who is also a student?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.student = 1 AND T3.hasPosition = 'Faculty'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course with ID 155?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 155"
  },
  {
    "db_id": "computer_student",
    "question": "How many students are in year 4 of the Post-Quals phase?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE yearsInProgram = 'Year_4' AND inPhase = 'Post_Quals' AND student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "Which course has students with a total program length of less than 4 years?",
    "evidence": "",
    "SQL": "SELECT course.course_id, COUNT(person.p_id) FROM course, taughtBy, person WHERE course.course_id = taughtBy.course_id AND taughtBy.p_id = person.p_id AND person.yearsInProgram < 'Year_4' GROUP BY course.course_id ORDER BY COUNT(person.p_id) DESC"
  },
  {
    "db_id": "computer_student",
    "question": "What courses is professor 426 teaching?",
    "evidence": "",
    "SQL": "SELECT * FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 426"
  },
  {
    "db_id": "computer_student",
    "question": "Which course has the most students?",
    "evidence": "",
    "SQL": "SELECT course.course_id, COUNT(person.p_id) AS num_students FROM course LEFT JOIN taughtBy ON course.course_id = taughtBy.course_id LEFT JOIN person ON taughtBy.p_id = person.p_id GROUP BY course.course_id ORDER BY num_students DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by the person who taught course no.13?",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy WHERE course_id = 13"
  },
  {
    "db_id": "computer_student",
    "question": "What is the list of students for a specific course Level_500?",
    "evidence": "",
    "SQL": "SELECT p_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T1.courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "Which students have not yet changed their 'hasPosition' to 'Student'?",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE hasPosition = '0' AND student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "List all the students enrolled in level 500 courses.",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE student = 1 AND (SELECT courseLevel FROM course JOIN taughtBy ON course.course_id = taughtBy.course_id WHERE taughtBy.p_id = person.p_id AND courseLevel = 'Level_500') IS NOT NULL"
  },
  {
    "db_id": "computer_student",
    "question": "What is the name of the courses taught by a professor who has more than 5 years in program and in phase 1?",
    "evidence": "",
    "SQL": "SELECT T3.courseLevel FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T1.course_id WHERE T2.yearsInProgram > 5 AND T2.inPhase = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of courses that are taught by a professor who has a student that has more than 2 advisors?",
    "evidence": "",
    "SQL": "SELECT COUNT(DISTINCT T1.course_id) FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN advisedBy AS T3 ON T2.p_id = T3.p_id WHERE T3.p_id_dummy IN (SELECT p_id FROM advisedBy GROUP BY p_id HAVING COUNT(p_id) > 2)"
  },
  {
    "db_id": "computer_student",
    "question": "Which person teaches the most number of professional or master/graduate courses?",
    "evidence": "",
    "SQL": "SELECT p_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T1.courseLevel = 'Level_500' GROUP BY T2.p_id ORDER BY COUNT(T2.course_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "Who among the faculty employee professors teaches 'Level_500' courses?",
    "evidence": "",
    "SQL": "SELECT DISTINCT T2.p_id FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id WHERE T1.hasPosition = 'Faculty_eme' AND T3.courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "What are the course IDs and levels of professors who teach more than 2 courses?",
    "evidence": "",
    "SQL": "SELECT T1.course_id, T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id GROUP BY T2.p_id, T1.course_id, T1.courseLevel HAVING COUNT(DISTINCT T2.course_id) > 2"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of students who are being taught by the professor with ID 351?",
    "evidence": "",
    "SQL": "SELECT COUNT(p_id) FROM person WHERE p_id IN (SELECT p_id FROM taughtBy WHERE p_id = 351)"
  },
  {
    "db_id": "computer_student",
    "question": "Find out the total number of professors and students in the given database.",
    "evidence": "",
    "SQL": "SELECT COUNT(p_id) AS professors, SUM(student) AS students FROM person WHERE professor = 0 OR student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "List all the professors that teach at least one course.",
    "evidence": "",
    "SQL": "SELECT p.p_id FROM person AS p WHERE p.professor = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are the course IDs and levels of courses taught by a professor who has position as Faculty_Emee",
    "evidence": "",
    "SQL": "SELECT T1.course_id, T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.hasPosition = 'Faculty_Emee'"
  },
  {
    "db_id": "computer_student",
    "question": "How many professors are involved in teaching courses at Level_500?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id WHERE T1.hasPosition = 'Faculty_aff' AND T3.courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total count of students and professors who are advised by a person who teaches a course?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN taughtBy AS T3 ON T2.p_id = T3.p_id GROUP BY T1.p_id"
  },
  {
    "db_id": "computer_student",
    "question": "What is the percentage of students who are in the Post_Generals phase and have not taken a course yet?",
    "evidence": "",
    "SQL": "SELECT CAST(SUM(CASE WHEN inPhase = 'Post_Generals' AND student = 1 AND yearsInProgram = 'Year_0' THEN 1 ELSE 0 END) AS REAL) * 100 / SUM(CASE WHEN inPhase = 'Post_Generals' AND student = 1 THEN 1 ELSE 0 END) AS percentage FROM person"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by person ID 9?",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy WHERE p_id = 9"
  },
  {
    "db_id": "computer_student",
    "question": "What professor has taught the most courses?",
    "evidence": "",
    "SQL": "SELECT T1.p_id FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id GROUP BY T1.p_id ORDER BY COUNT(T2.course_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course id of the course taught by the professor with p_id = 335?",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy WHERE p_id = 335"
  },
  {
    "db_id": "computer_student",
    "question": "What percentage of students in post-qualifying year are studying Level_400 courses?",
    "evidence": "",
    "SQL": "SELECT CAST(SUM(CASE WHEN c.courseLevel = 'Level_400' AND p.inPhase = 'Post_Quals' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) AS per FROM person AS p INNER JOIN course AS c ON p.student = 1 WHERE p.inPhase = 'Post_Quals'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the most popular level of course taught by a student?",
    "evidence": "",
    "SQL": "SELECT courseLevel, COUNT(*) AS totalCourses FROM course JOIN taughtBy ON course.course_id = taughtBy.course_id GROUP BY courseLevel ORDER BY totalCourses DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course with ID 118?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 118"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of students who take a Level_500 course?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE student = 1 AND NOT EXISTS (SELECT 1 FROM course WHERE courseLevel = 'Level_500') OR EXISTS (SELECT 1 FROM taughtBy WHERE course_id IN (SELECT course_id FROM course WHERE courseLevel = 'Level_500'))"
  },
  {
    "db_id": "computer_student",
    "question": "What level of courses are taught by a professor having more than one student?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T3.p_id = T2.p_id WHERE T3.student > 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of courses taught by a professor?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM taughtBy JOIN person ON taughtBy.p_id = person.p_id WHERE hasPosition = '1'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the most frequently taught course by a professor in the professional or master/undergraduate level?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id GROUP BY courseLevel ORDER BY COUNT(*) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level for a course with ID 24?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 24"
  },
  {
    "db_id": "computer_student",
    "question": "What are the IDs of students who have been advised by a professor who teaches Level_400 courses?",
    "evidence": "",
    "SQL": "SELECT T2.p_id FROM person AS T1 INNER JOIN advisedBy AS T2 ON T1.p_id = T2.p_id INNER JOIN taughtBy AS T3 ON T2.p_id = T3.p_id WHERE T3.course_id IN (SELECT course_id FROM course WHERE courseLevel = 'Level_400')"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course taught by the professor with ID 101?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 101"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of students who are not yet in any phase?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE inPhase = 0"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of students in Phase 1?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE inPhase = '1'"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses that have not been taught by any professors?",
    "evidence": "",
    "SQL": "SELECT course_id, courseLevel FROM course WHERE course_id NOT IN (SELECT course_id FROM taughtBy)"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are taught by advisors having at least 7 years of experience?",
    "evidence": "",
    "SQL": "SELECT course.courseLevel FROM course, taughtBy, person WHERE taughtBy.p_id = person.p_id AND person.yearsInProgram = 'Year_7' GROUP BY course.course_id, course.courseLevel"
  },
  {
    "db_id": "computer_student",
    "question": "What undergraduate courses are taught by a professor who has worked as a student?",
    "evidence": "",
    "SQL": "SELECT DISTINCT T3.course_id, T3.courseLevel FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T1.course_id = T3.course_id WHERE T2.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of the course with ID 14?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 14"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of students in the program and in what phase are they?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are the total number of students who have a position in the Post-Quals phase?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE hasPosition = '1' AND inPhase = 'Post_Quals'"
  },
  {
    "db_id": "computer_student",
    "question": "How many courses are taught by a faculty member in the Level_300 or Level_400 categories?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.professor = 1 AND T1.courseLevel IN ('Level_300', 'Level_400')"
  },
  {
    "db_id": "computer_student",
    "question": "Which students have a professor?",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE professor != 0"
  },
  {
    "db_id": "computer_student",
    "question": "Which course is taught by the most students?",
    "evidence": "",
    "SQL": "SELECT T1.course_id, COUNT(DISTINCT T2.p_id) AS student_count FROM taughtBy AS T2 INNER JOIN course AS T1 ON T2.course_id = T1.course_id GROUP BY T1.course_id ORDER BY student_count DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "How many students were in the same group as a professor in the current phase?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person AS T1 INNER JOIN advisedBy AS T2 ON T1.p_id = T2.p_id_dummy INNER JOIN person AS T3 ON T3.p_id = T2.p_id WHERE T1.inPhase = '0' AND T3.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of the course taught by person with ID 279?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 279"
  },
  {
    "db_id": "computer_student",
    "question": "Which professor has taught the most courses?",
    "evidence": "",
    "SQL": "SELECT p_id, COUNT(*) AS count FROM taughtBy GROUP BY p_id ORDER BY count DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of course ID 4?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 4"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course with the highest level?",
    "evidence": "",
    "SQL": "SELECT * FROM course ORDER BY courseLevel DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the list of course IDs for all courses taught by professors with more than one student?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.student > 1"
  },
  {
    "db_id": "computer_student",
    "question": "How many courses are Level 500?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM course WHERE courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course taught by a person with the highest number of taught courses?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id ORDER BY COUNT(T2.p_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the student who is taught the most courses?",
    "evidence": "",
    "SQL": "SELECT course.courseLevel FROM course INNER JOIN taughtBy AS T2 ON course.course_id = T2.course_id INNER JOIN person AS T1 ON T1.p_id = T2.p_id WHERE T1.student = 1 GROUP BY course.course_id ORDER BY COUNT(T2.course_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of course taught by the professor with ID 165?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id WHERE taughtBy.p_id = 165"
  },
  {
    "db_id": "computer_student",
    "question": "Which student has not yet taken a course?",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE student = 1 AND p_id NOT IN (SELECT p_id FROM taughtBy)"
  },
  {
    "db_id": "computer_student",
    "question": "What are the names of students who are advised by a professor who taught a Level_400 course?",
    "evidence": "",
    "SQL": "SELECT P2.student, P1.p_id AS professor_id FROM person AS P1 INNER JOIN person AS P2 ON P1.p_id = P2.professor INNER JOIN advisedBy AS T1 ON P1.p_id = T1.p_id_dummy INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T3.courseLevel = 'Level_400' AND P2.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of the course taught by the professor with the highest course ID?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course JOIN taughtBy ON course.course_id = taughtBy.course_id WHERE taughtBy.p_id IN (SELECT p_id FROM person ORDER BY p_id DESC LIMIT 1)"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course with the ID 117?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 117"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course with id 132?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 132"
  },
  {
    "db_id": "computer_student",
    "question": "Who taught the 'Level_500' course?",
    "evidence": "",
    "SQL": "SELECT T1.p_id FROM taughtBy AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of students in courses that have been taught by professors who have taught at least one 400-level course?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T3.courseLevel = 'Level_400' AND T1.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the name of the student who is advised by the professor with ID 107?",
    "evidence": "",
    "SQL": "SELECT P.student FROM person P INNER JOIN advisedBy AB ON P.p_id = AB.p_id_dummy WHERE AB.p_id = 107"
  },
  {
    "db_id": "computer_student",
    "question": "What is the ID of the student who is advised by the professor who teaches course with ID 39?",
    "evidence": "",
    "SQL": "SELECT T1.p_id FROM person AS T1 INNER JOIN advisedBy AS T2 ON T1.p_id = T2.p_id_dummy INNER JOIN taughtBy AS T3 ON T3.p_id = T2.p_id WHERE T3.course_id = 39 AND T1.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the name of the student who has been in the program for the least amount of time?",
    "evidence": "",
    "SQL": "SELECT p_id, yearsInProgram FROM person WHERE student = 1 ORDER BY yearsInProgram ASC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are taught by professors who have at least 3 years of experience in the program?",
    "evidence": "",
    "SQL": "SELECT T3.course_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T1.course_id = T3.course_id WHERE T2.yearsInProgram = 'Year_3'"
  },
  {
    "db_id": "computer_student",
    "question": "What level is the course with ID 74?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 74"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of students who have years in program less than 3?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE yearsInProgram LIKE 'Year_%' AND yearsInProgram NOT LIKE 'Year_4%' AND yearsInProgram NOT LIKE 'Year_5%'"
  },
  {
    "db_id": "computer_student",
    "question": "What courses has professor 335 taught?",
    "evidence": "",
    "SQL": "SELECT T1.course_id, T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 335"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of course with course ID 103?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 103"
  },
  {
    "db_id": "computer_student",
    "question": "What is the name of the faculty member who teaches the course with the highest level?",
    "evidence": "",
    "SQL": "SELECT T1.hasPosition FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id GROUP BY T1.hasPosition ORDER BY T3.courseLevel DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses that a student who has been in the program for at least 2 years and has a professor with more than 3 students in a specific course?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.student = 0 AND T3.yearsInProgram >= 2 AND T1.courseLevel = 'Level_500' GROUP BY T1.course_id HAVING COUNT(T3.p_id) > 3"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are taught by professors with at least 3 students advised by them in the Post_Generals phase?",
    "evidence": "",
    "SQL": "SELECT C.course_id, C.courseLevel FROM course C INNER JOIN taughtBy T ON C.course_id = T.course_id INNER JOIN person P ON T.p_id = P.p_id GROUP BY C.course_id, C.courseLevel HAVING COUNT(P.p_id) >= 3 AND P.inPhase = 'Post_Generals'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the name of the course taught by a professor in the Level_500 level?",
    "evidence": "",
    "SQL": "SELECT course.courseLevel, course.course_id FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id INNER JOIN person ON taughtBy.p_id = person.p_id WHERE person.professor = 1 AND course.courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "What are the IDs of students who are advised by a professor teaching Level_400 courses?",
    "evidence": "",
    "SQL": "SELECT DISTINCT T3.p_id FROM person AS T1 INNER JOIN advisedBy AS T2 ON T1.p_id = T2.p_id INNER JOIN taughtBy AS T3 ON T3.p_id = T1.p_id WHERE T3.course_id IN (SELECT course_id FROM course WHERE courseLevel = 'Level_400')"
  },
  {
    "db_id": "computer_student",
    "question": "Find the percentage of students who have not completed the program.",
    "evidence": "",
    "SQL": "SELECT CAST(SUM(CASE WHEN yearsInProgram = 'Year_1' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) AS per FROM person WHERE inPhase = 'Post_Quals'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the average years in program for professors?",
    "evidence": "",
    "SQL": "SELECT AVG(yearsInProgram) FROM person WHERE hasPosition = '1'"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are taught by a professor with 4 years in program?",
    "evidence": "",
    "SQL": "SELECT DISTINCT T1.course_id, T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T3.p_id = T2.p_id WHERE T3.yearsInProgram = 'Year_4' AND T3.professor = 1"
  },
  {
    "db_id": "computer_student",
    "question": "Which courses are taught by professors who have advised more than 3 students?",
    "evidence": "",
    "SQL": "SELECT T3.course_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T1.course_id INNER JOIN advisedBy AS T4 ON T2.p_id = T4.p_id_dummy GROUP BY T3.course_id HAVING COUNT(T4.p_id_dummy) > 3"
  },
  {
    "db_id": "computer_student",
    "question": "List the courses taught by a student who is in the third year of the program.",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.student = 1 AND T3.yearsInProgram = 'Year_3'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of course with ID 80?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 80"
  },
  {
    "db_id": "computer_student",
    "question": "What is the count of students that have a professor?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) AS student_count FROM person WHERE student = 1 AND professor = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of the course taught by the professor who has advised student no. 424?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN advisedBy AS T3 ON T3.p_id = T2.p_id WHERE T3.p_id = 424"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course ID of the course taught by the professor with p_id 201?",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy WHERE p_id = 201"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of the course taught by the professor with ID 141?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id IN (SELECT course_id FROM taughtBy WHERE p_id = 141)"
  },
  {
    "db_id": "computer_student",
    "question": "What is the ID of the students who advise other students?",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE student = 1 AND professor = 0 AND hasPosition = 0"
  },
  {
    "db_id": "computer_student",
    "question": "What is the ID of a person who is both a student and has a position?",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE student = 1 AND hasPosition = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the name of the course taught by professor 79?",
    "evidence": "",
    "SQL": "SELECT course.courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id WHERE taughtBy.p_id = 79"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of course ID 74?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 74"
  },
  {
    "db_id": "computer_student",
    "question": "Which person is a faculty member and is not a student?",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE professor = 1 AND student = 0"
  },
  {
    "db_id": "computer_student",
    "question": "How many students in the program have advised a student in a course taught by a professor with a Level_400 course?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM (SELECT * FROM person AS P1 INNER JOIN advisedBy AS A1 ON P1.p_id = A1.p_id INNER JOIN taughtBy AS T1 ON A1.p_id_dummy = T1.p_id INNER JOIN course AS C1 ON T1.course_id = C1.course_id WHERE C1.courseLevel = 'Level_400') AS T1"
  },
  {
    "db_id": "computer_student",
    "question": "Which faculty professors have taught a course with a level of 500?",
    "evidence": "",
    "SQL": "SELECT T1.p_id, T3.courseLevel FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id WHERE T3.courseLevel = 'Level_500' AND T1.hasPosition <> 0"
  },
  {
    "db_id": "computer_student",
    "question": "How many students are being advised by the same professor?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM advisedBy GROUP BY p_id"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by the faculty members?",
    "evidence": "",
    "SQL": "SELECT DISTINCT T1.course_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.hasPosition = 'Faculty'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the courses taught by professors who have more than 5 years of experience in the program?",
    "evidence": "",
    "SQL": "SELECT T3.courseLevel FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id WHERE T1.yearsInProgram > 5"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of courses that professor 1 is teaching?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM taughtBy WHERE p_id = 1"
  },
  {
    "db_id": "computer_student",
    "question": "Which professors teach Level_300 courses?",
    "evidence": "",
    "SQL": "SELECT P1.p_id FROM person AS P1 INNER JOIN taughtBy AS T1 ON P1.p_id = T1.p_id INNER JOIN course AS C1 ON T1.course_id = C1.course_id WHERE C1.courseLevel = 'Level_300'"
  },
  {
    "db_id": "computer_student",
    "question": "How many courses has Professor 331 taught?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM taughtBy WHERE p_id = 331"
  },
  {
    "db_id": "computer_student",
    "question": "What courses does professor 394 teach?",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy WHERE p_id = 394"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course ID of the courses taught by a professor who advises a student?",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy AS T1 INNER JOIN advisedBy AS T2 ON T1.p_id = T2.p_id"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of people who are currently in Pre_Quals phase?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE inPhase = 'Pre_Quals'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level for course with id 23?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 23"
  },
  {
    "db_id": "computer_student",
    "question": "What is the phase and years in program of a student with the ID 427?",
    "evidence": "",
    "SQL": "SELECT inPhase, yearsInProgram FROM person WHERE p_id = 427"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total count of courses taught by professors in Level_300 and Level_400?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM taughtBy AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.courseLevel = 'Level_300' OR T2.courseLevel = 'Level_400'"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are taught by professors who have more than 5 years of experience in the program?",
    "evidence": "",
    "SQL": "SELECT T1.course_id, T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.yearsInProgram > 5"
  },
  {
    "db_id": "computer_student",
    "question": "What is the professor ID of a faculty member who has taught a course with a course ID of 172?",
    "evidence": "",
    "SQL": "SELECT T1.p_id FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id WHERE T2.course_id = 172 AND T1.hasPosition = 'Faculty_aff'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of courses taught by a student who has been in the program for more than 3 years?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.yearsInProgram != 'Year_3'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course ID of the course taught by professor with ID 124?",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy WHERE p_id = 124"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level for the course with course ID 79?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 79"
  },
  {
    "db_id": "computer_student",
    "question": "What is the name of the course taught by the professor having the most taught courses?",
    "evidence": "",
    "SQL": "SELECT C.courseLevel FROM course AS C, taughtBy AS T, person AS P WHERE C.course_id = T.course_id AND T.p_id = P.p_id GROUP BY C.courseLevel ORDER BY COUNT(T.p_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the name of the student who is in 'Post_Quals' phase of their program and has no position?",
    "evidence": "",
    "SQL": "SELECT P1.p_id, P1.student FROM person AS P1 WHERE P1.inPhase = 'Post_Quals' AND P1.hasPosition = 0"
  },
  {
    "db_id": "computer_student",
    "question": "Which courses are taught by a professor that teaches at least two courses?",
    "evidence": "",
    "SQL": "SELECT course.course_id, course.courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id GROUP BY course.course_id, course.courseLevel HAVING COUNT(DISTINCT taughtBy.course_id) >= 2"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total count of students who are in Phase 0?",
    "evidence": "",
    "SQL": "SELECT COUNT(T1.student) AS total_count FROM person AS T1 WHERE T1.inPhase = '0'"
  },
  {
    "db_id": "computer_student",
    "question": "Which courses have a professor who taught a master course?",
    "evidence": "",
    "SQL": "SELECT * FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.professor = 1 AND T1.courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses that a professor with more than 2 advisors is teaching?",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy INNER JOIN person ON taughtBy.p_id = person.p_id WHERE person.student = 0 AND person.p_id IN (SELECT p_id FROM advisedBy GROUP BY p_id HAVING COUNT(p_id) > 2)"
  },
  {
    "db_id": "computer_student",
    "question": "Which students have a course advisor and what is the course level of the course they are advised by?",
    "evidence": "",
    "SQL": "SELECT T1.p_id, T3.courseLevel FROM person AS T1 INNER JOIN advisedBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T2.p_id_dummy = T3.course_id WHERE T1.student = 1 AND T2.p_id_dummy IS NOT NULL"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course taught by the person with p_id = 335?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 335"
  },
  {
    "db_id": "computer_student",
    "question": "Who are the students who were not advised by professors with the 'professor' role?",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE p_id NOT IN (SELECT p_id FROM advisedBy WHERE hasPosition = 'professor') AND student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course ID of the course taught by the professor who has been in the program for the most number of years?",
    "evidence": "",
    "SQL": "SELECT T2.course_id FROM taughtBy AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T1.p_id = T3.p_id GROUP BY T3.p_id ORDER BY T3.yearsInProgram DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "Which students under advisor 415 have finished the program in 4 or less years?",
    "evidence": "",
    "SQL": "SELECT * FROM person WHERE p_id IN (SELECT p_id_dummy FROM advisedBy WHERE p_id = 415) AND yearsInProgram = 'Year_4' OR yearsInProgram = 'Year_3' OR yearsInProgram = 'Year_2' OR yearsInProgram = 'Year_1' OR yearsInProgram = 'Year_0'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of students in the program who are currently in Phase 0 and have been in the program for 0 years?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE inPhase = '0' AND yearsInProgram = '0' AND student = '1'"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses that a student who has a professor with ID 364 teaches?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 364"
  },
  {
    "db_id": "computer_student",
    "question": "What is the year of study of the student who is advised by the professor teaching course no.78?",
    "evidence": "",
    "SQL": "SELECT person.yearsInProgram FROM person WHERE person.p_id IN (SELECT advisedBy.p_id FROM advisedBy INNER JOIN taughtBy ON advisedBy.p_id = taughtBy.p_id WHERE taughtBy.course_id = 78)"
  },
  {
    "db_id": "computer_student",
    "question": "Which students are not advised by a professor?",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE p_id NOT IN (SELECT p_id FROM advisedBy)"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of courses taught by professors with a specific level?",
    "evidence": "",
    "SQL": "SELECT COUNT(T2.course_id) FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T1.courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "How many students are in Level_500 courses?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id WHERE T1.student = 1 AND T3.courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "Which professor taught the course with course ID 68?",
    "evidence": "",
    "SQL": "SELECT T2.professor FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T1.course_id = 68"
  },
  {
    "db_id": "computer_student",
    "question": "What is the list of course IDs that a professor with more than 4 years in a program has taught?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.yearsInProgram > 'Year_4'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of courses taught by professors who are not faculty employees?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.hasPosition != 'Faculty_eme'"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by a professor who teaches both professional and master/undergraduate courses?",
    "evidence": "",
    "SQL": "SELECT DISTINCT T3.course_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T1.course_id WHERE T2.p_id IN (SELECT T2.p_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T1.courseLevel = 'Level_500') AND T1.course_id NOT IN (SELECT T1.course_id FROM course AS T1 WHERE T1.courseLevel != 'Level_500')"
  },
  {
    "db_id": "computer_student",
    "question": "How many courses does a professor with more than 5 years of experience in the program teach?",
    "evidence": "",
    "SQL": "SELECT COUNT(DISTINCT course_id) FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.yearsInProgram >= 'Year_5' AND T2.professor = 1"
  },
  {
    "db_id": "computer_student",
    "question": "Which professor has not taught any Level_400 course?",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE p_id NOT IN (SELECT p_id FROM taughtBy WHERE course_id IN (SELECT course_id FROM course WHERE courseLevel = 'Level_400'))"
  },
  {
    "db_id": "computer_student",
    "question": "What are the high-level or harder undergraduate courses taught by professor 390?",
    "evidence": "",
    "SQL": "SELECT course.course_id, course.courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id WHERE taughtBy.p_id = 390 AND course.courseLevel = 'Level_400'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of courses taught by professors having 'Level_500' course level?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM taughtBy AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T1.p_id = T3.p_id WHERE T2.courseLevel = 'Level_500' AND T3.professor = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of students enrolled in courses at Level_500?",
    "evidence": "",
    "SQL": "SELECT COUNT(student) FROM person AS P1 INNER JOIN course AS C1 ON P1.student = 1 INNER JOIN taughtBy AS T1 ON C1.course_id = T1.course_id WHERE C1.courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the name of the students who are currently in their post-qualification phase and have not taken any courses?",
    "evidence": "",
    "SQL": "SELECT * FROM person WHERE inPhase = 'Post_Quals' AND student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "How many courses does professor 331 teach?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM taughtBy WHERE p_id = 331"
  },
  {
    "db_id": "computer_student",
    "question": "What are the unique course IDs taught by the professor who taught courses at Level 400?",
    "evidence": "",
    "SQL": "SELECT DISTINCT T1.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T1.courseLevel = 'Level_400'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course with course ID 123?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 123"
  },
  {
    "db_id": "computer_student",
    "question": "Which professors teach the courses that are classified as Level_400?",
    "evidence": "",
    "SQL": "SELECT T1.p_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T1.course_id WHERE T3.courseLevel = 'Level_400'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the ID of the student who has taken the most courses?",
    "evidence": "",
    "SQL": "SELECT p_id FROM person AS T1 WHERE T1.student = 1 ORDER BY (SELECT COUNT(*) FROM taughtBy AS T2 WHERE T2.p_id = T1.p_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the position status and course ID of a professor who is teaching 'Level_500' course?",
    "evidence": "",
    "SQL": "SELECT T2.hasPosition, T1.course_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T1.course_id = 77"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by the person with ID 222?",
    "evidence": "",
    "SQL": "SELECT * FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 222"
  },
  {
    "db_id": "computer_student",
    "question": "Which students are part of the most recent phase?",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE inPhase = (SELECT MAX(inPhase) FROM person)"
  },
  {
    "db_id": "computer_student",
    "question": "Which professors have taught Level_500 course?",
    "evidence": "",
    "SQL": "SELECT T1.p_id FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id WHERE T2.course_id IN (SELECT course_id FROM course WHERE courseLevel = 'Level_500')"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of students who have professors with more than two years of experience?",
    "evidence": "",
    "SQL": "SELECT COUNT(T2.student) FROM person AS T1 INNER JOIN person AS T2 ON T1.professor = T2.p_id WHERE T2.yearsInProgram > '2'"
  },
  {
    "db_id": "computer_student",
    "question": "Which courses are taught by professors with more than 5 years of experience in the program?",
    "evidence": "",
    "SQL": "SELECT C.course_id, P.yearsInProgram FROM course AS C INNER JOIN taughtBy AS T ON C.course_id = T.course_id INNER JOIN person AS P ON T.p_id = P.p_id WHERE P.yearsInProgram > 'Year_5'"
  },
  {
    "db_id": "computer_student",
    "question": "How many courses are taught by professors who have had more than one student over the years in the program?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.student > 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of students who are not faculty employees?",
    "evidence": "",
    "SQL": "SELECT COUNT(DISTINCT student) FROM person WHERE hasPosition != 'Faculty_eme'"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are taught by professors with more than 1 year of experience?",
    "evidence": "",
    "SQL": "SELECT T1.course_id, T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T3.p_id = T2.p_id WHERE T3.student = 0 AND T3.yearsInProgram LIKE '%1%' OR T3.yearsInProgram LIKE '%2%' OR T3.yearsInProgram LIKE '%3%' OR T3.yearsInProgram LIKE '%4%'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course ID of the course taught by professor with ID 394?",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy WHERE p_id = 394"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of the course taught by the student who has been in the program for 2 years?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id INNER JOIN person ON taughtBy.p_id = person.p_id WHERE person.yearsInProgram = '2' AND person.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "Which student has taken the most courses?",
    "evidence": "",
    "SQL": "SELECT T1.p_id FROM person AS T1 LEFT JOIN taughtBy AS T2 ON T1.p_id = T2.p_id GROUP BY T1.p_id ORDER BY COUNT(T2.course_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "Which student is advised by the most advisors?",
    "evidence": "",
    "SQL": "SELECT T1.p_id, COUNT(T2.p_id_dummy) AS num_advisors FROM person AS T1 INNER JOIN advisedBy AS T2 ON T1.p_id = T2.p_id GROUP BY T1.p_id ORDER BY num_advisors DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of years in program of students who are not in pre-quals? ",
    "evidence": "",
    "SQL": "SELECT COUNT(DISTINCT yearsInProgram) FROM person WHERE inPhase != 'Pre_Quals'"
  },
  {
    "db_id": "computer_student",
    "question": "List the course IDs of all Level_500 courses that have a professor with 'Post_Quals' phase.",
    "evidence": "",
    "SQL": "SELECT course_id FROM course WHERE courseLevel = 'Level_500' AND course_id IN (SELECT course_id FROM taughtBy WHERE p_id IN (SELECT p_id FROM person WHERE inPhase = 'Post_Quals'))"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course ID of the course Level_500 that has a professor with the most years in the program?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id GROUP BY T1.course_id ORDER BY (SELECT COUNT(T3.p_id) FROM person AS T4 WHERE T3.p_id = T4.p_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of years of experience in the program for students who were in the same phase as student with ID 418?",
    "evidence": "",
    "SQL": "SELECT COUNT(DISTINCT yearsInProgram) FROM person WHERE inPhase = (SELECT inPhase FROM person WHERE p_id = 418)"
  },
  {
    "db_id": "computer_student",
    "question": "What is the program year of the professor who teaches course 91?",
    "evidence": "",
    "SQL": "SELECT yearsInProgram FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id WHERE T2.course_id = 91"
  },
  {
    "db_id": "computer_student",
    "question": "What is the name of the phase of the program that a student has been in for more than 2 years?",
    "evidence": "",
    "SQL": "SELECT DISTINCT inPhase FROM person WHERE yearsInProgram > 2"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of years of program for students in a specific phase?",
    "evidence": "",
    "SQL": "SELECT SUM(yearsInProgram) FROM person WHERE inPhase = 'some specified phase'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of course 157?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 157"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of students in Pre_Quals who have not had a position?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE inPhase = 'Pre_Quals' AND hasPosition = '0'"
  },
  {
    "db_id": "computer_student",
    "question": "Which course has the highest number of students who are in the first year of a program and has not yet taken a course at the same level?",
    "evidence": "",
    "SQL": "SELECT * FROM course WHERE course_id IN (SELECT course_id FROM taughtBy WHERE p_id IN (SELECT p_id FROM person WHERE inPhase = '0' AND yearsInProgram = '0'))"
  },
  {
    "db_id": "computer_student",
    "question": "How many people are currently not in any position?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE hasPosition = '0'"
  },
  {
    "db_id": "computer_student",
    "question": "What course levels are taught by professors with at least two years of teaching experience?",
    "evidence": "",
    "SQL": "SELECT DISTINCT T3.courseLevel FROM course AS T3 INNER JOIN taughtBy AS T2 ON T3.course_id = T2.course_id INNER JOIN person AS T1 ON T2.p_id = T1.p_id WHERE T1.yearsInProgram LIKE '%Year_%' AND T1.yearsInProgram LIKE '%_2%'"
  },
  {
    "db_id": "computer_student",
    "question": "Who is teaching course with the highest course level and what is the course level?",
    "evidence": "",
    "SQL": "SELECT T1.p_id, MAX(T2.courseLevel) FROM course AS T2 INNER JOIN taughtBy AS T1 ON T2.course_id = T1.course_id GROUP BY T1.p_id"
  },
  {
    "db_id": "computer_student",
    "question": "Which course is taught by the professor with the most number of advised students?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN advisedBy AS T3 ON T2.p_id = T3.p_id GROUP BY T1.course_id ORDER BY COUNT(T3.p_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of courses taught by Faculty members?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.hasPosition = 'Faculty'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course with ID 135?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 135"
  },
  {
    "db_id": "computer_student",
    "question": "What is the average number of courses each professor teaches?",
    "evidence": "",
    "SQL": "SELECT COUNT(T2.course_id) / COUNT(DISTINCT T2.p_id) AS avgnum FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id GROUP BY T2.p_id"
  },
  {
    "db_id": "computer_student",
    "question": "What is the highest level of undergraduate courses being taught by a person?",
    "evidence": "",
    "SQL": "SELECT MAX(T1.courseLevel) FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course taught by professor ID 351?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id IN (SELECT course_id FROM taughtBy WHERE p_id = 351)"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course with course ID 71?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 71"
  },
  {
    "db_id": "computer_student",
    "question": "What are the course IDs that have Level_200?",
    "evidence": "",
    "SQL": "SELECT course_id FROM course WHERE courseLevel = 'Level_200'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course taught by professor with ID 124?",
    "evidence": "",
    "SQL": "SELECT course.courseLevel FROM taughtBy INNER JOIN course ON taughtBy.course_id = course.course_id WHERE taughtBy.p_id = 124"
  },
  {
    "db_id": "computer_student",
    "question": "What is the most common level of courses taught by professors?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel, COUNT(*) AS count FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id GROUP BY T1.courseLevel ORDER BY count DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are the highest-level undergraduate courses taught by a professor who is currently in their first year of program?",
    "evidence": "",
    "SQL": "SELECT DISTINCT T1.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T1.courseLevel = 'Level_400' AND T3.inPhase = '1' ORDER BY T1.course_id DESC"
  },
  {
    "db_id": "computer_student",
    "question": "What level of courses are there that are not taught by students?",
    "evidence": "",
    "SQL": "SELECT DISTINCT T1.courseLevel FROM course T1 LEFT JOIN taughtBy T2 ON T1.course_id = T2.course_id WHERE T2.course_id IS NULL"
  },
  {
    "db_id": "computer_student",
    "question": "What is the average years of experience of all students who are not in Phase 0?",
    "evidence": "",
    "SQL": "SELECT AVG(yearsInProgram) FROM person WHERE inPhase <> '0' AND student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are the ID numbers of professors who teach Level_400 courses?",
    "evidence": "",
    "SQL": "SELECT T1.p_id FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T3.courseLevel = 'Level_400'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of courses taught by professors who have been a student in Post_Quals program?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id WHERE T1.inPhase = 'Post_Quals' AND T1.student = 0"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course taught by the professor with p_id 404?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id WHERE taughtBy.p_id = 404"
  },
  {
    "db_id": "computer_student",
    "question": "What is the name of the student with the highest number of courses taught?",
    "evidence": "",
    "SQL": "SELECT P.student, COUNT(*) FROM TAUGHTBY AS T1 INNER JOIN COURSE AS T2 ON T1.COURSE_ID = T2.COURSE_ID INNER JOIN PERSON AS P ON T1.P_ID = P.P_ID GROUP BY P.P_ID ORDER BY COUNT(*) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are the professor IDs of the faculty members who taught the courses with ID from 101 to 110?",
    "evidence": "",
    "SQL": "SELECT T2.p_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T1.course_id > 100 AND T1.course_id < 111 AND T2.p_id IN (SELECT p_id FROM person WHERE professor = 1)"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are taught by a professor who has been in the program for more than 3 years?",
    "evidence": "",
    "SQL": "SELECT course.course_id, course.courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id INNER JOIN person ON person.p_id = taughtBy.p_id WHERE person.yearsInProgram > 3"
  },
  {
    "db_id": "computer_student",
    "question": "Which students who are not professors are in the 12th year of the program?",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE professor = 0 AND yearsInProgram = 'Year_12'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the highest course level offered by a professor?",
    "evidence": "",
    "SQL": "SELECT MAX(courseLevel) FROM course"
  },
  {
    "db_id": "computer_student",
    "question": "Which professor taught the course with ID '161'?",
    "evidence": "",
    "SQL": "SELECT p_id FROM taughtBy WHERE course_id = 161"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of the course taught by the professor having 'Post_Generals' in their phase?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course JOIN taughtBy ON course.course_id = taughtBy.course_id JOIN person ON taughtBy.p_id = person.p_id WHERE person.inPhase = 'Post_Generals' GROUP BY courseLevel"
  },
  {
    "db_id": "computer_student",
    "question": "Which professors have taught courses with levels above Level_100?",
    "evidence": "",
    "SQL": "SELECT T1.p_id FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id WHERE T3.courseLevel > 'Level_100'"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by a professor with the ID 211?",
    "evidence": "",
    "SQL": "SELECT T1.course_id, T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 211"
  },
  {
    "db_id": "computer_student",
    "question": "How many students have more than one advisor?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person AS T1 INNER JOIN advisedBy AS T2 ON T1.p_id = T2.p_id GROUP BY T1.p_id HAVING COUNT(T2.p_id_dummy) > 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course that has ID 14?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 14"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by a professor who is not in a position?",
    "evidence": "",
    "SQL": "SELECT T1.course_id, T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.hasPosition = '0'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the general course level of the course with course ID 66?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 66"
  },
  {
    "db_id": "computer_student",
    "question": "What are all the courses taught by a professor?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id IN (SELECT p_id FROM person WHERE professor = 1)"
  },
  {
    "db_id": "computer_student",
    "question": "What is the highest level of a course taught by a person with the highest number of advising positions?",
    "evidence": "",
    "SQL": "SELECT T3.courseLevel FROM course AS T3 INNER JOIN taughtBy AS T2 ON T2.course_id = T3.course_id INNER JOIN advisedBy AS T1 ON T2.p_id = T1.p_id_dummy GROUP BY T3.courseLevel ORDER BY COUNT(T1.p_id_dummy) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are the IDs of courses taught by professors who have taught more than 2 courses?",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id GROUP BY course_id HAVING COUNT(T2.p_id) > 2"
  },
  {
    "db_id": "computer_student",
    "question": "How many professors are not teaching any courses?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE p_id NOT IN (SELECT p_id FROM taughtBy)"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by a professor who has been in the program for more than 5 years?",
    "evidence": "",
    "SQL": "SELECT T1.course_id, T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.yearsInProgram > 5"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are taught by professors with more than 5 years of experience in the program?",
    "evidence": "",
    "SQL": "SELECT DISTINCT T2.course_id FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id WHERE T1.yearsInProgram > 5"
  },
  {
    "db_id": "computer_student",
    "question": "Which students in Phase 0 are in their first year in the program?",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE inPhase = '0' AND yearsInProgram = '0'"
  },
  {
    "db_id": "computer_student",
    "question": "Who are the professors of course with ID 18?",
    "evidence": "",
    "SQL": "SELECT T1.p_id FROM taughtBy AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.course_id = 18"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by professors who are also students?",
    "evidence": "",
    "SQL": "SELECT course.course_id, course.courseLevel FROM course JOIN taughtBy ON course.course_id = taughtBy.course_id JOIN person ON taughtBy.p_id = person.p_id WHERE person.student = 1 AND person.professor = 0"
  },
  {
    "db_id": "computer_student",
    "question": "Who are the students who have a professor with more than 5 courses taught?",
    "evidence": "",
    "SQL": "SELECT T2.p_id FROM person AS T1 INNER JOIN advisedBy AS T2 ON T1.p_id = T2.p_id INNER JOIN taughtBy AS T3 ON T2.p_id = T3.p_id GROUP BY T2.p_id HAVING COUNT(DISTINCT T3.course_id) > 5"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course taught by professor with ID '1'?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id WHERE taughtBy.p_id = 1"
  },
  {
    "db_id": "computer_student",
    "question": "Which course is taught by professor 235 and is not a Level_500 course?",
    "evidence": "",
    "SQL": "SELECT course.courseLevel, course.course_id FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id WHERE taughtBy.p_id = 235 AND course.courseLevel != 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the average number of years in program for students in Post_Generals phase?",
    "evidence": "",
    "SQL": "SELECT AVG(yearsInProgram) FROM person WHERE inPhase = 'Post_Generals' AND student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the highest level of course that is not being taught by any professor?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id NOT IN (SELECT course_id FROM taughtBy)"
  },
  {
    "db_id": "computer_student",
    "question": "What course levels are offered by a professor who has taught for more than 5 years?",
    "evidence": "",
    "SQL": "SELECT DISTINCT courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T3.p_id = T2.p_id WHERE yearsInProgram > 5"
  },
  {
    "db_id": "computer_student",
    "question": "What is the name of the course that has been taught by the person with p_id 82?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course JOIN taughtBy ON course.course_id = taughtBy.course_id WHERE taughtBy.p_id = 82"
  },
  {
    "db_id": "computer_student",
    "question": "What is the ID of the students who have advisors and what is their program year?",
    "evidence": "",
    "SQL": "SELECT p_id, yearsInProgram FROM person WHERE p_id IN (SELECT p_id FROM advisedBy)"
  },
  {
    "db_id": "computer_student",
    "question": "What is the highest level of course taught by the most students?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id ORDER BY COUNT(T2.p_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "Which courses were taught by a student?",
    "evidence": "",
    "SQL": "SELECT DISTINCT T1.course_id FROM person AS T2 INNER JOIN taughtBy AS T1 ON T2.p_id = T1.p_id WHERE T2.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of students in the program who are currently in a phase and have more than 0 years of program?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE inPhase = '1' AND yearsInProgram > 0"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses being taught by professors who have a position in the faculty?",
    "evidence": "",
    "SQL": "SELECT T1.course_id, T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.hasPosition = '1'"
  },
  {
    "db_id": "computer_student",
    "question": "What course is taught by professor with ID 319?",
    "evidence": "",
    "SQL": "SELECT course.course_id, course.courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id WHERE taughtBy.p_id = 319"
  },
  {
    "db_id": "computer_student",
    "question": "How many people are students in Year_2?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE inPhase = 'Pre_Quals' AND yearsInProgram = 'Year_2' AND student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of students under advisor 255?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM advisedBy WHERE p_id = 255"
  },
  {
    "db_id": "computer_student",
    "question": "What are the IDs of the students in 'Post_Generals' phase?",
    "evidence": "",
    "SQL": "SELECT student FROM person WHERE inPhase = 'Post_Generals'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of professors who teach undergraduate courses at Level 500?",
    "evidence": "",
    "SQL": "SELECT COUNT(DISTINCT p_id) FROM taughtBy INNER JOIN course ON taughtBy.course_id = course.course_id WHERE course.courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "Which course has more teachers, course no.29 or course no.147?",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy WHERE course_id = 29 OR course_id = 147 GROUP BY course_id ORDER BY COUNT(p_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "Who is the most experienced professor in the Level_400 course?",
    "evidence": "",
    "SQL": "SELECT T2.p_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T1.courseLevel = 'Level_400' GROUP BY T2.p_id ORDER BY COUNT(DISTINCT T2.course_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the position in the faculty of the professor who teaches the most Level_500 courses?",
    "evidence": "",
    "SQL": "SELECT T1.hasPosition FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id WHERE T1.professor = 1 GROUP BY T1.p_id ORDER BY COUNT(T2.course_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the courseLevel of the course with the highest course ID?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course ORDER BY course_id DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by faculty members with at least 5 years of experience in the program?",
    "evidence": "",
    "SQL": "SELECT T3.course_id, T3.courseLevel FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T1.course_id WHERE T2.yearsInProgram >= '5' AND T2.hasPosition = 'Faculty_aff'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course with id 16?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 16"
  },
  {
    "db_id": "computer_student",
    "question": "What is the position of the person who has been in the program for 7 years and currently in Post_Generals phase?",
    "evidence": "",
    "SQL": "SELECT hasPosition FROM person WHERE yearsInProgram = 'Year_7' AND inPhase = 'Post_Generals'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the courses taught by person with ID 263?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id WHERE taughtBy.p_id = 263"
  },
  {
    "db_id": "computer_student",
    "question": "How many students did professor with ID 351 advise?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM advisedBy WHERE p_id_dummy = (SELECT p_id FROM person WHERE p_id = 351)"
  },
  {
    "db_id": "computer_student",
    "question": "Find the list of courses taught by professors who have been faculty members for more than 3 years.",
    "evidence": "",
    "SQL": "SELECT T2.course_id FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id WHERE T1.professor = 1 AND T1.yearsInProgram > 3"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course with the highest level of professorship?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id IN (SELECT course_id FROM taughtBy GROUP BY course_id ORDER BY COUNT(p_id) DESC LIMIT 1)"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of students who have been in a program for at least 5 years?",
    "evidence": "",
    "SQL": "SELECT COUNT(student) FROM person WHERE yearsInProgram = 'Year_5'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of course 84?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 84"
  },
  {
    "db_id": "computer_student",
    "question": "What courses does the professor with p_id 1 teach?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM taughtBy AS T1 WHERE T1.p_id = '1'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course taught by professor 394?",
    "evidence": "",
    "SQL": "SELECT T3.courseLevel FROM course AS T3 INNER JOIN taughtBy AS T2 ON T2.course_id = T3.course_id INNER JOIN person AS T1 ON T2.p_id = T1.p_id WHERE T1.p_id = 394"
  },
  {
    "db_id": "computer_student",
    "question": "What is the average number of courses each faculty member has taught?",
    "evidence": "",
    "SQL": "SELECT CAST(COUNT(course_id) AS REAL) / COUNT(DISTINCT p_id) AS avgnum FROM taughtBy GROUP BY p_id"
  },
  {
    "db_id": "computer_student",
    "question": "Who teaches the course with course_id 161?",
    "evidence": "",
    "SQL": "SELECT T.p_id, T2.courseLevel FROM taughtBy AS T INNER JOIN course AS T2 ON T.course_id = T2.course_id WHERE T.course_id = 161"
  },
  {
    "db_id": "computer_student",
    "question": "What are all the students who have been advised by a professor who teaches at least one course?",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE student = 1 AND p_id IN (SELECT T2.p_id FROM person AS T1 INNER JOIN advisedBy AS T2 ON T1.p_id = T2.p_id_dummy INNER JOIN taughtBy AS T3 ON T1.p_id = T3.p_id GROUP BY T2.p_id HAVING COUNT(T3.course_id) > 0)"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by the advisor with ID 5?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id IN (SELECT p_id FROM advisedBy WHERE p_id_dummy = 5)"
  },
  {
    "db_id": "computer_student",
    "question": "What is the ID of a student who has been in the program for at least 2 years and currently in phase Post_Quals?",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE yearsInProgram = 'Year_2' AND inPhase = 'Post_Quals' LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "Which students are in their first year and have advisors with course ID 110?",
    "evidence": "",
    "SQL": "SELECT P.student, C.course_id FROM person AS P INNER JOIN advisedBy AS AB ON P.p_id = AB.p_id INNER JOIN course AS C ON C.course_id = AB.p_id_dummy WHERE P.inPhase = 'Year_1' AND C.course_id = 110"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of students in the program in Year 2?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE yearsInProgram = 'Year_2'"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are taught by professors with more than 2 years in program?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.yearsInProgram > 2"
  },
  {
    "db_id": "computer_student",
    "question": "What is the average course level of courses taught by a student?",
    "evidence": "",
    "SQL": "SELECT AVG(courseLevel) FROM course JOIN taughtBy ON course.course_id = taughtBy.course_id JOIN person ON taughtBy.p_id = person.p_id WHERE person.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of courses taught by advisors who teach both professional and master/graduate courses?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN advisedBy AS T3 ON T2.p_id = T3.p_id AND T3.p_id_dummy = T3.p_id WHERE T1.courseLevel IN ('Level_500', 'Level_200') GROUP BY T3.p_id"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course with ID 144?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 144"
  },
  {
    "db_id": "computer_student",
    "question": "What is the percentage of students in Post-Generals phase who have been teaching for more than 4 years?",
    "evidence": "",
    "SQL": "SELECT ROUND((COUNT(DISTINCT T1.p_id))/((SELECT COUNT(*) FROM person WHERE inPhase = 'Post_Generals')) * 100, 2) FROM person AS T1 WHERE T1.yearsInProgram > 'Year_4'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of course number 166?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 166"
  },
  {
    "db_id": "computer_student",
    "question": "Who are the professors that taught the course with the course id 110?",
    "evidence": "",
    "SQL": "SELECT p_id FROM taughtBy WHERE course_id = 110"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of courses taught by faculty professors?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.hasPosition = 'Faculty'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the list of students who are taking more than 3 courses?",
    "evidence": "",
    "SQL": "SELECT * FROM person WHERE student = 1 AND (SELECT COUNT(*) FROM taughtBy WHERE taughtBy.p_id = person.p_id) > 3"
  },
  {
    "db_id": "computer_student",
    "question": "Which courses are taught by a professor with the general course level 'Level_500' and list the ID of the professor?",
    "evidence": "",
    "SQL": "SELECT T1.p_id, T3.course_id, T3.courseLevel FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id WHERE T3.courseLevel = 'Level_500' ORDER BY T3.course_id"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are taught by the professors who have more than 5 years of experience?",
    "evidence": "",
    "SQL": "SELECT T3.course_id, T3.courseLevel FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T1.course_id WHERE T2.yearsInProgram > 'Year_5'"
  },
  {
    "db_id": "computer_student",
    "question": "What are the names of the students in Year 4 who are not in post-quals phase?",
    "evidence": "",
    "SQL": "SELECT T1.p_id FROM person AS T1 WHERE T1.yearsInProgram = 'Year_4' AND T1.inPhase != 'Post_Quals'"
  },
  {
    "db_id": "computer_student",
    "question": "List the students who are in Year_5 in the faculty",
    "evidence": "",
    "SQL": "SELECT student FROM person WHERE yearsInProgram = 'Year_5' AND hasPosition = 'Faculty_eme'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the minimum level of the course taught by a professor with at least 3 years of experience in the program?",
    "evidence": "",
    "SQL": "SELECT MIN(T1.courseLevel) FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.yearsInProgram = 'Year_3' GROUP BY T1.course_id HAVING COUNT(T2.course_id) > 1"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are taught by Professor 335 and have at least one student?",
    "evidence": "",
    "SQL": "SELECT T1.course_id, T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.student = 1 GROUP BY T1.course_id, T1.courseLevel"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by a professor who has more than 5 years of experience?",
    "evidence": "",
    "SQL": "SELECT distinct course.course_id, course.courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id INNER JOIN person ON taughtBy.p_id = person.p_id WHERE person.yearsInProgram > 'Year_5'"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses that have been taught by professors who have more than 5 years of experience?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T3.p_id = T2.p_id WHERE T3.yearsInProgram > 5"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of students who are in Phase 0, yet have not held a position as professor?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE inPhase = '0' AND hasPosition = '0'"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses that the student with p_id = 404 is currently taking?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM taughtBy AS T1 WHERE T1.p_id = (SELECT p_id FROM person WHERE p_id = 404)"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of a course that has at least two teachers?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id IN (SELECT course_id FROM taughtBy GROUP BY course_id HAVING COUNT(p_id) > 1)"
  },
  {
    "db_id": "computer_student",
    "question": "What are the IDs of the students who are currently in phase 0 and have 0 years in the program?",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE student = 1 AND inPhase = '0' AND yearsInProgram = '0'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of the course with the id 80?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 80"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses and their levels taught by a student who is not a professor?",
    "evidence": "",
    "SQL": "SELECT T3.course_id, T3.courseLevel FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T1.course_id WHERE T2.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What course is taught by the professor with ID 240?",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy WHERE p_id = 240"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of students taught by a faculty affiliated professor in Level_400 course?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id WHERE T1.hasPosition = 'Faculty_aff' AND T1.student = 1 AND T3.courseLevel = 'Level_400'"
  },
  {
    "db_id": "computer_student",
    "question": "What courses were taught by the most experienced teacher?",
    "evidence": "",
    "SQL": "SELECT c.course_id, c.courseLevel FROM course c INNER JOIN taughtBy t ON c.course_id = t.course_id INNER JOIN person p ON t.p_id = p.p_id GROUP BY c.course_id, c.courseLevel ORDER BY p.yearsInProgram DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are taught by professors who are not in the 'Faculty_adj' position?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.hasPosition != 'Faculty_adj' GROUP BY T1.course_id"
  },
  {
    "db_id": "computer_student",
    "question": "What is the name of the course taught by the professor with ID `181`?",
    "evidence": "",
    "SQL": "SELECT course.course_id, course.courseLevel FROM taughtBy AS T1 INNER JOIN course ON T1.course_id = course.course_id INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.p_id = 181"
  },
  {
    "db_id": "computer_student",
    "question": "What are the names of the courses taught by professors with more than 5 years of experience in the program?",
    "evidence": "",
    "SQL": "SELECT T1.course_id, T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T3.p_id = T2.p_id WHERE T3.yearsInProgram > 5"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of courses taught by the professors who have a position in the faculty?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.hasPosition = 'Faculty_aff'"
  },
  {
    "db_id": "computer_student",
    "question": "What are the IDs of students who have advisors?",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE student = 1 AND p_id IN (SELECT p_id FROM advisedBy)"
  },
  {
    "db_id": "computer_student",
    "question": "What is the ID of the student who is taking a course with the highest level of difficulty?",
    "evidence": "",
    "SQL": "SELECT person.p_id FROM person LEFT JOIN advisedBy ON person.p_id = advisedBy.p_id_dummy WHERE advisedBy.p_id_dummy IS NULL AND (SELECT course.course_id FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id WHERE course.courseLevel = (SELECT MAX(course.courseLevel) FROM course) LIMIT 1) IN (SELECT taughtBy.course_id FROM taughtBy WHERE taughtBy.p_id = person.p_id)"
  },
  {
    "db_id": "computer_student",
    "question": "How many Level_500 courses have not been taught by a professor with experience less than 1 year?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM taughtBy T1 INNER JOIN course T2 ON T1.course_id = T2.course_id INNER JOIN person T3 ON T1.p_id = T3.p_id WHERE T2.courseLevel = 'Level_500' AND T3.yearsInProgram < 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of courses taught by professors?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM taughtBy WHERE taughtBy.p_id IN (SELECT p_id FROM person WHERE professor = 1)"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of the course taught by the professor who has position 'Faculty_employee'?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.hasPosition = 'Faculty_employee'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of undergraduate students being advised by professors?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person AS T1 INNER JOIN advisedBy AS T2 ON T1.p_id = T2.p_id WHERE T1.student = 1 AND T2.p_id IS NOT NULL"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course ID of the courses taught by the professor with the highest years in program?",
    "evidence": "",
    "SQL": "SELECT T3.course_id FROM course AS T3 INNER JOIN taughtBy AS T4 ON T3.course_id = T4.course_id INNER JOIN person AS T1 ON T4.p_id = T1.p_id ORDER BY T1.yearsInProgram DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course ID and course level of the courses taught by professors who have been students themselves?",
    "evidence": "",
    "SQL": "SELECT T3.course_id, T3.courseLevel FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T1.course_id WHERE T2.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are taught by students?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by professors who have taught both harder undergraduate courses and master/graduate courses?",
    "evidence": "",
    "SQL": "SELECT * FROM taughtBy AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T1.p_id = T3.p_id WHERE T2.courseLevel = 'Level_400' OR T2.courseLevel = 'Level_500' GROUP BY T1.p_id HAVING COUNT(DISTINCT T2.course_id) > 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course taught by the professor with person ID 375?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 375"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level for course 118?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 118"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of students enrolled in the courses taught by a person with position '0'?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.hasPosition = '0'"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses that a student in their second year of program has to take?",
    "evidence": "",
    "SQL": "SELECT C.course_id FROM course C INNER JOIN taughtBy T ON C.course_id = T.course_id INNER JOIN person P ON T.p_id = P.p_id WHERE P.inPhase = 'Pre_Quals' AND P.yearsInProgram = 'Year_2'"
  },
  {
    "db_id": "computer_student",
    "question": "Which courses have been taught by a professor having more than 5 years of experience?",
    "evidence": "",
    "SQL": "SELECT T1.course_id, T1.courseLevel, T2.p_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.yearsInProgram LIKE '%Year_%' AND T3.yearsInProgram LIKE '%Year_5' OR T3.yearsInProgram LIKE '%Year_6' OR T3.yearsInProgram LIKE '%Year_7' OR T3.yearsInProgram LIKE '%Year_8' OR T3.yearsInProgram LIKE '%Year_9' OR T3.yearsInProgram LIKE '%Year_10'"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by professors in the Year_2 phase?",
    "evidence": "",
    "SQL": "SELECT T1.course_id, T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.student = 0 AND T3.yearsInProgram = 'Year_2'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course taught by the professor with the ID 5?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id WHERE taughtBy.p_id = 5"
  },
  {
    "db_id": "computer_student",
    "question": "Who is teaching the 131 course?",
    "evidence": "",
    "SQL": "SELECT p_id FROM taughtBy WHERE course_id = 131"
  },
  {
    "db_id": "computer_student",
    "question": "Which course does professor with ID 82 teach?",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy WHERE p_id = 82"
  },
  {
    "db_id": "computer_student",
    "question": "Who taught course with courseLevel = 'Level_500'?",
    "evidence": "",
    "SQL": "SELECT p_id FROM taughtBy INNER JOIN course ON taughtBy.course_id = course.course_id WHERE course.courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of the course taught by a professor with more than 10 years of experience in the program?",
    "evidence": "",
    "SQL": "SELECT course.courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id INNER JOIN person ON taughtBy.p_id = person.p_id WHERE person.yearsInProgram > 10"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of the course that has been taught by the most professors?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id ORDER BY COUNT(T2.p_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses offered by the professors who have taught in the course with ID 159?",
    "evidence": "",
    "SQL": "SELECT DISTINCT T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = (SELECT p_id FROM person WHERE p_id = (SELECT p_id FROM taughtBy WHERE course_id = 159))"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course with id 82?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 82"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses that have no professor advising the students?",
    "evidence": "",
    "SQL": "SELECT C.course_id, C.courseLevel FROM course AS C LEFT JOIN advisedBy AS A ON C.course_id = A.p_id_dummy WHERE A.p_id_dummy IS NULL"
  },
  {
    "db_id": "computer_student",
    "question": "How many students are currently in Phase 1 and have 1 year in the program?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE inPhase = '0' AND yearsInProgram = '0'"
  },
  {
    "db_id": "computer_student",
    "question": "Mention the course level of the course taught by professor 235.",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id WHERE taughtBy.p_id = 235"
  },
  {
    "db_id": "computer_student",
    "question": "Which courses have more than one professor?",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy WHERE p_id IN (SELECT p_id FROM person WHERE professor = 1 GROUP BY p_id HAVING COUNT(p_id) > 1)"
  },
  {
    "db_id": "computer_student",
    "question": "What are the IDs of all students who are enrolled in a course with a course level of Level_500?",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE student = 1 AND (SELECT courseLevel FROM course WHERE course_id = (SELECT course_id FROM taughtBy WHERE p_id = person.p_id)) = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "Which professor has taught the most courses?",
    "evidence": "",
    "SQL": "SELECT p_id FROM taughtBy GROUP BY p_id ORDER BY COUNT(course_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the name of the course with course id 18 and what is its level?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 18"
  },
  {
    "db_id": "computer_student",
    "question": "Which professor has advised the most number of students?",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE professor = 1 GROUP BY p_id ORDER BY COUNT(p_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the average number of courses that students have been taught by?",
    "evidence": "",
    "SQL": "SELECT CAST(COUNT(T1.course_id) AS REAL) / COUNT(DISTINCT T2.p_id) AS num FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course ID of the course taught by the professor who has a position and is in Post-Generals?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T3.p_id = T2.p_id WHERE T3.hasPosition = 1 AND T3.inPhase = 'Post_Generals'"
  },
  {
    "db_id": "computer_student",
    "question": "What course is taught by professor with p_id 394?",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy WHERE p_id = 394"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of courses offered by the Level_300 course?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM course WHERE courseLevel = 'Level_300'"
  },
  {
    "db_id": "computer_student",
    "question": "What course level does course ID 159 have?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 159"
  },
  {
    "db_id": "computer_student",
    "question": "Which students are in phase 'Pre_Quals'?",
    "evidence": "",
    "SQL": "SELECT * FROM person WHERE inPhase = 'Pre_Quals'"
  },
  {
    "db_id": "computer_student",
    "question": "Which professors have a majority of students advised by them in their second year of program?",
    "evidence": "",
    "SQL": "SELECT T1.p_id, COUNT(T2.yearsInProgram) AS count FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.student = 1 GROUP BY T1.p_id HAVING COUNT(T2.yearsInProgram) > (SELECT COUNT(*) / 2 FROM advisedBy) AND T2.yearsInProgram = 'Year_2'"
  },
  {
    "db_id": "computer_student",
    "question": "List the IDs of students who are advised by a person with more than one advisee.",
    "evidence": "",
    "SQL": "SELECT T1.p_id FROM person AS T1 INNER JOIN advisedBy AS T2 ON T1.p_id = T2.p_id_dummy WHERE (SELECT COUNT(*) FROM advisedBy AS T3 WHERE T3.p_id_dummy = T1.p_id) > 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the list of course IDs taught by professors with position status in faculty, excluding the courses with level 400?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.hasPosition <> 0 AND T1.courseLevel <> 'Level_400'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total years in program of students who have a position of 'Level_500'?",
    "evidence": "",
    "SQL": "SELECT SUM(yearsInProgram) FROM person WHERE hasPosition = 'Level_500' AND student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "How many courses has professor with ID 309 taught?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM taughtBy WHERE p_id = 309"
  },
  {
    "db_id": "computer_student",
    "question": "What is the maximum number of years a student can have been in a program in the database?",
    "evidence": "",
    "SQL": "SELECT MAX(yearsInProgram) AS max_years FROM person WHERE student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "How many students are there in Level_400?",
    "evidence": "",
    "SQL": "SELECT COUNT(student) FROM person WHERE yearsInProgram = 'Year_3'"
  },
  {
    "db_id": "computer_student",
    "question": "What are the course IDs of the courses taught by professors who are also students in the program?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of courses taught by professors who have been in the program for more than three years?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T3.p_id = T2.p_id WHERE T3.yearsInProgram > 3"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of students who are advised to teach by a professor teaching Level_500 courses?",
    "evidence": "",
    "SQL": "SELECT COUNT(DISTINCT T4.p_id) FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id INNER JOIN advisedBy AS T4 ON T4.p_id = T1.p_id WHERE T3.courseLevel = 'Level_500' AND T1.professor = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are the names of professors who taught more than 10 courses?",
    "evidence": "",
    "SQL": "SELECT T1.p_id, T1.professor FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id GROUP BY T1.p_id HAVING COUNT(T2.course_id) > 10"
  },
  {
    "db_id": "computer_student",
    "question": "List the IDs of all the professors who teach a Level_400 course.",
    "evidence": "",
    "SQL": "SELECT T2.p_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T1.courseLevel = 'Level_400'"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by the professors who have been a student for more than 3 years in the program?",
    "evidence": "",
    "SQL": "SELECT C.course_id, C.courseLevel FROM course AS C INNER JOIN taughtBy AS T ON C.course_id = T.course_id INNER JOIN person AS P ON T.p_id = P.p_id WHERE P.yearsInProgram = 'Year_4'"
  },
  {
    "db_id": "computer_student",
    "question": "Who has taught the most courses?",
    "evidence": "",
    "SQL": "SELECT p_id FROM taughtBy GROUP BY p_id ORDER BY COUNT(course_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "Which professor is currently advising someone?",
    "evidence": "",
    "SQL": "SELECT T1.p_id FROM person AS T1 INNER JOIN advisedBy AS T2 ON T1.p_id = T2.p_id WHERE T1.hasPosition = 'Professor' AND T2.p_id_dummy IS NOT NULL"
  },
  {
    "db_id": "computer_student",
    "question": "What is the ID of the advisor of a student who is not in their 1st phase?",
    "evidence": "",
    "SQL": "SELECT T1.p_id_dummy FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.inPhase != '0'"
  },
  {
    "db_id": "computer_student",
    "question": "Which courses have at least one advisor who is also a professor?",
    "evidence": "",
    "SQL": "SELECT course_id FROM course NATURAL JOIN taughtBy NATURAL JOIN person WHERE courseLevel='Level_500' AND professor = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are taught by professors who have been faculty employees for more than 5 years?",
    "evidence": "",
    "SQL": "SELECT T3.course_id, T3.courseLevel FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T1.course_id WHERE T2.hasPosition = 'Faculty_eme' AND (SELECT COUNT(YearsInProgram) FROM person WHERE T2.p_id = p_id) > 5"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course ID of a professor who teaches at Level_400 and has no position in the faculty?",
    "evidence": "",
    "SQL": "SELECT course_id FROM course WHERE courseLevel = 'Level_400' AND course_id NOT IN (SELECT p_id FROM person WHERE hasPosition = '1')"
  },
  {
    "db_id": "computer_student",
    "question": "Which courses are taught by people who have taught 'Level_500' courses and are also students themselves?",
    "evidence": "",
    "SQL": "SELECT T1.course_id, T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T1.courseLevel = 'Level_500' AND T3.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are the undergraduate courses that are not taught by students?",
    "evidence": "",
    "SQL": "SELECT course_id FROM course WHERE NOT EXISTS (SELECT 1 FROM taughtBy WHERE taughtBy.course_id = course.course_id AND taughtBy.p_id IN (SELECT p_id FROM person WHERE student = 1))"
  },
  {
    "db_id": "computer_student",
    "question": "How many students are advised by professors who teach Level_400 or Level_500 courses?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person AS T1 INNER JOIN advisedBy AS T2 ON T1.p_id = T2.p_id_dummy INNER JOIN taughtBy AS T3 ON T3.p_id = T1.p_id INNER JOIN course AS T4 ON T3.course_id = T4.course_id WHERE T1.student = 1 AND T4.courseLevel IN ('Level_400', 'Level_500')"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by the professors with more than 5 years of experience?",
    "evidence": "",
    "SQL": "SELECT T1.course_id, T3.courseLevel FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T1.course_id WHERE T2.yearsInProgram > '5' AND T2.student = 0"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course ID of the 'Level_400' course?",
    "evidence": "",
    "SQL": "SELECT course_id FROM course WHERE courseLevel = 'Level_400'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the average course level of all courses taught by a professor who has at least 2 courses?",
    "evidence": "",
    "SQL": "SELECT AVG(T3.courseLevel) AS avgCourseLevel FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T1.course_id GROUP BY T2.p_id HAVING COUNT(T1.course_id) >= 2"
  },
  {
    "db_id": "computer_student",
    "question": "What are the names of the courses that are being taught by 'Faculty_aff' affiliated professors?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.hasPosition = 'Faculty_aff'"
  },
  {
    "db_id": "computer_student",
    "question": "Which students are advised by a teacher who has taught a course with ID 76?",
    "evidence": "",
    "SQL": "SELECT T2.p_id FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T1.p_id_dummy IN (SELECT p_id FROM taughtBy WHERE course_id = 76) AND T2.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of courses that are taught by advisors who have more than one student?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN advisedBy AS T3 ON T2.p_id = T3.p_id_dummy GROUP BY T1.course_id HAVING COUNT(T3.p_id_dummy) > 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the name of the course taught by the professor who advises person ID 124?",
    "evidence": "",
    "SQL": "SELECT C.courseLevel FROM course C JOIN taughtBy T ON C.course_id = T.course_id JOIN advisedBy A ON T.p_id = A.p_id_dummy WHERE A.p_id = 124"
  },
  {
    "db_id": "computer_student",
    "question": "What is the ID of the person who is both a professor and a student in the course with course ID 143?",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE professor = 1 AND student = 1 AND (SELECT course_id FROM taughtBy WHERE p_id = person.p_id) = 143"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of the course taught by the teacher who has been in the program for the most number of years?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id GROUP BY T3.yearsInProgram ORDER BY COUNT(T2.p_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "List the courses taught by the professor with ID 331.",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy WHERE p_id = 331"
  },
  {
    "db_id": "computer_student",
    "question": "List the course IDs for courses taught by instructors who have taught at least one pre-quals phase course.",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.inPhase = 'Pre_Quals' GROUP BY T1.course_id"
  },
  {
    "db_id": "computer_student",
    "question": "What is the average number of courses a professor from Level_500 is teaching?",
    "evidence": "",
    "SQL": "SELECT CAST(COUNT(T1.course_id) AS REAL) / COUNT(DISTINCT T2.p_id) FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T1.courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of the course that professor no.1 teaches?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id WHERE taughtBy.p_id = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by all professors who do not have a position?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id NOT IN (SELECT p_id FROM person WHERE hasPosition = '1')"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are taught by professors?",
    "evidence": "",
    "SQL": "SELECT course.course_id, course.courseLevel FROM course, taughtBy, person WHERE taughtBy.p_id = person.p_id AND person.professor = 1"
  },
  {
    "db_id": "computer_student",
    "question": "Which professors have taught at least one course of Level_400 and Level_500?",
    "evidence": "",
    "SQL": "SELECT T1.p_id FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id WHERE T1.p_id IN (SELECT p_id FROM person WHERE hasPosition = '1') AND T2.course_id IN (SELECT course_id FROM course WHERE courseLevel = 'Level_400' OR courseLevel = 'Level_500') GROUP BY T1.p_id"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are taught by the person with ID 380?",
    "evidence": "",
    "SQL": "SELECT T2.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 380"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of students who have been in the Pre_Quals phase for at least 3 years?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE inPhase = 'Pre_Quals' AND yearsInProgram = 'Year_3'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of the course with ID 54?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 54"
  },
  {
    "db_id": "computer_student",
    "question": "How many students are not advised by any person in their 5th year in the program?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE yearsInProgram = 'Year_6' AND student = 1 AND p_id NOT IN (SELECT p_id FROM advisedBy)"
  },
  {
    "db_id": "computer_student",
    "question": "Which courses are taught by a faculty member who has been in the program for more than 0 years?",
    "evidence": "",
    "SQL": "SELECT * FROM taughtBy AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T1.p_id = T3.p_id WHERE T3.yearsInProgram > 0 AND T3.professor = 1"
  },
  {
    "db_id": "computer_student",
    "question": "Which professor teaches the course Level_500?",
    "evidence": "",
    "SQL": "SELECT T1.p_id FROM taughtBy AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "Who are the advisors for students in the Pre_Quals phase?",
    "evidence": "",
    "SQL": "SELECT T1.p_id FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.inPhase = 'Pre_Quals'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of students who have a professor that teaches a high-level undergraduate course?",
    "evidence": "",
    "SQL": "SELECT COUNT(DISTINCT T1.p_id) FROM person AS T1 INNER JOIN advisedBy AS T2 ON T1.p_id = T2.p_id INNER JOIN taughtBy AS T3 ON T3.p_id = T2.p_id_dummy INNER JOIN course AS T4 ON T4.course_id = T3.course_id WHERE T4.courseLevel = 'Level_400'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the average years in program for students who are advised by multiple professors?",
    "evidence": "",
    "SQL": "SELECT AVG(T2.yearsInProgram) FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.student = 1 GROUP BY T2.p_id HAVING COUNT(T2.p_id) > 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the most common course level?",
    "evidence": "",
    "SQL": "SELECT courseLevel, COUNT(*) AS frequency FROM course GROUP BY courseLevel ORDER BY frequency DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "How many students who are advised by a professor teaching a course at Level_400 are not in Phase_Post_Quals?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person AS T1 INNER JOIN advisedBy AS T2 ON T1.p_id = T2.p_id INNER JOIN taughtBy AS T3 ON T2.p_id_dummy = T3.p_id INNER JOIN course AS T4 ON T3.course_id = T4.course_id WHERE T1.student = 1 AND T4.courseLevel = 'Level_400' AND T1.inPhase <> 'Post_Quals'"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are taught by students who are not faculty employees?",
    "evidence": "",
    "SQL": "SELECT T3.course_id, T3.courseLevel FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T1.course_id WHERE T2.hasPosition != 'Faculty_eme'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the student ID of a student who has been in the program for 4 years and is currently in the Post_Quals phase?",
    "evidence": "",
    "SQL": "SELECT student FROM person WHERE yearsInProgram = 'Year_4' AND inPhase = 'Post_Quals'"
  },
  {
    "db_id": "computer_student",
    "question": "What are all the students taught by professor ID 166?",
    "evidence": "",
    "SQL": "SELECT T1.p_id FROM person AS T1 JOIN taughtBy AS T2 ON T1.p_id = T2.p_id WHERE T2.course_id IN (SELECT course_id FROM taughtBy WHERE p_id = 166) AND T1.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "Which student has a professor that is teaching a Level_300 course?",
    "evidence": "",
    "SQL": "SELECT T1.student FROM person AS T1 INNER JOIN advisedBy AS T2 ON T1.p_id = T2.p_id_dummy INNER JOIN taughtBy AS T3 ON T3.p_id = T2.p_id_dummy INNER JOIN course AS T4 ON T3.course_id = T4.course_id WHERE T4.courseLevel = 'Level_300'"
  },
  {
    "db_id": "computer_student",
    "question": "How many students who have completed the course 'Level_500' have a professor?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person AS T1 INNER JOIN course AS T2 ON T1.student = 1 INNER JOIN taughtBy AS T3 ON T2.course_id = T3.course_id WHERE T2.courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of courses taught by professors who have been in the program for more than 0 years?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.yearsInProgram > 0"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by the faculty members having more than 5 years of experience in program?",
    "evidence": "",
    "SQL": "SELECT * FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.yearsInProgram > 'Year_5' AND T3.professor = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course taught by professor '1'?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id WHERE taughtBy.p_id = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of the course with the ID 164?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 164"
  },
  {
    "db_id": "computer_student",
    "question": "What course does the professor with ID 394 teach?",
    "evidence": "",
    "SQL": "SELECT course.course_id, course.courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id WHERE taughtBy.p_id = 394"
  },
  {
    "db_id": "computer_student",
    "question": "How many students who have a professor are in their third year of the program?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE student = 1 AND yearsInProgram = 'Year_3' AND professor > 0"
  },
  {
    "db_id": "computer_student",
    "question": "List all the people who are both students and professors in the system.",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE student = 1 AND professor = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the average years of students being taught by a professor?",
    "evidence": "",
    "SQL": "SELECT AVG(T2.yearsInProgram) FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the general course level of a course taught by a professor who has more than 1 year of experience in the program?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course JOIN taughtBy ON course.course_id = taughtBy.course_id JOIN person ON taughtBy.p_id = person.p_id WHERE person.yearsInProgram > 'Year_1'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course with the course ID 11?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 11"
  },
  {
    "db_id": "computer_student",
    "question": "What is the average number of students in a course for students who have completed at least 5 years in the program?",
    "evidence": "",
    "SQL": "SELECT AVG(student) FROM person WHERE yearsInProgram = 'Year_5'"
  },
  {
    "db_id": "computer_student",
    "question": "Which professors have taught courses at the level 'Level_400'?",
    "evidence": "",
    "SQL": "SELECT T1.p_id, T3.courseLevel FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id WHERE T3.courseLevel = 'Level_400'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the position of the person who has taught course 'Level_500'?",
    "evidence": "",
    "SQL": "SELECT hasPosition FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id WHERE T2.course_id = (SELECT course_id FROM course WHERE courseLevel = 'Level_500')"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of students advised by the professors who teach courses at Level_500?",
    "evidence": "",
    "SQL": "SELECT COUNT(DISTINCT T1.p_id) FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T1.course_id = T3.course_id WHERE T3.courseLevel = 'Level_500' AND T2.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of courses that professors have taught?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id IN (SELECT p_id FROM person WHERE professor = 1)"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course taught by the professor with the most taught courses?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id GROUP BY courseLevel ORDER BY COUNT(T2.course_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of the course taught by professor '324'?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 324"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by the person who teaches the most number of courses?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_id ORDER BY COUNT(T2.p_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What course does professor with id 75 teach?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.p_id = 75"
  },
  {
    "db_id": "computer_student",
    "question": "What is the position of the professor who taught the course with ID 16?",
    "evidence": "",
    "SQL": "SELECT T1.hasPosition FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id WHERE T2.course_id = 16"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are taught by professors who have been students themselves and what are their course levels?",
    "evidence": "",
    "SQL": "SELECT course.courseLevel, course.course_id FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id INNER JOIN person ON taughtBy.p_id = person.p_id WHERE person.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of students who have been advised by a professor in their second year of the program?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE yearsInProgram = 'Year_2' AND inPhase = 'Post_Quals' AND p_id IN (SELECT p_id FROM advisedBy WHERE p_id IN (SELECT p_id FROM person WHERE inPhase = 'Post_Quals'))"
  },
  {
    "db_id": "computer_student",
    "question": "What is the average number of years in program for students who are in a course with level 'Level_500'?",
    "evidence": "",
    "SQL": "SELECT AVG(yearsInProgram) FROM person AS T1 INNER JOIN course AS T2 ON T1.student = 1 INNER JOIN taughtBy AS T3 ON T2.course_id = T3.course_id WHERE T2.courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "Which courses are taught by professors who have more than 5 years of program experience?",
    "evidence": "",
    "SQL": "SELECT T3.course_id FROM course AS T3 INNER JOIN taughtBy AS T2 ON T3.course_id = T2.course_id INNER JOIN person AS T1 ON T2.p_id = T1.p_id WHERE T1.yearsInProgram >= 'Year_5'"
  },
  {
    "db_id": "computer_student",
    "question": "Which professor taught Level_300 courses?",
    "evidence": "",
    "SQL": "SELECT T1.p_id FROM taughtBy AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.courseLevel = 'Level_300'"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by professors in Level_500?",
    "evidence": "",
    "SQL": "SELECT course.course_id, course.courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id INNER JOIN person ON taughtBy.p_id = person.p_id WHERE person.professor = 1 AND course.courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "Who teaches the course with id 115?",
    "evidence": "",
    "SQL": "SELECT p_id FROM taughtBy WHERE course_id = 115"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of students who are in the phase and have more than 1 year in the program?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE inPhase = '1' AND yearsInProgram > '0'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of the course taught by person 415?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id IN (SELECT course_id FROM taughtBy WHERE p_id = 415)"
  },
  {
    "db_id": "computer_student",
    "question": "What is the highest level course that a student with the most number of advisors is taking?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN advisedBy AS T3 ON T2.p_id = T3.p_id GROUP BY T1.course_id ORDER BY COUNT(*) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the name of the person who teaches the course with course ID 173?",
    "evidence": "",
    "SQL": "SELECT P.p_id, P.professor FROM course C INNER JOIN taughtBy T ON C.course_id = T.course_id INNER JOIN person P ON T.p_id = P.p_id WHERE C.course_id = 173"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of courses taught by a professor who taught at least one course?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM taughtBy GROUP BY p_id HAVING COUNT(course_id) > 0"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of course ID 131?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 131"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of students advised by the professor with most number of advisors?",
    "evidence": "",
    "SQL": "SELECT COUNT(T2.p_id) FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id GROUP BY T2.p_id ORDER BY COUNT(T2.p_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of courses taught by all professors in Level 500?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM taughtBy T1 INNER JOIN course T2 ON T1.course_id = T2.course_id WHERE T2.courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "What are the course levels for the courses taught by professors with at least 3 years in program?",
    "evidence": "",
    "SQL": "SELECT T3.courseLevel FROM course AS T3 INNER JOIN taughtBy AS T2 ON T3.course_id = T2.course_id INNER JOIN person AS T1 ON T2.p_id = T1.p_id WHERE T1.yearsInProgram >= 'Year_3'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of person ID 340?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id IN (SELECT course_id FROM taughtBy WHERE p_id = 340)"
  },
  {
    "db_id": "computer_student",
    "question": "What course ID is taught by both Professor ID 240 and Professor ID 120?",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy WHERE p_id IN (240, 120) GROUP BY course_id HAVING COUNT(DISTINCT p_id) = 2"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course with course ID 57?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 57"
  },
  {
    "db_id": "computer_student",
    "question": "Which students are being taught by professors who have advised more than 3 students?",
    "evidence": "",
    "SQL": "SELECT person.student FROM person INNER JOIN taughtBy ON person.p_id = taughtBy.p_id INNER JOIN advisedBy ON taughtBy.p_id = advisedBy.p_id_dummy GROUP BY person.student HAVING COUNT(advisedBy.p_id_dummy) > 3"
  },
  {
    "db_id": "computer_student",
    "question": "What courses does the professor with ID 46 teach?",
    "evidence": "",
    "SQL": "SELECT T1.course_id, T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 46"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course taught by the professor with most number of taught courses?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course, taughtBy, person WHERE course.course_id = taughtBy.course_id AND taughtBy.p_id = person.p_id GROUP BY courseLevel ORDER BY COUNT(courseLevel) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "How many students in Year 1 have been taught by a professor who has also taught in Level_400?",
    "evidence": "",
    "SQL": "SELECT COUNT(T1.p_id) FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T1.course_id = T3.course_id WHERE T2.student = 1 AND T2.yearsInProgram = 'Year_1' AND T3.courseLevel = 'Level_400'"
  },
  {
    "db_id": "computer_student",
    "question": "How many students who have been in the program for at least 2 years are teaching a course?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id WHERE T1.student = 1 AND T1.yearsInProgram >= 2"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course taught by a person with ID 234?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course JOIN taughtBy ON course.course_id = taughtBy.course_id WHERE taughtBy.p_id = 234"
  },
  {
    "db_id": "computer_student",
    "question": "Which students are advised by professors who have taught Level_500 courses?",
    "evidence": "",
    "SQL": "SELECT DISTINCT T1.p_id FROM person AS T1 INNER JOIN advisedBy AS T2 ON T1.p_id = T2.p_id_dummy INNER JOIN taughtBy AS T3 ON T2.p_id = T3.p_id INNER JOIN course AS T4 ON T3.course_id = T4.course_id WHERE T4.courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "What are the IDs of the courses that have been taught by both Prof. 235 and Prof. 113?",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy WHERE p_id = 235 INTERSECT SELECT course_id FROM taughtBy WHERE p_id = 113"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by professor with ID 364?",
    "evidence": "",
    "SQL": "SELECT C.course_id FROM course C, taughtBy T WHERE C.course_id = T.course_id AND T.p_id = 364"
  },
  {
    "db_id": "computer_student",
    "question": "What percentage of students are in their first year?",
    "evidence": "",
    "SQL": "SELECT CAST(SUM(CASE WHEN yearsInProgram = 'Year_1' THEN 1 ELSE 0 END) AS REAL) * 100 / SUM(CASE WHEN yearsInProgram IS NOT NULL THEN 1 ELSE 0 END) AS percentage FROM person"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of the course taught by a professor who has taught at least one student?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id WHERE p_id IN (SELECT p_id FROM person WHERE student = 1)"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses and levels taught by professors who have at least 3 years of experience in the program?",
    "evidence": "",
    "SQL": "SELECT T3.course_id, T3.courseLevel FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T1.course_id WHERE T2.yearsInProgram >= 'Year_3' GROUP BY T3.course_id, T3.courseLevel"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course taught by professor with ID 211?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id WHERE taughtBy.p_id = 211"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course taught by professor 179?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 179"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of the course taught by professor with ID 235?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course NATURAL JOIN taughtBy WHERE course_id = (SELECT course_id FROM taughtBy WHERE p_id = 235)"
  },
  {
    "db_id": "computer_student",
    "question": "What is the average number of years in the program for students who have a position in the program?",
    "evidence": "",
    "SQL": "SELECT AVG(T1.yearsInProgram) AS AverageYears FROM person AS T1 WHERE T1.hasPosition = '1' GROUP BY T1.hasPosition"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of students who were advised by the professor with most number of advisees?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM advisedBy AS T1 GROUP BY T1.p_id ORDER BY COUNT(*) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What courses does a person who is not a professor teach?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id NOT IN (SELECT p_id FROM person WHERE professor = 1)"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of students who have been in Phase 0?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE inPhase = '0'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of students who have not started their undergraduate program yet?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE student = 0 AND inPhase = 0"
  },
  {
    "db_id": "computer_student",
    "question": "What is the general course level for the course with ID 122?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 122"
  },
  {
    "db_id": "computer_student",
    "question": "Who teaches course with ID 139?",
    "evidence": "",
    "SQL": "SELECT p_id FROM taughtBy WHERE course_id = 139"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of courses taught by a professor with a position other than faculty?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.hasPosition != 'Faculty_aff'"
  },
  {
    "db_id": "computer_student",
    "question": "Which students are currently in Year_4 of the program and are not advised by a professor who teaches more than 3 courses?",
    "evidence": "",
    "SQL": "SELECT P.p_id FROM person AS P WHERE P.yearsInProgram = 'Year_4' AND NOT EXISTS (SELECT 1 FROM taughtBy AS T INNER JOIN person AS PT ON T.p_id = PT.p_id WHERE PT.professor = 1 GROUP BY T.p_id HAVING COUNT(DISTINCT T.course_id) > 3) AND P.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course taught by professor with ID 324?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 324"
  },
  {
    "db_id": "computer_student",
    "question": "What are the IDs of students who have been advised by a professor?",
    "evidence": "",
    "SQL": "SELECT p_id FROM advisedBy WHERE p_id != p_id_dummy"
  },
  {
    "db_id": "computer_student",
    "question": "What are the IDs of the courses taught by professors with 5 or more years of teaching experience?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.yearsInProgram >= 5 GROUP BY T1.course_id"
  },
  {
    "db_id": "computer_student",
    "question": "Which students have no advisors?",
    "evidence": "",
    "SQL": "SELECT T1.p_id FROM person AS T1 WHERE T1.p_id NOT IN (SELECT T2.p_id FROM advisedBy AS T2)"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by the professor '248'?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.p_id = 248"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of course with id 63?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 63"
  },
  {
    "db_id": "computer_student",
    "question": "What is the ID of the student who has been in the program for more than 4 years?",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE yearsInProgram = 'Year_5' AND student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "How many students have a professor who teaches a Level_400 course?",
    "evidence": "",
    "SQL": "SELECT COUNT(DISTINCT T2.p_id) AS num_students FROM person AS T1 INNER JOIN advisedBy AS T3 ON T1.p_id = T3.p_id INNER JOIN taughtBy AS T2 ON T3.p_id = T2.p_id WHERE T2.course_id IN (SELECT course_id FROM course WHERE courseLevel = 'Level_400')"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of the course taught by professor 324?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course JOIN taughtBy ON course.course_id = taughtBy.course_id WHERE p_id = 324"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course that has the ID 3?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 3"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course with the ID 71?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 71"
  },
  {
    "db_id": "computer_student",
    "question": "How many courses are taught by a professor who is also a student?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "Who are the students who are in Year 5 of the program and have positions in a department?",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE yearsInProgram = 'Year_5' AND hasPosition != 0"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by the advisors who gave advice to student with ID 248?",
    "evidence": "",
    "SQL": "SELECT T3.course_id FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN taughtBy AS T3 ON T2.p_id = T3.p_id WHERE T1.p_id = 248"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of students enrolled in courses that have both a 'Level_400' and a 'Level_500' course level?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id WHERE T3.courseLevel = 'Level_400' AND T3.courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "What course ID has the highest course level in the database?",
    "evidence": "",
    "SQL": "SELECT course_id, courseLevel FROM course ORDER BY courseLevel DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of faculty members who teach Level_500 courses?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id WHERE T1.hasPosition = 'Faculty_aff' AND T3.courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "How many courses are taught by professors with more than 0 years in program?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.professor = 1 AND T2.yearsInProgram > 0"
  },
  {
    "db_id": "computer_student",
    "question": "Which course is taught by a professor who has taught before?",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.p_id IN (SELECT p_id FROM person WHERE yearsInProgram <> '0') AND T2.professor = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of course taught by professor id 394?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id WHERE taughtBy.p_id = 394"
  },
  {
    "db_id": "computer_student",
    "question": "What course level is associated with the professor with the ID 240?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id INNER JOIN person ON person.p_id = taughtBy.p_id WHERE person.p_id = 240"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the courses taught by the professor who has been in the program for 0 years?",
    "evidence": "",
    "SQL": "SELECT T2.courseLevel FROM course AS T2 INNER JOIN taughtBy AS T3 ON T2.course_id = T3.course_id INNER JOIN person AS T1 ON T3.p_id = T1.p_id WHERE T1.yearsInProgram = '0'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the ID of the student taught by a professor who taught a course with 'Level_500'?",
    "evidence": "",
    "SQL": "SELECT person.p_id FROM taughtBy JOIN course ON taughtBy.course_id = course.course_id JOIN person ON taughtBy.p_id = person.p_id WHERE course.courseLevel = 'Level_500' AND person.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the name of the person who has been a professor for the most years?",
    "evidence": "",
    "SQL": "SELECT yearsInProgram FROM person GROUP BY p_id ORDER BY yearsInProgram DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "Who teaches the courses at level 400?",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy, person WHERE course_id IN (SELECT course_id FROM course WHERE courseLevel = 'Level_400') AND person.p_id = taughtBy.p_id"
  },
  {
    "db_id": "computer_student",
    "question": "Which student has been in a program for the most amount of years?",
    "evidence": "",
    "SQL": "SELECT * FROM person WHERE student = 1 ORDER BY yearsInProgram DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course ID and course level of a course taught by a student?",
    "evidence": "",
    "SQL": "SELECT T3.course_id, T3.courseLevel FROM course AS T3 INNER JOIN taughtBy AS T2 ON T3.course_id = T2.course_id INNER JOIN person AS T1 ON T2.p_id = T1.p_id WHERE T1.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of course with ID 103?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 103"
  },
  {
    "db_id": "computer_student",
    "question": "What percentage of courses are taught by professors with more than 5 years of experience?",
    "evidence": "",
    "SQL": "SELECT CAST(COUNT(*) AS REAL) * 100 / (SELECT COUNT(*) FROM person WHERE yearsInProgram > 'Year_5') AS per FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id"
  },
  {
    "db_id": "computer_student",
    "question": "List all the courses taught by a professor who teaches only undergraduate courses.",
    "evidence": "",
    "SQL": "SELECT T3.course_id, T3.courseLevel FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id WHERE T1.hasPosition <> 0 AND T3.courseLevel = 'Level_300'"
  },
  {
    "db_id": "computer_student",
    "question": "What are the levels of all courses that are taught by professors having '0' yearsInProgram?",
    "evidence": "",
    "SQL": "SELECT T3.courseLevel FROM course AS T3 INNER JOIN taughtBy AS T2 ON T3.course_id = T2.course_id INNER JOIN person AS T1 ON T2.p_id = T1.p_id WHERE T1.yearsInProgram = 0"
  },
  {
    "db_id": "computer_student",
    "question": "What is the list of course levels that are being taught by at least one professor?",
    "evidence": "",
    "SQL": "SELECT DISTINCT courseLevel FROM course WHERE course_id IN (SELECT course_id FROM taughtBy GROUP BY course_id HAVING COUNT(DISTINCT p_id) > 0)"
  },
  {
    "db_id": "computer_student",
    "question": "What is the courseLevel of the course that is taught by professor with ID 351?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id WHERE p_id = 351"
  },
  {
    "db_id": "computer_student",
    "question": "What is the most common course level among all courses taught by Professor x, x not being a student?",
    "evidence": "",
    "SQL": "SELECT courseLevel, COUNT(*) FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id GROUP BY courseLevel HAVING COUNT(T3.p_id) = (SELECT COUNT(*) FROM person WHERE student = 0)"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by the professor '416'?",
    "evidence": "",
    "SQL": "SELECT course.course_id, course.courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id WHERE taughtBy.p_id = '416'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the highest level of course taught by a faculty member in the 'Post_Generals' phase?",
    "evidence": "",
    "SQL": "SELECT MAX(T1.courseLevel) FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.hasPosition = 1 AND T3.inPhase = 'Post_Generals'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course with course ID 11?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 11"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses with a single professor and are taught by that professor?",
    "evidence": "",
    "SQL": "SELECT T1.course_id, T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE (SELECT COUNT(T3.course_id) FROM taughtBy AS T3 WHERE T1.course_id = T3.course_id AND T3.p_id = T2.p_id) = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are the course IDs that are taught by professors who have taught more than 5 courses?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_id HAVING COUNT(T2.p_id) > 5"
  },
  {
    "db_id": "computer_student",
    "question": "Which students are in post-quals phase?",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE yearsInProgram = 'Year_5' AND inPhase = 'Post_Quals'"
  },
  {
    "db_id": "computer_student",
    "question": "What are the years in program and in phase status for the student advised by the professor with most number of students?",
    "evidence": "",
    "SQL": "SELECT T2.yearsInProgram, T2.inPhase FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id GROUP BY T1.p_id ORDER BY COUNT(*) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "List all the students who are taught by the professors who taught a course with course ID greater than 130.",
    "evidence": "",
    "SQL": "SELECT P.student FROM person P JOIN taughtBy T ON P.p_id = T.p_id WHERE T.course_id > 130"
  },
  {
    "db_id": "computer_student",
    "question": "What are the IDs of courses taught by professors in the 0th year of their program?",
    "evidence": "",
    "SQL": "SELECT T3.course_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T1.course_id WHERE T2.yearsInProgram = '0'"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are taught by faculty members who have taught more than two courses?",
    "evidence": "",
    "SQL": "SELECT C.course_id, C.courseLevel FROM course C INNER JOIN taughtBy T ON C.course_id = T.course_id GROUP BY C.course_id, C.courseLevel HAVING COUNT(DISTINCT T.p_id) > 2"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of the course with course ID 74?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 74"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are taught by more than one teacher?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_id HAVING COUNT(T2.p_id) > 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the courses taught by professors who have advised more than 1 student?",
    "evidence": "",
    "SQL": "SELECT course.courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id INNER JOIN person ON taughtBy.p_id = person.p_id GROUP BY course.course_id, course.courseLevel HAVING COUNT(person.p_id) > 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of course ID 38?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 38"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of students under the advisor of professor with ID 181?",
    "evidence": "",
    "SQL": "SELECT COUNT(p_id) FROM advisedBy WHERE p_id_dummy IN (SELECT p_id FROM person WHERE professor = 1 AND p_id = 181)"
  },
  {
    "db_id": "computer_student",
    "question": "Which course level does course with id 20 belong to?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 20"
  },
  {
    "db_id": "computer_student",
    "question": "Which professors have taught more than one course?",
    "evidence": "",
    "SQL": "SELECT T1.p_id FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id GROUP BY T1.p_id HAVING COUNT(T2.course_id) > 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses that a student who is also a professor is teaching?",
    "evidence": "",
    "SQL": "SELECT DISTINCT C.course_id FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS C ON T2.course_id = C.course_id WHERE T1.student = 1 AND T1.professor = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the ID of a faculty employee professor who has advised more than one student?",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE hasPosition = 'Faculty_eme' AND p_id IN (SELECT p_id FROM advisedBy GROUP BY p_id HAVING COUNT(p_id_dummy) > 1)"
  },
  {
    "db_id": "computer_student",
    "question": "What is the name of the course with course ID `23`?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = '23'"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by a student?",
    "evidence": "",
    "SQL": "SELECT DISTINCT T2.course_id FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id WHERE T1.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are taught by professors who have taught more than two courses?",
    "evidence": "",
    "SQL": "SELECT T1.course_id, T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN (SELECT p_id, COUNT(*) as count FROM taughtBy GROUP BY p_id HAVING COUNT(*) > 2) AS T3 ON T2.p_id = T3.p_id GROUP BY T1.course_id, T1.courseLevel"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of course with id 46?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 46"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of the course with the most teachers?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_id ORDER BY COUNT(T2.p_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are the IDs of professors who advise students in year_4 phase and have not been assigned any courses?",
    "evidence": "",
    "SQL": "SELECT T1.p_id FROM person AS T1 INNER JOIN advisedBy AS T2 ON T1.p_id = T2.p_id WHERE T1.inPhase = 'Year_4' AND T1.student = 1 AND NOT EXISTS (SELECT * FROM taughtBy AS T3 WHERE T1.p_id = T3.p_id)"
  },
  {
    "db_id": "computer_student",
    "question": "What courses did the professor with the most courses taught teach?",
    "evidence": "",
    "SQL": "SELECT T1.course_id, T2.courseLevel FROM taughtBy AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_id, T2.courseLevel ORDER BY COUNT(T1.p_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course with the highest course level?",
    "evidence": "",
    "SQL": "SELECT course_id, courseLevel FROM course ORDER BY courseLevel DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the average years of experience of students who are in phase 0 of their program?",
    "evidence": "",
    "SQL": "SELECT AVG(yearsInProgram) FROM person WHERE inPhase = '0' AND student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are taught by professors who also have a position?",
    "evidence": "",
    "SQL": "SELECT DISTINCT T1.course_id, T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.hasPosition = '1'"
  },
  {
    "db_id": "computer_student",
    "question": "How many courses have been taught by at least one professor with a position of 'Faculty'?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.hasPosition = 'Faculty'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course taught by a professor with ID 298?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id WHERE taughtBy.p_id = 298"
  },
  {
    "db_id": "computer_student",
    "question": "Which faculty members are currently teaching more than one course?",
    "evidence": "",
    "SQL": "SELECT T2.p_id FROM (SELECT course_id, COUNT(*) AS count FROM taughtBy GROUP BY course_id) AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id GROUP BY T2.p_id HAVING COUNT(T2.course_id) > 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of students in a year five program?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE yearsInProgram = 'Year_5' AND student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course that has the most professors teaching it?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id ORDER BY COUNT(T2.p_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of students who have advisor?",
    "evidence": "",
    "SQL": "SELECT COUNT(student) FROM person WHERE student = 1 AND hasPosition = '0'"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by the advisors who gave advice to student with ID 1?",
    "evidence": "",
    "SQL": "SELECT T3.course_id FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN taughtBy AS T3 ON T2.p_id = T3.p_id WHERE T1.p_id_dummy = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course with ID 19?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 19"
  },
  {
    "db_id": "computer_student",
    "question": "What is the highest level course taught by Professor with ID 279?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id WHERE taughtBy.p_id = 279 AND course.courseLevel = (SELECT MAX(courseLevel) FROM course)"
  },
  {
    "db_id": "computer_student",
    "question": "What are the IDs of students who are advised by a professor who teaches a course that is not 'Level_300'?",
    "evidence": "",
    "SQL": "SELECT T1.p_id FROM person AS T1 INNER JOIN advisedBy AS T2 ON T1.p_id = T2.p_id INNER JOIN taughtBy AS T3 ON T2.p_id = T3.p_id WHERE T3.course_id NOT IN (SELECT course_id FROM course WHERE courseLevel = 'Level_300')"
  },
  {
    "db_id": "computer_student",
    "question": "What is the list of courses taught by a professor who has advised at least one student?",
    "evidence": "",
    "SQL": "SELECT course.course_id, course.courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id INNER JOIN person ON taughtBy.p_id = person.p_id WHERE person.professor = 1 AND (SELECT COUNT(*) FROM advisedBy WHERE advisedBy.p_id = person.p_id) > 0"
  },
  {
    "db_id": "computer_student",
    "question": "What is the most recent phase that a professor in year 6 has reached?",
    "evidence": "",
    "SQL": "SELECT DISTINCT inPhase FROM person WHERE yearsInProgram = 'Year_6' ORDER BY LENGTH(inPhase) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course taught by the professor who advised student no.13?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id INNER JOIN advisedBy ON taughtBy.p_id = advisedBy.p_id WHERE advisedBy.p_id_dummy = 13"
  },
  {
    "db_id": "computer_student",
    "question": "How many courses are taught by professors in the Faculty of Mathematics?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T1.course_id WHERE T2.hasPosition = 'Faculty_aff' AND T3.courseLevel = 'Level_400'"
  },
  {
    "db_id": "computer_student",
    "question": "List all the courses taught by professors from the faculty of advisors who have at least one student in the 5th year of their program.",
    "evidence": "",
    "SQL": "SELECT course.course_id FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id INNER JOIN person AS P ON taughtBy.p_id = P.p_id INNER JOIN advisedBy AS T1 ON P.p_id = T1.p_id_dummy WHERE P.inPhase = 'Year_5' GROUP BY course.course_id"
  },
  {
    "db_id": "computer_student",
    "question": "How many students are there in the Pre_Quals phase?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) AS count FROM person WHERE inPhase = 'Pre_Quals'"
  },
  {
    "db_id": "computer_student",
    "question": "Which students are enrolled in courses taught by professors with more than 3 years in the program?",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE student = 1 AND p_id IN (SELECT p_id FROM person WHERE hasPosition = '0' AND yearsInProgram != 'Year_1' GROUP BY p_id HAVING COUNT(p_id) > 3)"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of all courses taught by the faculty member with ID 342?",
    "evidence": "",
    "SQL": "SELECT T3.courseLevel FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id WHERE T1.p_id = 342"
  },
  {
    "db_id": "computer_student",
    "question": "Which faculty professor taught course ID 173 and the course level?",
    "evidence": "",
    "SQL": "SELECT T1.p_id, T3.courseLevel FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id WHERE T3.course_id = 173 AND T1.hasPosition <> 0"
  },
  {
    "db_id": "computer_student",
    "question": "What are the course IDs of the courses taught by a professor with more than 0 years in the program?",
    "evidence": "",
    "SQL": "SELECT DISTINCT T2.course_id FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id WHERE T1.yearsInProgram > 0"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are being taught by a professor who has more than 5 years in the program?",
    "evidence": "",
    "SQL": "SELECT * FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.yearsInProgram = 'Year_5' OR T2.yearsInProgram = 'Year_6' OR T2.yearsInProgram = 'Year_7' OR T2.yearsInProgram = 'Year_8' OR T2.yearsInProgram = 'Year_9' OR T2.yearsInProgram = 'Year_10'"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are taught by professors with more than 2 years in the program?",
    "evidence": "",
    "SQL": "SELECT DISTINCT T1.course_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.yearsInProgram > 2"
  },
  {
    "db_id": "computer_student",
    "question": "What are the names of students who are not yet graduated from Level_300 and currently taking a Level_400 course?",
    "evidence": "",
    "SQL": "SELECT DISTINCT P1.p_id FROM person AS P1 INNER JOIN course AS C2 ON P1.student = 1 INNER JOIN taughtBy AS T2 ON T2.course_id = C2.course_id WHERE C2.courseLevel = 'Level_400' AND P1.yearsInProgram = 0"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level for the course taught by advisor with ID 15?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course JOIN taughtBy ON course.course_id = taughtBy.course_id JOIN advisedBy ON taughtBy.p_id = advisedBy.p_id WHERE advisedBy.p_id_dummy = 15"
  },
  {
    "db_id": "computer_student",
    "question": "What is the name of the course taught by the professor who has been in the program for the least number of years?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.yearsInProgram = (SELECT MIN(yearsInProgram) FROM person)"
  },
  {
    "db_id": "computer_student",
    "question": "How many professors who have a position and not a student, teach a course with Level_300?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id WHERE T1.professor = 1 AND T1.hasPosition <> 0 AND T3.courseLevel = 'Level_300'"
  },
  {
    "db_id": "computer_student",
    "question": "What course level does the course with ID 11 belong to?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 11"
  },
  {
    "db_id": "computer_student",
    "question": "Which faculty member has taught the most courses?",
    "evidence": "",
    "SQL": "SELECT T1.p_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id GROUP BY T1.p_id ORDER BY COUNT(T2.p_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of the course taught by the professor with ID 64?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course JOIN taughtBy ON course.course_id = taughtBy.course_id WHERE taughtBy.p_id = 64"
  },
  {
    "db_id": "computer_student",
    "question": "What are the IDs of students who take only the Level_200 courses?",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE student = 1 AND NOT EXISTS (SELECT 1 FROM taughtBy WHERE taughtBy.p_id = person.p_id AND course_id IN (SELECT course_id FROM course WHERE courseLevel != 'Level_200'))"
  },
  {
    "db_id": "computer_student",
    "question": "What are the IDs of the courses taught by professors who have less than 2 years experience in the program?",
    "evidence": "",
    "SQL": "SELECT T2.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.yearsInProgram = 'Year_2'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of students in Phase Post_Generals and program Year_4?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE yearsInProgram = 'Year_4' AND inPhase = 'Post_Generals'"
  },
  {
    "db_id": "computer_student",
    "question": "Which course is taught by the professor with ID `165`?",
    "evidence": "",
    "SQL": "SELECT * FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id WHERE taughtBy.p_id = 165"
  },
  {
    "db_id": "computer_student",
    "question": "How many students are in Year_9?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE inPhase = 'Post_Generals' AND yearsInProgram = 'Year_9'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of the course with the most professors?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id GROUP BY T1.courseLevel ORDER BY COUNT(T1.course_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by a professor with more than 4 years in the program?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T3.p_id = T2.p_id WHERE T3.yearsInProgram = 'Year_5+'"
  },
  {
    "db_id": "computer_student",
    "question": "What courses does professor 378 teach?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 378"
  },
  {
    "db_id": "computer_student",
    "question": "What are the IDs of the professors who teach courses of Level 300?",
    "evidence": "",
    "SQL": "SELECT p_id FROM taughtBy WHERE EXISTS (SELECT 1 FROM course WHERE course.courseLevel = 'Level_300' AND taughtBy.course_id = course.course_id)"
  },
  {
    "db_id": "computer_student",
    "question": "List the names of all students who were advised by their professors in their Post_Generals phase.",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE student = 1 AND hasPosition = 0 AND inPhase = 'Post_Generals' ORDER BY p_id"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of the course with course ID 46?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 46"
  },
  {
    "db_id": "computer_student",
    "question": "What are the IDs of the students who have more than one advisor?",
    "evidence": "",
    "SQL": "SELECT DISTINCT p_id FROM advisedBy GROUP BY p_id HAVING COUNT(p_id) > 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of students who are not advised by a teacher?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE p_id NOT IN (SELECT p_id_dummy FROM advisedBy)"
  },
  {
    "db_id": "computer_student",
    "question": "What is the average number of years in program of students advised by a professor who teaches course 82?",
    "evidence": "",
    "SQL": "SELECT AVG(T1.yearsInProgram) FROM person AS T1 INNER JOIN advisedBy AS T2 ON T1.p_id = T2.p_id INNER JOIN taughtBy AS T3 ON T2.p_id = T3.p_id WHERE T3.course_id = 82 AND T1.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "How many students have been in Phase_2",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE inPhase = 'Phase_2' AND student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course taught by professor who is also a student?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of course ID 136?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 136"
  },
  {
    "db_id": "computer_student",
    "question": "What courses is Professor no.351 teaching?",
    "evidence": "",
    "SQL": "SELECT T2.course_id FROM taughtBy AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T1.p_id = 351"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of courses taught by professors who have advised at least one student?",
    "evidence": "",
    "SQL": "SELECT COUNT(DISTINCT T1.p_id) FROM taughtBy AS T1 INNER JOIN advisedBy AS T2 ON T1.p_id = T2.p_id"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course taught by a professor with 8 years in the program?",
    "evidence": "",
    "SQL": "SELECT course.courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id INNER JOIN person ON taughtBy.p_id = person.p_id WHERE person.yearsInProgram = 'Year_8'"
  },
  {
    "db_id": "computer_student",
    "question": "Which students are advised by a professor who has taught at least one 'Level_500' course?",
    "evidence": "",
    "SQL": "SELECT T1.p_id FROM person AS T1 INNER JOIN advisedBy AS T2 ON T1.p_id = T2.p_id INNER JOIN taughtBy AS T3 ON T2.p_id = T3.p_id INNER JOIN course AS T4 ON T3.course_id = T4.course_id WHERE T4.courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course with course ID 166?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 166"
  },
  {
    "db_id": "computer_student",
    "question": "Which course is not taught by a professor?",
    "evidence": "",
    "SQL": "SELECT * FROM course WHERE course_id NOT IN (SELECT course_id FROM taughtBy)"
  },
  {
    "db_id": "computer_student",
    "question": "How many students have a professor with position 0?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE professor = 0"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by the person with professor ID 404?",
    "evidence": "",
    "SQL": "SELECT T1.course_id, T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 404"
  },
  {
    "db_id": "computer_student",
    "question": "How many courses are taught by a faculty member who is also a professor?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.professor = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are all the courses taught by professors who are advisors to students in the 2nd year?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.yearsInProgram = 'Year_2' AND T3.student = 0"
  },
  {
    "db_id": "computer_student",
    "question": "Which professors teach more than one course?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM taughtBy GROUP BY p_id HAVING COUNT(course_id) > 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of students who have been advised by a professor who has taught a basic or medium undergraduate course?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person AS T1 INNER JOIN advisedBy AS T2 ON T1.p_id = T2.p_id INNER JOIN taughtBy AS T3 ON T2.p_id = T3.p_id INNER JOIN course AS T4 ON T3.course_id = T4.course_id WHERE T4.courseLevel = 'Level_300' AND T1.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "How many students are enrolled in a course taught by professor with p_id 415?",
    "evidence": "",
    "SQL": "SELECT COUNT(student) FROM person WHERE student = 1 AND inPhase = '0' AND p_id = 415"
  },
  {
    "db_id": "computer_student",
    "question": "What are the course levels for students who are also professors?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel FROM course AS T1 INNER JOIN person AS T2 ON T1.course_id = T2.p_id WHERE T2.student = 1 AND T2.professor = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of students in all years of the program who have been advised by at least one professor?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person AS P1 INNER JOIN advisedBy AS P2 ON P1.p_id = P2.p_id WHERE P2.p_id_dummy IS NOT NULL"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of years that all students have been in the program?",
    "evidence": "",
    "SQL": "SELECT SUM(yearsInProgram) FROM person WHERE student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by professors in Level_500?",
    "evidence": "",
    "SQL": "SELECT T2.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T1.courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course with course ID 44?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 44"
  },
  {
    "db_id": "computer_student",
    "question": "Which students are advised by professors who teach at Level_400 courses?",
    "evidence": "",
    "SQL": "SELECT T1.p_id_dummy FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN taughtBy AS T3 ON T2.p_id = T3.p_id WHERE T3.course_id = (SELECT course_id FROM course WHERE courseLevel = 'Level_400')"
  },
  {
    "db_id": "computer_student",
    "question": "Who are the students who were advised by Professor 253?",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE p_id IN (SELECT p_id_dummy FROM advisedBy WHERE p_id = 253) AND student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of the courses taught by the professor who has the ID `319`?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id WHERE p_id = 319"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of courses taught by a professor who is also a student in the program?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "Which students are not advised by a professor?",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE p_id NOT IN (SELECT p_id FROM advisedBy)"
  },
  {
    "db_id": "computer_student",
    "question": "Who advises most students in Pre_Quals?",
    "evidence": "",
    "SQL": "SELECT T2.hasPosition FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.inPhase = 'Pre_Quals' GROUP BY T2.hasPosition ORDER BY COUNT(T1.p_id_dummy) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of students in the program, considering the students who are also professors?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE student = 0"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of course with ID 44?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 44"
  },
  {
    "db_id": "computer_student",
    "question": "Which students took courses taught by a professor who is a faculty member?",
    "evidence": "",
    "SQL": "SELECT P1.p_id FROM person AS P1 INNER JOIN taughtBy AS T2 ON P1.p_id = T2.p_id INNER JOIN person AS P2 ON P2.p_id = T2.p_id WHERE P2.hasPosition = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by the professor with ID 79?",
    "evidence": "",
    "SQL": "SELECT course.course_id, course.courseLevel FROM taughtBy INNER JOIN course ON taughtBy.course_id = course.course_id INNER JOIN person ON taughtBy.p_id = person.p_id WHERE person.p_id = 79"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by professors who have advised at least 2 students?",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN advisedBy AS T3 ON T2.p_id = T3.p_id WHERE T3.p_id_dummy = (SELECT p_id FROM person WHERE professor = 0 GROUP BY p_id HAVING COUNT(p_id) > 1)"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by a student who is in the Pre_Quals phase of a program and has not yet had any position?",
    "evidence": "",
    "SQL": "SELECT T3.course_id, T3.courseLevel FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T1.course_id WHERE T2.student = 1 AND T2.inPhase = 'Pre_Quals' AND T2.hasPosition = '0' ORDER BY T3.course_id"
  },
  {
    "db_id": "computer_student",
    "question": "What are all the courses taught by a person who is in the third year of their program?",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.p_id = (SELECT p_id FROM person WHERE yearsInProgram = 'Year_3') AND T1.course_id IN (SELECT course_id FROM course)"
  },
  {
    "db_id": "computer_student",
    "question": "What are the names of all the faculty employees who teach undergraduate courses at the 500-level?",
    "evidence": "",
    "SQL": "SELECT T2.p_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T3.p_id = T2.p_id WHERE T1.courseLevel = 'Level_500' AND T3.hasPosition = 'Faculty_eme'"
  },
  {
    "db_id": "computer_student",
    "question": "Which professors are advising students who are in Phase 0 of their program?",
    "evidence": "",
    "SQL": "SELECT DISTINCT P1.p_id FROM advisedBy AS P1 INNER JOIN person AS P2 ON P1.p_id = P2.p_id WHERE P2.inPhase = '0'"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses that a student in Level_500 program is supposed to take?",
    "evidence": "",
    "SQL": "SELECT course_id FROM course WHERE courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course taught by person ID 263?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 263"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of courses taught by all professors in the Level_500?",
    "evidence": "",
    "SQL": "SELECT COUNT(DISTINCT T3.course_id) FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id WHERE T3.courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course with id 61?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 61"
  },
  {
    "db_id": "computer_student",
    "question": "What is the name of the course taught by the professor who taught the most courses in the 'master/graduate' level?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel, T1.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_id ORDER BY COUNT(T2.course_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the maximum course ID among the courses taught by the faculty members who are not teaching a level 400 course?",
    "evidence": "",
    "SQL": "SELECT MAX(T1.course_id) FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T1.course_id WHERE T2.hasPosition = 'Faculty' AND T3.courseLevel != 'Level_400'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of courses taught by professors with more than 5 years of experience in the university?",
    "evidence": "",
    "SQL": "SELECT COUNT(T2.course_id) FROM taughtBy AS T2 INNER JOIN person AS T1 ON T2.p_id = T1.p_id WHERE T1.yearsInProgram > 5"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of students who have positions in Post_Generals phase?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE hasPosition = '1' AND inPhase = 'Post_Generals'"
  },
  {
    "db_id": "computer_student",
    "question": "What are the names of courses taught by professors who have less than 2 years of experience in the program?",
    "evidence": "",
    "SQL": "SELECT C.courseLevel FROM taughtBy AS T1 INNER JOIN course AS C ON T1.course_id = C.course_id INNER JOIN person AS P ON T1.p_id = P.p_id WHERE P.yearsInProgram < 2"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of courses taught by a professor from Level_500?",
    "evidence": "",
    "SQL": "SELECT COUNT(DISTINCT T1.course_id) FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T1.course_id WHERE T3.courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "Which course is taught by the professor who has the most courses and at what level is it?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel, T1.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_id, T1.courseLevel ORDER BY COUNT(T2.course_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by the advisors who gave advice to a student with ID 141?",
    "evidence": "",
    "SQL": "SELECT T3.course_id FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN taughtBy AS T3 ON T2.p_id = T3.p_id WHERE T1.p_id = 141"
  },
  {
    "db_id": "computer_student",
    "question": "What is the highest level of course taught by a person with 'Faculty_eme' as their position?",
    "evidence": "",
    "SQL": "SELECT MAX(courseLevel) FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id INNER JOIN person ON taughtBy.p_id = person.p_id WHERE person.hasPosition = 'Faculty_eme'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the student id of the person who has been in the program for 1 year?",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE yearsInProgram = '1'"
  },
  {
    "db_id": "computer_student",
    "question": "Which professors have taught multiple courses with different levels?",
    "evidence": "",
    "SQL": "SELECT p_id FROM (SELECT p_id, COUNT(DISTINCT course_id) AS num_courses FROM taughtBy GROUP BY p_id) AS T1 WHERE num_courses > 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the list of students who took the courses that were taught by professors of a specific level?",
    "evidence": "",
    "SQL": "SELECT T1.p_id, T2.course_id FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T3.courseLevel IN (SELECT courseLevel FROM course WHERE course_id IN (SELECT course_id FROM taughtBy WHERE p_id IN (SELECT p_id FROM person WHERE hasPosition = 'Faculty_eme'))) AND T1.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the percentage of students who are in post-generals phase, have a position and have a professor in their advisedBy table?",
    "evidence": "",
    "SQL": "SELECT CAST(COUNT(DISTINCT p_id) AS REAL) * 100 / COUNT(*) AS per FROM person WHERE hasPosition = '1' AND inPhase = 'Post_Generals' AND (SELECT COUNT(*) FROM advisedBy WHERE p_id = person.p_id) > 0"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are taught by professors who have taught Level_500 courses?",
    "evidence": "",
    "SQL": "SELECT T1.course_id, T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id IN (SELECT T3.p_id FROM taughtBy AS T3 INNER JOIN course AS T4 ON T3.course_id = T4.course_id WHERE T4.courseLevel = 'Level_500')"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses with at least two professors teaching them?",
    "evidence": "",
    "SQL": "SELECT course_id FROM course AS T1 WHERE T1.course_id IN (SELECT course_id FROM taughtBy AS T2 GROUP BY course_id HAVING COUNT(p_id) > 1)"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of courses that are taught by professors who are in their 5th year of program and have a position status of being a faculty member?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T1.course_id WHERE T2.yearsInProgram = 'Year_5' AND T2.hasPosition = 'Faculty_eme'"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses that are taught by professors who have more than 4 years of experience in their program?",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.yearsInProgram = 'Year_4' OR T2.yearsInProgram = 'Year_5' OR T2.yearsInProgram = 'Year_6' OR T2.yearsInProgram = 'Year_7' OR T2.yearsInProgram = 'Year_8'"
  },
  {
    "db_id": "computer_student",
    "question": "What are the advisors for the students in Level_500 program?",
    "evidence": "",
    "SQL": "SELECT T1.p_id FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T2.student = 0 WHERE T3.courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "What course does professor with p_id 201 teach and what is its courseLevel?",
    "evidence": "",
    "SQL": "SELECT T1.course_id, T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 201"
  },
  {
    "db_id": "computer_student",
    "question": "How many students are there who have not completed their Phase 0?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE student = 1 AND inPhase != '0'"
  },
  {
    "db_id": "computer_student",
    "question": "Who teaches the most courses among professors?",
    "evidence": "",
    "SQL": "SELECT T1.p_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id GROUP BY T1.p_id ORDER BY COUNT(T1.course_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course which is taught by professor p_id 201?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id WHERE taughtBy.p_id = 201"
  },
  {
    "db_id": "computer_student",
    "question": "Which students are currently in the Pre_Quals phase?",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE inPhase = 'Pre_Quals' AND student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "Which professors with 'Faculty_eme' positions teach Level_400 courses?",
    "evidence": "",
    "SQL": "SELECT T1.p_id FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id WHERE T1.hasPosition = 'Faculty_eme' AND T3.courseLevel = 'Level_400'"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are taught by the professor with ID 52?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel, T1.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 52"
  },
  {
    "db_id": "computer_student",
    "question": "Which students in the program for more than 3 years are being advised by advisors?",
    "evidence": "",
    "SQL": "SELECT * FROM person WHERE student = 1 AND yearsInProgram > 3"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of students who are currently in the Level_400 program?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE student = 1 AND inPhase = 'Post_Generals' AND yearsInProgram = 'Year_5'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the name of all the courses taught by a professor with name yearsInProgram as 'Year_3'?",
    "evidence": "",
    "SQL": "SELECT course.course_id, course.courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id INNER JOIN person ON taughtBy.p_id = person.p_id WHERE person.yearsInProgram = 'Year_3'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of the most popular course and how many people are teaching it?",
    "evidence": "",
    "SQL": "SELECT courseLevel, COUNT(*) FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id INNER JOIN person ON taughtBy.p_id = person.p_id GROUP BY courseLevel ORDER BY COUNT(*) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by a person who is a student?",
    "evidence": "",
    "SQL": "SELECT DISTINCT T2.course_id FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id WHERE T1.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course ID of the course with the most professors?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_id ORDER BY COUNT(T2.p_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "Which course levels do Level_200 and Level_500 courses belong to?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id IN (SELECT course_id FROM taughtBy WHERE p_id IN (SELECT p_id FROM person WHERE courseLevel = 'Level_200' OR courseLevel = 'Level_500'))"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by professor 335?",
    "evidence": "",
    "SQL": "SELECT * FROM taughtBy WHERE p_id = 335"
  },
  {
    "db_id": "computer_student",
    "question": "What is the highest level of courses taught by students?",
    "evidence": "",
    "SQL": "SELECT MAX(T1.courseLevel) FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id IN (SELECT p_id FROM person WHERE student = 1)"
  },
  {
    "db_id": "computer_student",
    "question": "What course does professor 267 teach?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 267"
  },
  {
    "db_id": "computer_student",
    "question": "How many students in the 'Level_500' course have a professor?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T1.courseLevel = 'Level_500' AND T3.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course taught by professor 319?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id WHERE taughtBy.p_id = 319"
  },
  {
    "db_id": "computer_student",
    "question": "What is the average course level taught by professors who have advised at least one student teaching a course?",
    "evidence": "",
    "SQL": "SELECT AVG(Course.courseLevel) FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id INNER JOIN advisedBy ON taughtBy.p_id = advisedBy.p_id GROUP BY taughtBy.p_id HAVING COUNT(advisedBy.p_id_dummy) > 0"
  },
  {
    "db_id": "computer_student",
    "question": "What is the ID of the course taught by the professor with the most courses taught?",
    "evidence": "",
    "SQL": "SELECT course.course_id FROM course, taughtBy GROUP BY course.course_id HAVING COUNT(*) = (SELECT COUNT(*) FROM taughtBy GROUP BY p_id ORDER BY COUNT(*) DESC LIMIT 1)"
  },
  {
    "db_id": "computer_student",
    "question": "Please list all the courses taught by professors who have more than 3 years of experience in the program.",
    "evidence": "",
    "SQL": "SELECT course.course_id, course.courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id INNER JOIN person ON taughtBy.p_id = person.p_id WHERE person.yearsInProgram > '3' ORDER BY course.courseLevel"
  },
  {
    "db_id": "computer_student",
    "question": "Who taught the most courses of Level_500?",
    "evidence": "",
    "SQL": "SELECT T2.p_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T1.courseLevel='Level_500' GROUP BY T2.p_id ORDER BY COUNT(T2.course_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by professors who have more than 2 years of experience in the program?",
    "evidence": "",
    "SQL": "SELECT * FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T3.p_id = T2.p_id WHERE T3.yearsInProgram = 'Year_3'"
  },
  {
    "db_id": "computer_student",
    "question": "What are the levels of courses taught by professors with more than 10 years of experience?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course, taughtBy, person WHERE course.course_id = taughtBy.course_id AND taughtBy.p_id = person.p_id AND person.yearsInProgram > 'Year_10'"
  },
  {
    "db_id": "computer_student",
    "question": "What are the total number of courses with a specific professor who has been a professor for more than 2 years?",
    "evidence": "",
    "SQL": "SELECT COUNT(T2.course_id) FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id WHERE T1.yearsInProgram > 'Year_2'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course with ID 77?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 77"
  },
  {
    "db_id": "computer_student",
    "question": "Find the courses taught by the professor with ID 165 and the level of these courses.",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 165"
  },
  {
    "db_id": "computer_student",
    "question": "What level is the course with ID 114?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 114"
  },
  {
    "db_id": "computer_student",
    "question": "What is the minimum number of years in the program for students who are not in any position?",
    "evidence": "",
    "SQL": "SELECT MIN(yearsInProgram) FROM person WHERE inPhase IS NULL"
  },
  {
    "db_id": "computer_student",
    "question": "List down all the students of person ID 140.",
    "evidence": "",
    "SQL": "SELECT * FROM person WHERE p_id = 140 AND student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are taught by professor with ID `165`?",
    "evidence": "",
    "SQL": "SELECT * FROM taughtBy WHERE p_id = 165"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are taught by professors who have taught at least one course in Level_400 and have students?",
    "evidence": "",
    "SQL": "SELECT course.course_id, course.courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id INNER JOIN person ON taughtBy.p_id = person.p_id WHERE person.student = 1 AND course.courseLevel IN (SELECT courseLevel FROM course WHERE courseLevel LIKE '%Level_400%')"
  },
  {
    "db_id": "computer_student",
    "question": "How many students are taking courses that are taught by professors who have more than 0 years of experience in the program?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id WHERE T1.student = 1 AND T3.courseLevel = 'Level_500' AND T1.yearsInProgram > 0"
  },
  {
    "db_id": "computer_student",
    "question": "What is the student ID of the student who has spent most years in the program?",
    "evidence": "",
    "SQL": "SELECT T1.student FROM person AS T1 GROUP BY T1.student ORDER BY LENGTH(T1.yearsInProgram) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of students in all faculties in the Level_200 course?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE inPhase = '0' AND yearsInProgram = '0'"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by professors from a specific department?",
    "evidence": "",
    "SQL": "SELECT T1.course_id, T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.hasPosition = 'Specific_department'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the highest level of course taught by the professor who teaches course with course id 44?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 44"
  },
  {
    "db_id": "computer_student",
    "question": "What are the IDs of all the students who have 2 advisors?",
    "evidence": "",
    "SQL": "SELECT T2.p_id FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.student = 1 GROUP BY T2.p_id HAVING COUNT(T1.p_id) = 2"
  },
  {
    "db_id": "computer_student",
    "question": "Which people do not have a professor?",
    "evidence": "",
    "SQL": "SELECT * FROM person WHERE hasPosition = 0"
  },
  {
    "db_id": "computer_student",
    "question": "What course Level is the course with course_id 123?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 123"
  },
  {
    "db_id": "computer_student",
    "question": "What is the highest course level that a professor teaches?",
    "evidence": "",
    "SQL": "SELECT DISTINCT courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id GROUP BY courseLevel ORDER BY courseLevel DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are the IDs of students who are taught by a professor who is faculty employee and also advised by another professor who is also a faculty employee?",
    "evidence": "",
    "SQL": "SELECT P1.p_id FROM person AS P1 INNER JOIN taughtBy AS T1 ON P1.p_id = T1.p_id INNER JOIN advisedBy AS A1 ON A1.p_id = P1.p_id INNER JOIN person AS P2 ON A1.p_id_dummy = P2.p_id WHERE P1.hasPosition = 'Faculty_eme' AND P2.hasPosition = 'Faculty_eme'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of students and professors in the database?",
    "evidence": "",
    "SQL": "SELECT COUNT(p_id) FROM person WHERE (student = 1) OR (student = 0)"
  },
  {
    "db_id": "computer_student",
    "question": "How many students in level 400 are advised by a professor who teaches a level 500 course?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person AS T1 INNER JOIN advisedBy AS T2 ON T1.p_id = T2.p_id_dummy INNER JOIN course AS T3 ON T1.professor = 1 INNER JOIN taughtBy AS T4 ON T3.course_id = T4.course_id WHERE T1.student = 1 AND T3.courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "What courses has professor no.394 taught?",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy WHERE p_id = 394"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of the course with ID 139?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 139"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course with ID 3?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 3"
  },
  {
    "db_id": "computer_student",
    "question": "How many students in Pre_Quals phase are currently in their first year of the program?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE inPhase = 'Pre_Quals' AND yearsInProgram = 'Year_1' AND student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the courses taught by the person with ID 140?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id WHERE taughtBy.p_id = 140"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course taught by professor with ID 98?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id WHERE taughtBy.p_id = 98"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course taught by the professor who taught the most courses?",
    "evidence": "",
    "SQL": "SELECT T3.courseLevel FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T1.course_id GROUP BY T3.courseLevel ORDER BY COUNT(T3.course_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course with course ID 28?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 28"
  },
  {
    "db_id": "computer_student",
    "question": "What is the courseLevel of the course with course_id 117?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 117"
  },
  {
    "db_id": "computer_student",
    "question": "What is the phase of the student who has been in the program for 7 years?",
    "evidence": "",
    "SQL": "SELECT inPhase FROM person WHERE yearsInProgram = 'Year_7' AND student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the average course level for students who are in Phase Post_Generals?",
    "evidence": "",
    "SQL": "SELECT AVG(courseLevel) FROM course, person WHERE person.inPhase = 'Post_Generals' AND person.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "Who teaches Level_400 courses?",
    "evidence": "",
    "SQL": "SELECT T1.p_id FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id WHERE T3.courseLevel = 'Level_400'"
  },
  {
    "db_id": "computer_student",
    "question": "How many students of the program have more than 4 years in program?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE yearsInProgram = 'Year_5' AND student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "Which level of course has the highest number of students enrolled?",
    "evidence": "",
    "SQL": "SELECT courseLevel, COUNT(*) FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id GROUP BY courseLevel ORDER BY COUNT(*) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "How many courses are there for a Level_500 course?",
    "evidence": "",
    "SQL": "SELECT COUNT(course_id) FROM course WHERE courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "What course ID is taught by professor with ID 248?",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy WHERE p_id = 248"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of the course with the highest student enrollment?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id ORDER BY (SELECT COUNT(T3.student) FROM person AS T3 WHERE T3.hasPosition = 1 AND T3.inPhase = 'Pre_Quals' AND T3.yearsInProgram = 'Year_1' AND T3.p_id IN (SELECT T4.p_id FROM taughtBy AS T4 WHERE T4.course_id = T1.course_id)) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by professors who have been in the program for more than three years?",
    "evidence": "",
    "SQL": "SELECT T3.course_id, T3.courseLevel FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T1.course_id WHERE T2.yearsInProgram = 'Year_4'"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are taught by professors with more than 5 years of experience?",
    "evidence": "",
    "SQL": "SELECT T3.course_id, T3.courseLevel FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T1.course_id WHERE T2.yearsInProgram > 5"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by professors in Level 300?",
    "evidence": "",
    "SQL": "SELECT T1.course_id, T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id IN (SELECT p_id FROM person WHERE professor = 1 AND courseLevel = 'Level_300')"
  },
  {
    "db_id": "computer_student",
    "question": "What are the IDs of professors who have students with students in the same course?",
    "evidence": "",
    "SQL": "SELECT T2.p_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id"
  },
  {
    "db_id": "computer_student",
    "question": "List out the course IDs of courses taught by professors who have more than one position.",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.hasPosition != '0' GROUP BY course_id HAVING COUNT(T1.p_id) > 1"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are taught by a professor with more than one advisor?",
    "evidence": "",
    "SQL": "SELECT C.course_id, C.courseLevel FROM taughtBy AS T1 INNER JOIN course AS C ON T1.course_id = C.course_id INNER JOIN advisedBy AS T2 ON T1.p_id = T2.p_id_dummy GROUP BY T1.course_id, C.courseLevel HAVING COUNT(T2.p_id_dummy) > 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are the IDs of students who have taken more than one course?",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE p_id IN (SELECT p_id FROM taughtBy GROUP BY p_id HAVING COUNT(*) > 1)"
  },
  {
    "db_id": "computer_student",
    "question": "What are the IDs of professors who have taught more than one course?",
    "evidence": "",
    "SQL": "SELECT T2.p_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id GROUP BY T2.p_id HAVING COUNT(T1.course_id) > 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of students who are in the Pre_Quals phase of the program?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE inPhase = 'Pre_Quals' AND student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What courses has Professor with ID 165 taught?",
    "evidence": "",
    "SQL": "SELECT course.course_id, course.courseLevel FROM course JOIN taughtBy ON course.course_id = taughtBy.course_id WHERE taughtBy.p_id = 165"
  },
  {
    "db_id": "computer_student",
    "question": "What is the ID of the person who is a student and also has a position?",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE (student = 1) AND (hasPosition = '1')"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course ID of all Level_400 courses?",
    "evidence": "",
    "SQL": "SELECT course_id FROM course WHERE courseLevel = 'Level_400'"
  },
  {
    "db_id": "computer_student",
    "question": "How many students are advised by a professor who teaches at least one course with a level of level_400 or higher?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person AS P1 INNER JOIN advisedBy AS P2 ON P1.p_id = P2.p_id_dummy INNER JOIN taughtBy AS T2 ON P2.p_id = T2.p_id INNER JOIN course AS C ON T2.course_id = C.course_id WHERE C.courseLevel = 'Level_400' GROUP BY P1.p_id HAVING COUNT(DISTINCT T2.course_id) > 0"
  },
  {
    "db_id": "computer_student",
    "question": "Which student took the courses taught by professors who have been in the program for more than 5 years?",
    "evidence": "",
    "SQL": "SELECT T1.p_id, T3.course_id FROM person AS T1 INNER JOIN advisedBy AS T2 ON T1.p_id = T2.p_id_dummy INNER JOIN taughtBy AS T3 ON T2.p_id = T3.p_id INNER JOIN course AS T4 ON T3.course_id = T4.course_id WHERE T1.inPhase = 'Post_Generals' AND (T4.courseLevel = 'Level_500' OR T4.courseLevel = 'Level_700') AND LENGTH(T1.yearsInProgram) > 5"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by professors who have more than 5 years of experience?",
    "evidence": "",
    "SQL": "SELECT T3.course_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T1.course_id = T3.course_id WHERE T2.yearsInProgram > 'Year_5'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of a course taught by a professor?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T3.p_id = T2.p_id WHERE T3.professor = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of course 4?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 4"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by professors who have students?",
    "evidence": "",
    "SQL": "SELECT T1.course_id, T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "Which course IDs have been taught by the same professor who taught 'Level_400' courses?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM taughtBy AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T1.p_id IN (SELECT p_id FROM taughtBy AS T3 INNER JOIN course AS T4 ON T3.course_id = T4.course_id WHERE T4.courseLevel = 'Level_400') AND T2.courseLevel != 'Level_400' GROUP BY T1.course_id HAVING COUNT(DISTINCT T2.courseLevel) > 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are the top 3 courses taught by the most experienced professors?",
    "evidence": "",
    "SQL": "SELECT T3.course_id, T3.courseLevel FROM course AS T3 INNER JOIN taughtBy AS T2 ON T3.course_id = T2.course_id INNER JOIN person AS T1 ON T2.p_id = T1.p_id GROUP BY T3.course_id ORDER BY COUNT(T2.course_id) DESC LIMIT 3"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses that a student with the ID 111 is taking?",
    "evidence": "",
    "SQL": "SELECT T2.course_id FROM taughtBy AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T1.p_id = T3.p_id WHERE T3.p_id = 111"
  },
  {
    "db_id": "computer_student",
    "question": "What is the name of the professor who taught the most courses?",
    "evidence": "",
    "SQL": "SELECT p_id, (SELECT COUNT(*) FROM taughtBy AS T2 WHERE T1.p_id = T2.p_id) AS count_courses FROM taughtBy AS T1 GROUP BY p_id ORDER BY count_courses DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the ID of the person who taught course ID 71?",
    "evidence": "",
    "SQL": "SELECT p_id FROM taughtBy WHERE course_id = 71"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are taught by a faculty with more than one student advisor?",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN advisedBy AS T3 ON T3.p_id = T2.p_id WHERE T3.p_id_dummy IS NOT NULL"
  },
  {
    "db_id": "computer_student",
    "question": "How many courses are taught by a faculty member?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM course, taughtBy, person WHERE course.course_id = taughtBy.course_id AND taughtBy.p_id = person.p_id AND person.hasPosition = 'Faculty_aff'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of courses taught by professors who are also students?",
    "evidence": "",
    "SQL": "SELECT COUNT(DISTINCT T1.course_id) FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are the names of courses taught by the faculty with less than 5 years of experience in the program?",
    "evidence": "",
    "SQL": "SELECT T3.course_id, T3.courseLevel FROM course AS T3 INNER JOIN taughtBy AS T2 ON T3.course_id = T2.course_id INNER JOIN person AS T1 ON T2.p_id = T1.p_id WHERE T1.yearsInProgram < 5 GROUP BY T3.course_id, T3.courseLevel"
  },
  {
    "db_id": "computer_student",
    "question": "What is the most common course level in the database?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course GROUP BY courseLevel ORDER BY COUNT(*) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "Which courses are taught by only one professor?",
    "evidence": "",
    "SQL": "SELECT T1.course_id, T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_id, T1.courseLevel HAVING COUNT(DISTINCT T2.p_id) = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of the courses that the student with ID 72 is not advised by any professor?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel FROM course AS T1 LEFT JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id IS NULL AND NOT EXISTS (SELECT 1 FROM advisedBy AS T3 WHERE T3.p_id_dummy = 72)"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course id of the course taught by the professor with the most courses?",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id GROUP BY T1.p_id ORDER BY COUNT(*) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are the names of the people who taught course ID 12?",
    "evidence": "",
    "SQL": "SELECT person.p_id, person.student, person.professor, person.hasPosition FROM person INNER JOIN taughtBy ON person.p_id = taughtBy.p_id WHERE course_id = 12"
  },
  {
    "db_id": "computer_student",
    "question": "What are all the courses taught by professors who have a certain course level?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM taughtBy AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.courseLevel = 'Level_400'"
  },
  {
    "db_id": "computer_student",
    "question": "What are the names of courses taught by professors having more than 3 years in the program?",
    "evidence": "",
    "SQL": "SELECT course.courseLevel, course.course_id FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id INNER JOIN person ON taughtBy.p_id = person.p_id WHERE person.yearsInProgram > 3"
  },
  {
    "db_id": "computer_student",
    "question": "What is the courseLevel of the course with course_id 56?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 56"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of courses taught by the most teachers?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id ORDER BY COUNT(T2.p_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "List the IDs of students who have studied under at least one professor who taught a Level 400 course.",
    "evidence": "",
    "SQL": "SELECT student FROM person AS T1 INNER JOIN advisedBy AS T2 ON T1.p_id = T2.p_id INNER JOIN taughtBy AS T3 ON T2.p_id = T3.p_id INNER JOIN course AS T4 ON T3.course_id = T4.course_id WHERE T4.courseLevel = 'Level_400' GROUP BY student HAVING COUNT(student) > 0"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of courses taught by professors in the Level_500 category?",
    "evidence": "",
    "SQL": "SELECT COUNT(T1.course_id) FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T1.courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "What percentage of students in the program are taught by professors who have the position 'Faculty_aff'?",
    "evidence": "",
    "SQL": "SELECT CAST(SUM(CASE WHEN p.hasPosition = 'Faculty_aff' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) AS per FROM taughtBy AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS p ON T1.p_id = p.p_id GROUP BY p.hasPosition"
  },
  {
    "db_id": "computer_student",
    "question": "What is the highest course level in the database?",
    "evidence": "",
    "SQL": "SELECT DISTINCT courseLevel FROM course ORDER BY courseLevel DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the name of the student who is taking their first year of the program?",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE inPhase = 'Year_1' AND student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "List the IDs of the courses taught by professors who are not students and have more than 1 year of experience in the program.",
    "evidence": "",
    "SQL": "SELECT T2.course_id FROM taughtBy AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T1.p_id = T3.p_id WHERE T3.student = 0 AND T3.yearsInProgram > 0"
  },
  {
    "db_id": "computer_student",
    "question": "For professors who have been teaching Level_500 courses, what is their combined years of teaching experience?",
    "evidence": "",
    "SQL": "SELECT SUM(yearsInProgram) AS combinedYears FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T3.courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course with the most professors?",
    "evidence": "",
    "SQL": "SELECT course_id, COUNT(p_id) AS num_professors FROM taughtBy GROUP BY course_id ORDER BY num_professors DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course that the professor with id 335 teaches?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id IN (SELECT course_id FROM taughtBy WHERE p_id = 335)"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by the student who is in phase 0 and has not held any faculty position?",
    "evidence": "",
    "SQL": "SELECT T1.course_id, T2.courseLevel FROM taughtBy AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T1.p_id = T3.p_id WHERE T3.inPhase = '0' AND T3.hasPosition = '0' AND T3.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "Who is the student that has been in the program for the least number of years?",
    "evidence": "",
    "SQL": "SELECT p_id, MIN(yearsInProgram) FROM person GROUP BY p_id HAVING yearsInProgram = (SELECT MIN(yearsInProgram) FROM person)"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course with the highest level taught by professor 351?",
    "evidence": "",
    "SQL": "SELECT * FROM course WHERE course_id IN (SELECT course_id FROM taughtBy WHERE p_id = 351) ORDER BY courseLevel DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are being taught by Professor 331?",
    "evidence": "",
    "SQL": "SELECT T1.course_id, T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 331"
  },
  {
    "db_id": "computer_student",
    "question": "What is the average years of program for students who are currently in Pre_Quals phase?",
    "evidence": "",
    "SQL": "SELECT AVG(yearsInProgram) FROM person WHERE inPhase = 'Pre_Quals'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course ID and course level of the undergraduate course that has been taught by Professor 52?",
    "evidence": "",
    "SQL": "SELECT C.course_id, C.courseLevel FROM course AS C INNER JOIN taughtBy AS T ON C.course_id = T.course_id WHERE T.p_id = 52 AND C.courseLevel = 'Level_400'"
  },
  {
    "db_id": "computer_student",
    "question": "List the course levels of the courses taught by students who have been in the program for at least 2 years.",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id INNER JOIN person ON taughtBy.p_id = person.p_id WHERE yearsInProgram >= '2' AND student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of a course taught by a professor with more than 2 years in the program?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T3.p_id = T2.p_id WHERE T3.yearsInProgram LIKE '%Year_3%' AND T3.professor = 1"
  },
  {
    "db_id": "computer_student",
    "question": "Which professors advise students in the year 4 program?",
    "evidence": "",
    "SQL": "SELECT p1.p_id FROM person AS p1 INNER JOIN advisedBy AS p2 ON p1.p_id = p2.p_id INNER JOIN person AS p3 ON p2.p_id_dummy = p3.p_id WHERE p3.yearsInProgram = 'Year_4' AND p3.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of course with ID 27?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 27"
  },
  {
    "db_id": "computer_student",
    "question": "Which student has taught a course with level Level_300?",
    "evidence": "",
    "SQL": "SELECT T1.p_id FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id WHERE T3.courseLevel = 'Level_300' AND T1.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course taught by professor with ID 104?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 104"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course taught by professor 40?",
    "evidence": "",
    "SQL": "SELECT course.courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id WHERE taughtBy.p_id = 40"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are taught by person ID 394?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 394"
  },
  {
    "db_id": "computer_student",
    "question": "What is the position of a professor who is not teaching any course?",
    "evidence": "",
    "SQL": "SELECT hasPosition FROM person WHERE p_id NOT IN (SELECT p_id FROM taughtBy)"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by a professor with at least 1 year of experience in the program?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel, T1.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.yearsInProgram > 0"
  },
  {
    "db_id": "computer_student",
    "question": "Which students have been advised by the same advisor?",
    "evidence": "",
    "SQL": "SELECT p_id FROM advisedBy GROUP BY p_id HAVING COUNT(p_id_dummy) > 1"
  },
  {
    "db_id": "computer_student",
    "question": "Find the professor IDs who are teaching courses of 'Level_500' and their corresponding course IDs.",
    "evidence": "",
    "SQL": "SELECT T2.p_id, T1.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T1.courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "How many students is each course level taught to?",
    "evidence": "",
    "SQL": "SELECT courseLevel, COUNT(student) AS num_students FROM course NATURAL JOIN taughtBy NATURAL JOIN person WHERE student = 1 GROUP BY courseLevel"
  },
  {
    "db_id": "computer_student",
    "question": "Which students are taught by professors who teach Level_400 courses?",
    "evidence": "",
    "SQL": "SELECT P1.p_id FROM person P1 JOIN advisedBy AB ON P1.p_id = AB.p_id_dummy JOIN taughtBy TB ON AB.p_id = TB.p_id JOIN course C ON TB.course_id = C.course_id WHERE C.courseLevel = 'Level_400' GROUP BY P1.p_id"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are taught by both faculty members and have at least one student enrolled?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.professor = 1 AND T3.student > 0"
  },
  {
    "db_id": "computer_student",
    "question": "What level is the course taught by a professor who has taught a course with level 'Level_500'?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T3.p_id = T2.p_id WHERE T3.hasPosition = 'Faculty_aff' AND T1.courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "Which courses are taught by professors who have been in the faculty for more than 5 years?",
    "evidence": "",
    "SQL": "SELECT T3.courseLevel FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id WHERE T1.yearsInProgram = 'Year_5+'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course taught by professor with ID 79?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id WHERE p_id = 79"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course that is taught by professor 228?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 228"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of a course taught by the professor with course_id 8?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 8 AND courseLevel IN (SELECT courseLevel FROM course WHERE course_id IN (SELECT course_id FROM taughtBy WHERE p_id IN (SELECT p_id FROM person WHERE professor = 1)))"
  },
  {
    "db_id": "computer_student",
    "question": "What is the ID of a person who taught the most courses?",
    "evidence": "",
    "SQL": "SELECT T1.p_id FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id GROUP BY T1.p_id ORDER BY COUNT(T2.course_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of course ID 143?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 143"
  },
  {
    "db_id": "computer_student",
    "question": "What is the name of the professor who taught the course with ID 71?",
    "evidence": "",
    "SQL": "SELECT T2.p_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T1.course_id = 71"
  },
  {
    "db_id": "computer_student",
    "question": "What are all the courses that a student with ID 100 is teaching?",
    "evidence": "",
    "SQL": "SELECT T3.course_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T1.course_id WHERE T2.student = 0"
  },
  {
    "db_id": "computer_student",
    "question": "What are the IDs of the courses taught by professors with more than 5 students?",
    "evidence": "",
    "SQL": "SELECT T2.course_id FROM taughtBy AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T1.p_id = T3.p_id WHERE T3.student > 5"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are taught by professor with ID 104?",
    "evidence": "",
    "SQL": "SELECT course.course_id, course.courseLevel FROM taughtBy INNER JOIN course ON course.course_id = taughtBy.course_id WHERE p_id = 104"
  },
  {
    "db_id": "computer_student",
    "question": "Which courses has professor 267 taught?",
    "evidence": "",
    "SQL": "SELECT course.course_id, course.courseLevel FROM taughtBy JOIN course ON taughtBy.course_id = course.course_id WHERE taughtBy.p_id = 267"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are taught by professors who are also students?",
    "evidence": "",
    "SQL": "SELECT course.course_id, course.courseLevel FROM course JOIN taughtBy ON course.course_id = taughtBy.course_id JOIN person ON taughtBy.p_id = person.p_id WHERE person.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "Who is the student with the most number of years in the program?",
    "evidence": "",
    "SQL": "SELECT p_id, yearsInProgram FROM person ORDER BY yearsInProgram DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are being taught by professors who have been in the program for more than 3 years?",
    "evidence": "",
    "SQL": "SELECT T3.course_id, T3.courseLevel FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T1.course_id WHERE T2.yearsInProgram > '3'"
  },
  {
    "db_id": "computer_student",
    "question": "Which students have more than one advisor?",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE p_id IN (SELECT p_id FROM advisedBy GROUP BY p_id HAVING COUNT(p_id_dummy) > 1)"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of students who have been advised by a professor?",
    "evidence": "",
    "SQL": "SELECT COUNT(T1.p_id) FROM person AS T1 INNER JOIN advisedBy AS T2 ON T1.p_id = T2.p_id_dummy"
  },
  {
    "db_id": "computer_student",
    "question": "What are the students who are taught by professors with a specific role?",
    "evidence": "",
    "SQL": "SELECT P.student FROM person AS P INNER JOIN taughtBy AS T ON P.p_id = T.p_id WHERE T.course_id IN (SELECT T1.course_id FROM taughtBy AS T1 INNER JOIN person AS P1 ON T1.p_id = P1.p_id WHERE P1.hasPosition = 'Specific_Role')"
  },
  {
    "db_id": "computer_student",
    "question": "What is the average years of students in Year_3?",
    "evidence": "",
    "SQL": "SELECT AVG(yearsInProgram) FROM person WHERE yearsInProgram = 'Year_3'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of a course taught by the professor with the ID 235?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course NATURAL JOIN taughtBy WHERE p_id = 235"
  },
  {
    "db_id": "computer_student",
    "question": "What is the name of the course with ID 71?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 71"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of the course with id 57?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 57"
  },
  {
    "db_id": "computer_student",
    "question": "What are all the course levels in the course table?",
    "evidence": "",
    "SQL": "SELECT distinct courseLevel FROM course"
  },
  {
    "db_id": "computer_student",
    "question": "What is the average level of all courses taught by a student?",
    "evidence": "",
    "SQL": "SELECT AVG(T2.courseLevel) FROM taughtBy AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T1.p_id IN (SELECT p_id FROM person WHERE student = 1)"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course taught by the professor with ID 351?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 351"
  },
  {
    "db_id": "computer_student",
    "question": "Which course level has the most students enrolled?",
    "evidence": "",
    "SQL": "SELECT DISTINCT courseLevel FROM course WHERE courseLevel IN (SELECT DISTINCT inPhase FROM person WHERE yearsInProgram > 0)"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by professors who have taught more than 3 courses?",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy AS T1 GROUP BY course_id HAVING COUNT(course_id) > 3"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course taught by the person with ID 235?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 235"
  },
  {
    "db_id": "computer_student",
    "question": "What courses were taught by a faculty member who has been in the program for 4 or more years?",
    "evidence": "",
    "SQL": "SELECT DISTINCT T2.course_id FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id WHERE T1.student = 0 AND T1.yearsInProgram = 'Year_4' OR T1.yearsInProgram = 'Year_5'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of course with course ID 170?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 170"
  },
  {
    "db_id": "computer_student",
    "question": "Which courses are taught by advisors who are students themselves?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.hasPosition = '1'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of courses that a person teaches?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM taughtBy"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are taught by people with a position in a department?",
    "evidence": "",
    "SQL": "SELECT T1.course_id, T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.hasPosition = 'Department'"
  },
  {
    "db_id": "computer_student",
    "question": "Which course IDs are taught by a professor with an ID greater than 220?",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy WHERE p_id > 220"
  },
  {
    "db_id": "computer_student",
    "question": "Which professors have taught more than 1 course at Level_500?",
    "evidence": "",
    "SQL": "SELECT p_id FROM taughtBy GROUP BY p_id HAVING COUNT(course_id) > 1"
  },
  {
    "db_id": "computer_student",
    "question": "Which students are not advised by any professor?",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE p_id NOT IN (SELECT p_id FROM advisedBy)"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of courses taught by professors with more than 1 year of experience?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.inPhase = '0' AND T2.yearsInProgram > '0'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the general course level taught by the most experienced professor?",
    "evidence": "",
    "SQL": "SELECT T3.courseLevel FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id GROUP BY T3.courseLevel ORDER BY COUNT(T2.course_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course taught by the professor who has been in the program for more than 4 years?",
    "evidence": "",
    "SQL": "SELECT course.courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id INNER JOIN person ON taughtBy.p_id = person.p_id WHERE person.yearsInProgram > 'Year_4'"
  },
  {
    "db_id": "computer_student",
    "question": "What are the names of all undergraduate courses taught by professors who are also students?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id IN (SELECT p_id FROM person WHERE student = 1)"
  },
  {
    "db_id": "computer_student",
    "question": "What are the professors who have advised at least 2 students?",
    "evidence": "",
    "SQL": "SELECT T1.p_id, T1.hasPosition FROM person AS T1 WHERE T1.p_id IN (SELECT T2.p_id FROM person AS T2 INNER JOIN \"advisedBy\" AS T3 ON T2.p_id = T3.p_id GROUP BY T2.p_id HAVING COUNT(T3.p_id) >= 2)"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are taught by the professor with ID 426?",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy WHERE p_id = 426"
  },
  {
    "db_id": "computer_student",
    "question": "What are all the courses that have more than one instructor teaching it?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_id HAVING COUNT(T2.p_id) > 1"
  },
  {
    "db_id": "computer_student",
    "question": "Which students have a professor who is not currently a student in the program and has taught more than 1 course?",
    "evidence": "",
    "SQL": "SELECT T1.p_id FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id WHERE T1.student = 1 AND T1.hasPosition = 0 AND T2.course_id IN (SELECT T4.course_id FROM taughtBy AS T4 GROUP BY T4.course_id HAVING COUNT(T4.course_id) > 1)"
  },
  {
    "db_id": "computer_student",
    "question": "Which professors teach both courses and do not have a position?",
    "evidence": "",
    "SQL": "SELECT T1.p_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.professor = 1 AND T2.hasPosition = 0"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of professors who have taught at least 3 different undergraduate courses?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM (SELECT COUNT(DISTINCT T2.course_id) AS countCourses, T1.p_id FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id GROUP BY T1.p_id HAVING COUNT(DISTINCT T2.course_id) >= 3) AS T1"
  },
  {
    "db_id": "computer_student",
    "question": "What are the course levels taught by the professor with ID 104?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 104"
  },
  {
    "db_id": "computer_student",
    "question": "What are the years in program of students who have been advised by teacher no. 75?",
    "evidence": "",
    "SQL": "SELECT yearsInProgram FROM person AS T1 INNER JOIN advisedBy AS T2 ON T1.p_id = T2.p_id WHERE T2.p_id = 75"
  },
  {
    "db_id": "computer_student",
    "question": "How many students in the 5th year are being taught by Professor 3?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN taughtBy AS T3 ON T2.p_id = T3.p_id WHERE T2.student = 1 AND T2.yearsInProgram = 'Year_5' AND T3.p_id = 331"
  },
  {
    "db_id": "computer_student",
    "question": "Which professor taught Level_500 courses?",
    "evidence": "",
    "SQL": "SELECT T2.p_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T1.courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "What are the general course levels of the courses taught by Professor p_id: 104?",
    "evidence": "",
    "SQL": "SELECT course.courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id WHERE taughtBy.p_id = 104"
  },
  {
    "db_id": "computer_student",
    "question": "Which courses are taught by professors who have not advised any students?",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.student = 0"
  },
  {
    "db_id": "computer_student",
    "question": "What is the highest level of course that the professor with ID 297 teaches?",
    "evidence": "",
    "SQL": "SELECT MAX(T1.courseLevel) FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 297"
  },
  {
    "db_id": "computer_student",
    "question": "What is the name of the course taught by the person who has advised the most students?",
    "evidence": "",
    "SQL": "SELECT T1.course_id, T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id GROUP BY T2.p_id ORDER BY COUNT(*) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are the names of the professors who advise students in Year_7?",
    "evidence": "",
    "SQL": "SELECT P.p_id, P.professor, P.student, P.hasPosition, P.inPhase, P.yearsInProgram FROM person P WHERE P.yearsInProgram = 'Year_7' AND P.student = 1 AND P.hasPosition = 0"
  },
  {
    "db_id": "computer_student",
    "question": "Which course is taught by a student?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id IN (SELECT p_id FROM person WHERE student = 1)"
  },
  {
    "db_id": "computer_student",
    "question": "Which students have more than one advisor?",
    "evidence": "",
    "SQL": "SELECT p.student FROM person AS p WHERE p.p_id IN (SELECT distinct p_id FROM advisedBy GROUP BY p_id HAVING COUNT(p_id_dummy) > 1)"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course ID of the course taught by the professor with the most number of students?",
    "evidence": "",
    "SQL": "SELECT T2.course_id FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id WHERE T1.student = 0 GROUP BY T2.course_id ORDER BY COUNT(T2.p_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the average course level of courses taught by professors who have students in Pre_Quals phase?",
    "evidence": "",
    "SQL": "SELECT AVG(courseLevel) FROM course, taughtBy, person WHERE taughtBy.p_id = person.p_id AND person.inPhase = 'Pre_Quals'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of courses taught by professors who have been teaching for more than 0 years?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T3.p_id = T2.p_id WHERE T3.yearsInProgram > '0'"
  },
  {
    "db_id": "computer_student",
    "question": "Which person has taught a course with a course id of 57?",
    "evidence": "",
    "SQL": "SELECT p_id FROM taughtBy WHERE course_id = '57'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the courseLevel of the courses taught by person with ID 426?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id IN (SELECT course_id FROM taughtBy WHERE p_id = 426)"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses that are taught by professors who have been advising at least one student and have been in the program for more than 2 years?",
    "evidence": "",
    "SQL": "SELECT DISTINCT T1.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.hasPosition = '1' AND T3.yearsInProgram = 'Year_3'"
  },
  {
    "db_id": "computer_student",
    "question": "Which course is taught by professor 72?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 72"
  },
  {
    "db_id": "computer_student",
    "question": "List the course IDs for all the courses taught by professor 180.",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy WHERE p_id = 180"
  },
  {
    "db_id": "computer_student",
    "question": "Which course is taught by a person who is not a professor?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id NOT IN (SELECT p_id FROM person WHERE professor = 1)"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are taught by professors who advise students in Phase 'Post_Generals'?",
    "evidence": "",
    "SQL": "SELECT T1.course_id, T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.hasPosition = '1' AND T3.inPhase = 'Post_Generals' ORDER BY T1.course_id"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of courses taught by professors with at least one student in their program?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the average number of courses a professor has taught?",
    "evidence": "",
    "SQL": "SELECT CAST(COUNT(course_id) AS REAL) / COUNT(DISTINCT p_id) AS avgnum FROM taughtBy"
  },
  {
    "db_id": "computer_student",
    "question": "How many courses with Level_500 are taught by Professor 12?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T1.courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of courses taught by all professors who have at least 5 years in program?",
    "evidence": "",
    "SQL": "SELECT COUNT(DISTINCT T1.course_id) FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.yearsInProgram > 'Year_5'"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by professors who are students of the course with ID 116?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM taughtBy AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.course_id = 116"
  },
  {
    "db_id": "computer_student",
    "question": "What courses is the professor with ID 342 teaching?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.p_id = 342"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of the course with the ID 161?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 161"
  },
  {
    "db_id": "computer_student",
    "question": "How many courses are taught by the same professor who is also a student?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T1.p_id IN (SELECT p_id FROM person WHERE student = 1)"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of the course taught by the most experienced teacher?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id ORDER BY T3.yearsInProgram DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the name of the course taught by professor with ID 46?",
    "evidence": "",
    "SQL": "SELECT course.courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id WHERE taughtBy.p_id = 46"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by a person who has a position?",
    "evidence": "",
    "SQL": "SELECT course.course_id, course.courseLevel FROM course JOIN taughtBy ON course.course_id = taughtBy.course_id JOIN person ON taughtBy.p_id = person.p_id WHERE person.hasPosition = '1'"
  },
  {
    "db_id": "computer_student",
    "question": "What are the IDs of the professors who have taught at least one course?",
    "evidence": "",
    "SQL": "SELECT T2.p_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id GROUP BY T2.p_id HAVING COUNT(T1.course_id) > 0"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of students in all levels across all courses?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the most frequently taught course level by a professor?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel, COUNT(T1.course_id) AS num_courses FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id GROUP BY T1.courseLevel ORDER BY num_courses DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course with the highest course ID?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = (SELECT MAX(course_id) FROM course)"
  },
  {
    "db_id": "computer_student",
    "question": "What are the IDs of the students who have been advised by a teacher who teaches a 'Level_500' course?",
    "evidence": "",
    "SQL": "SELECT P1.p_id FROM person AS P1 INNER JOIN advisedBy AS T1 ON P1.p_id = T1.p_id_dummy INNER JOIN taughtBy AS T2 ON T2.p_id = T1.p_id_dummy INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T3.courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "How many courses are taught by professors who have position of Professor?",
    "evidence": "",
    "SQL": "SELECT COUNT(T1.course_id) FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id IN (SELECT p_id FROM person WHERE hasPosition = 'Professor')"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of the course taught by the professor with the highest teaching experience?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id GROUP BY T1.course_id, T1.courseLevel ORDER BY T3.yearsInProgram DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "How many students are taught by professors who have taught undergraduate courses?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person AS T1 LEFT JOIN taughtBy AS T2 ON T1.p_id = T2.p_id WHERE T1.student = 1 AND T2.course_id IN (SELECT course_id FROM course WHERE courseLevel = 'Level_300')"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of students who are taught by a professor with courseLevel 'Level_500'?",
    "evidence": "",
    "SQL": "SELECT COUNT(T1.p_id) FROM taughtBy AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T1.p_id = T3.p_id WHERE T2.courseLevel = 'Level_500' AND T3.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "Which courses has professor with ID 84 taught?",
    "evidence": "",
    "SQL": "SELECT T1.course_id, T2.courseLevel FROM taughtBy AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T1.p_id = 84"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by the professors with at least two students?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id GROUP BY T1.course_id HAVING COUNT(T2.p_id) > 1"
  },
  {
    "db_id": "computer_student",
    "question": "Which students are currently teaching in their second year of the program?",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE student = 1 AND yearsInProgram = 2"
  },
  {
    "db_id": "computer_student",
    "question": "How many students have not chosen their professor yet?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) AS num_students FROM person WHERE professor = 0"
  },
  {
    "db_id": "computer_student",
    "question": "Which professors teach Level_500 courses?",
    "evidence": "",
    "SQL": "SELECT T1.p_id FROM taughtBy AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of courses taught by professors with a certain position in the faculty?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.hasPosition = '1'"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by the professors who have taught the most courses?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM taughtBy AS T1 JOIN (SELECT p_id, COUNT(*) as c FROM taughtBy GROUP BY p_id ORDER BY c DESC LIMIT 1) AS T2 ON T1.p_id = T2.p_id"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are taught by instructors who have been teaching for more than 5 years?",
    "evidence": "",
    "SQL": "SELECT course.course_id FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id INNER JOIN person ON taughtBy.p_id = person.p_id WHERE person.yearsInProgram > 'Year_5'"
  },
  {
    "db_id": "computer_student",
    "question": "What are the IDs of the courses taught by the professors who have students that have completed the phase of qualifications?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.hasPosition = 0 AND T2.inPhase != 0 GROUP BY T1.course_id"
  },
  {
    "db_id": "computer_student",
    "question": "Which advisor has advised the most students who are not students of this university?",
    "evidence": "",
    "SQL": "SELECT T1.p_id_dummy FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.student = 0 GROUP BY T1.p_id_dummy ORDER BY COUNT(T2.p_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are the course levels that have both a basic and a medium undergraduate level course?",
    "evidence": "",
    "SQL": "SELECT DISTINCT courseLevel FROM course WHERE courseLevel IN (SELECT courseLevel FROM course WHERE courseLevel = 'Level_300') AND courseLevel IN (SELECT courseLevel FROM course WHERE courseLevel = 'Level_400')"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are taught by professors who have also taught Level_500 courses?",
    "evidence": "",
    "SQL": "SELECT T2.course_id FROM taughtBy AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T1.p_id IN (SELECT p_id FROM taughtBy WHERE course_id = 141)"
  },
  {
    "db_id": "computer_student",
    "question": "What are the IDs of the professors who teach courses at Level_400?",
    "evidence": "",
    "SQL": "SELECT p_id FROM taughtBy INNER JOIN course ON taughtBy.course_id = course.course_id WHERE course.courseLevel = 'Level_400'"
  },
  {
    "db_id": "computer_student",
    "question": "Which professor advised the student with ID 121?",
    "evidence": "",
    "SQL": "SELECT T2.hasPosition, T1.p_id_dummy FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id_dummy = T2.p_id WHERE T1.p_id = 121"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are taught by a professor who is a faculty member and in phase 0?",
    "evidence": "",
    "SQL": "SELECT DISTINCT course.course_id FROM course JOIN taughtBy ON course.course_id = taughtBy.course_id JOIN person ON taughtBy.p_id = person.p_id WHERE person.hasPosition = 1 AND inPhase = 0"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of courses taught by faculty members who are in their Post-Generals phase and have been in the program for more than 5 years?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.professor = 1 AND T3.inPhase = 'Post_Generals' AND T3.yearsInProgram > 'Year_5'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of students advising professors who teach courses with course level Level_300?",
    "evidence": "",
    "SQL": "SELECT COUNT(DISTINCT T1.p_id) FROM person AS T1 INNER JOIN advisedBy AS T2 ON T1.p_id = T2.p_id INNER JOIN taughtBy AS T3 ON T3.p_id = T2.p_id_dummy INNER JOIN course AS T4 ON T3.course_id = T4.course_id WHERE T4.courseLevel = 'Level_300' AND T1.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the name of the course and its level that is taught by p_id 235?",
    "evidence": "",
    "SQL": "SELECT T1.course_id, T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 235"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of the course with the ID 44?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 44"
  },
  {
    "db_id": "computer_student",
    "question": "What courses does Professor 150 teach?",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy WHERE p_id = 150"
  },
  {
    "db_id": "computer_student",
    "question": "What are the levels of all courses taught by a student?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id IN (SELECT p_id FROM person WHERE student = 1)"
  },
  {
    "db_id": "computer_student",
    "question": "What is the list of courses taught by a student?",
    "evidence": "",
    "SQL": "SELECT T3.course_id, T3.courseLevel FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T1.course_id WHERE T2.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses that Professor 248 is teaching for students who are in Phase 0 and have 0 years of program?",
    "evidence": "",
    "SQL": "SELECT DISTINCT T1.course_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T1.course_id = T3.course_id WHERE T2.inPhase = '0' AND T2.yearsInProgram = '0' AND T1.p_id = 248"
  },
  {
    "db_id": "computer_student",
    "question": "What is the average years in program of the students who are advised by advisors in the phase Pre_Quals?",
    "evidence": "",
    "SQL": "SELECT AVG(yearsInProgram) FROM person AS T1 INNER JOIN advisedBy AS T2 ON T1.p_id = T2.p_id WHERE T1.inPhase = 'Pre_Quals' AND T1.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course taught by the professor who is also a student?",
    "evidence": "",
    "SQL": "SELECT T2.courseLevel FROM course AS T2 INNER JOIN taughtBy AS T3 ON T2.course_id = T3.course_id INNER JOIN person AS T1 ON T3.p_id = T1.p_id WHERE T1.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of the course with the highest number of professors teaching it?",
    "evidence": "",
    "SQL": "SELECT course.courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id GROUP BY course.course_id ORDER BY COUNT(taughtBy.p_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "Which faculty members teach more than one Level_500 course?",
    "evidence": "",
    "SQL": "SELECT DISTINCT T2.p_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T1.courseLevel = 'Level_500' GROUP BY T2.p_id HAVING COUNT(T2.p_id) > 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of students in all undergraduate courses?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id WHERE T2.course_id IN (SELECT course_id FROM course WHERE courseLevel LIKE 'Level_%') AND T1.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the year in program for the student in 'Post_Generals' phase?",
    "evidence": "",
    "SQL": "SELECT yearsInProgram FROM person WHERE inPhase = 'Post_Generals' AND student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the highest level of courses offered by the university?",
    "evidence": "",
    "SQL": "SELECT DISTINCT courseLevel FROM course ORDER BY CAST(courseLevel AS INTEGER) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of the course taught by the teacher with ID 394?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 394"
  },
  {
    "db_id": "computer_student",
    "question": "Who taught the course with ID 75?",
    "evidence": "",
    "SQL": "SELECT p_id FROM taughtBy WHERE course_id = 75"
  },
  {
    "db_id": "computer_student",
    "question": "What is the general course level of the most frequently taught course?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = (SELECT course_id FROM taughtBy GROUP BY course_id ORDER BY COUNT(course_id) DESC LIMIT 1)"
  },
  {
    "db_id": "computer_student",
    "question": "What are the course IDs of all courses taught by a professor who has also advised a student?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN advisedBy AS T3 ON T2.p_id = T3.p_id"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course with course ID 23?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 23"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by professors who have more than 5 years in the program?",
    "evidence": "",
    "SQL": "SELECT C.courseLevel FROM taughtBy AS T INNER JOIN course AS C ON T.course_id = C.course_id INNER JOIN person AS P ON T.p_id = P.p_id WHERE P.yearsInProgram > 5"
  },
  {
    "db_id": "computer_student",
    "question": "What courses has a person who is a professor and has more than 1 student advised by them?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM taughtBy AS T2 INNER JOIN course AS T1 ON T2.course_id = T1.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.student > 0 AND T3.professor = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course with ID 110?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 110"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses that professors with more than 1 course taught?",
    "evidence": "",
    "SQL": "SELECT T2.course_id FROM taughtBy AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_id HAVING COUNT(T1.course_id) > 1"
  },
  {
    "db_id": "computer_student",
    "question": "How many students are being advised by a faculty employee professor with more than 2 years of program?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T1.p_id_dummy IN (SELECT p_id FROM person WHERE hasPosition = 'Faculty_eme' AND yearsInProgram > '2')"
  },
  {
    "db_id": "computer_student",
    "question": "What is the average number of years in program for all students in Year_4",
    "evidence": "",
    "SQL": "SELECT AVG(yearsInProgram) FROM person WHERE inPhase = 'Post_Quals' AND student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "Which professors teach in a course that has been taught by more than one professor?",
    "evidence": "",
    "SQL": "SELECT DISTINCT T2.p_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id GROUP BY T1.course_id HAVING COUNT(T1.p_id) > 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level for the course with ID 2?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 2"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total count of students who have not completed their program yet and are taught by the professor with ID 138?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE yearsInProgram = 0 AND student = 1 AND p_id IN (SELECT p_id FROM taughtBy WHERE course_id IN (SELECT course_id FROM course WHERE courseLevel = 'Level_500'))"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of years of program for students in Year_4 or Year_5?",
    "evidence": "",
    "SQL": "SELECT SUM(yearsInProgram) FROM person WHERE yearsInProgram IN ('Year_4', 'Year_5') AND student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the average yearsInProgram of students who have a position?",
    "evidence": "",
    "SQL": "SELECT AVG(T2.yearsInProgram) FROM person AS T2 WHERE T2.hasPosition = '1'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of the course taught by professor with ID 5?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 5"
  },
  {
    "db_id": "computer_student",
    "question": "Who teaches course 156, and what is its level?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel, T2.p_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T1.course_id = 156"
  },
  {
    "db_id": "computer_student",
    "question": "What are the IDs of all professors who taught Level 400 courses?",
    "evidence": "",
    "SQL": "SELECT T1.p_id FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id WHERE T3.courseLevel = 'Level_400'"
  },
  {
    "db_id": "computer_student",
    "question": "How many students are taught by a professor who teaches a Level_400 course?",
    "evidence": "",
    "SQL": "SELECT COUNT(DISTINCT T2.p_id) FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T1.course_id = T3.course_id WHERE T3.courseLevel = 'Level_400' AND T2.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by the professors who advised the student with ID 108?",
    "evidence": "",
    "SQL": "SELECT C.course_id FROM taughtBy AS T1 INNER JOIN course AS C ON T1.course_id = C.course_id INNER JOIN advisedBy AS T2 ON T1.p_id = T2.p_id_dummy WHERE T2.p_id = 108"
  },
  {
    "db_id": "computer_student",
    "question": "What is the average years of program for all students in the 'Level_500' course level?",
    "evidence": "",
    "SQL": "SELECT AVG(yearsInProgram) FROM person p JOIN course c ON p.student = 1 AND p.inPhase = 0 AND c.courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of students and professors who are still in phase zero in the program?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE inPhase = '0'"
  },
  {
    "db_id": "computer_student",
    "question": "Which students are advised by '324' professor and have more than 4 years of program?",
    "evidence": "",
    "SQL": "SELECT T2.student FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id_dummy = T2.p_id WHERE T1.p_id = 324 AND T2.yearsInProgram > 'Year_4'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of the course taught by professor 351?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 351"
  },
  {
    "db_id": "computer_student",
    "question": "What is the highest level of the course that is taught by professor no.1?",
    "evidence": "",
    "SQL": "SELECT MAX(courseLevel) FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of students in the Phase 0 who have been in the program for 0 years?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person AS T1 WHERE T1.inPhase = '0' AND T1.yearsInProgram = '0' AND T1.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses taught by professors who have been in the program for less than 3 years?",
    "evidence": "",
    "SQL": "SELECT T3.course_id, T3.courseLevel FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T1.course_id WHERE T2.yearsInProgram < 'Year_3'"
  },
  {
    "db_id": "computer_student",
    "question": "Which students have taught 2 or more courses?",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE p_id IN (SELECT p_id FROM taughtBy GROUP BY p_id HAVING COUNT(*) >= 2) AND p_id NOT IN (SELECT p_id FROM course)"
  },
  {
    "db_id": "computer_student",
    "question": "What is the most frequent course level taught by professors with more than 1 year of experience in the program?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel, COUNT(T1.courseLevel) as frequency FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.yearsInProgram = 'Year_3' GROUP BY T1.courseLevel ORDER BY frequency DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What course does professor 331 teach?",
    "evidence": "",
    "SQL": "SELECT course.course_id, course.courseLevel FROM course JOIN taughtBy ON course.course_id = taughtBy.course_id WHERE taughtBy.p_id = 331"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of courses taught by the professor who has position '0'?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.hasPosition = '0'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level for courses taught by the professor with ID 214?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course NATURAL JOIN taughtBy WHERE course_id IN (SELECT course_id FROM taughtBy WHERE p_id = 214)"
  },
  {
    "db_id": "computer_student",
    "question": "How many courses are taught by a student?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM taughtBy WHERE p_id IN (SELECT p_id FROM person WHERE student = 1)"
  },
  {
    "db_id": "computer_student",
    "question": "What are the undergraduate course levels taught by professor 324?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 324 AND T1.courseLevel IN ('Level_300', 'Level_400')"
  },
  {
    "db_id": "computer_student",
    "question": "What is the ID of the student who has been in the Post-Quals phase for more than 2 years?",
    "evidence": "",
    "SQL": "SELECT T1.p_id FROM person AS T1 WHERE T1.inPhase = 'Post_Quals' AND T1.yearsInProgram = 'Year_2' OR T1.yearsInProgram = 'Year_3'"
  },
  {
    "db_id": "computer_student",
    "question": "Which students are advised by which professors in program Level_500? Provide the student ID and the professor ID.",
    "evidence": "",
    "SQL": "SELECT T1.p_id AS student_id, T2.p_id AS professor_id FROM person AS T1 INNER JOIN advisedBy AS T3 ON T1.p_id = T3.p_id INNER JOIN person AS T2 ON T2.p_id = T3.p_id_dummy WHERE T1.student = 1 AND T2.professor = 0"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of students in each level of the courses?",
    "evidence": "",
    "SQL": "SELECT course.courseLevel, COUNT(person.student) as total_students FROM course JOIN taughtBy ON course.course_id = taughtBy.course_id JOIN person ON taughtBy.p_id = person.p_id GROUP BY course.courseLevel"
  },
  {
    "db_id": "computer_student",
    "question": "What is the ID of the course that is taught by the professor with ID 107?",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy WHERE p_id = 107"
  },
  {
    "db_id": "computer_student",
    "question": "Which courses are taught by a professor from the faculty?",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.hasPosition = 'Faculty'"
  },
  {
    "db_id": "computer_student",
    "question": "How many courses were taught by professors with over 5 years of experience in the program?",
    "evidence": "",
    "SQL": "SELECT COUNT(DISTINCT course_id) FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.yearsInProgram > 5"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course ID and level of the course taught by the professor who has the most courses?",
    "evidence": "",
    "SQL": "SELECT T1.course_id, T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_id, T1.courseLevel ORDER BY COUNT(T1.course_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "Which professors teach Level_200 courses and have more than 5 years of experience?",
    "evidence": "",
    "SQL": "SELECT T2.p_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T3.p_id = T2.p_id WHERE T1.courseLevel = 'Level_200' AND (LENGTH(T3.yearsInProgram) - LENGTH(REPLACE(T3.yearsInProgram, ' ', ''))) > 5"
  },
  {
    "db_id": "computer_student",
    "question": "What is the name of the student who has been in the program for 6 years and has not yet got a professor?",
    "evidence": "",
    "SQL": "SELECT P.student FROM person P WHERE P.yearsInProgram = 'Year_6' AND P.hasPosition = 0"
  },
  {
    "db_id": "computer_student",
    "question": "What is the level of the course being taught by the professor with ID 364?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 364"
  },
  {
    "db_id": "computer_student",
    "question": "How many students has not finished their studies after being employed by faculty professors?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE yearsInProgram = 0 AND inPhase = 0 AND hasPosition = 'Faculty' AND professor = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are the names of the courses taught by a specific professor who is also a student?",
    "evidence": "",
    "SQL": "SELECT course.course_id, course.courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id INNER JOIN person ON taughtBy.p_id = person.p_id WHERE person.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course with the lowest course ID that has a level of Level_400 and is taught by a professor who is a faculty member?",
    "evidence": "",
    "SQL": "SELECT course_id FROM course WHERE courseLevel = 'Level_400' AND EXISTS (SELECT 1 FROM taughtBy WHERE course_id = taughtBy.course_id AND taughtBy.p_id IN (SELECT p_id FROM person WHERE professor = 1 AND hasPosition = 1)) ORDER BY course_id LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "Is a student who has been in the program for 3 years also a professor?",
    "evidence": "",
    "SQL": "SELECT student, yearsInProgram FROM person WHERE yearsInProgram = 3 AND student = 0"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course with id 74?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 74"
  },
  {
    "db_id": "computer_student",
    "question": "Which students are advised by professors having the most years of experience in the program?",
    "evidence": "",
    "SQL": "SELECT T2.p_id FROM person AS T1 INNER JOIN advisedBy AS T2 ON T1.p_id = T2.p_id GROUP BY T2.p_id HAVING (SELECT COUNT(T1.yearsInProgram) FROM person AS T1 WHERE T1.p_id = T2.p_id) ORDER BY (SELECT COUNT(T1.yearsInProgram) FROM person AS T1 WHERE T1.p_id = T2.p_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course taught by Professor with ID 211?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 211"
  },
  {
    "db_id": "computer_student",
    "question": "How many courses has a student who has been in the program for more than 3 years and in the post-qual phase taught?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id WHERE T1.student = 1 AND T1.yearsInProgram = 'Year_4' AND T1.inPhase = 'Post_Quals'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the minimum and maximum number of years in program among students?",
    "evidence": "",
    "SQL": "SELECT MIN(yearsInProgram), MAX(yearsInProgram) FROM person WHERE student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "Which students are being advised by advisors who have been in the program for more than 3 years?",
    "evidence": "",
    "SQL": "SELECT T2.p_id FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.yearsInProgram > 3"
  },
  {
    "db_id": "computer_student",
    "question": "Who are the professors that teach a course with a courseLevel of 'Level_500'?",
    "evidence": "",
    "SQL": "SELECT T2.p_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T1.courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "What are all the courses that are not taught by professor `240`?",
    "evidence": "",
    "SQL": "SELECT course_id FROM course WHERE course_id NOT IN (SELECT course_id FROM taughtBy WHERE p_id = 240)"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are taught by professors who have position of 'Professor' and are in 'Pre_Quals' phase?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.hasPosition = 'Professor' AND T2.inPhase = 'Pre_Quals'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of students in the 0-year in Phase 0?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE inPhase = '0' AND yearsInProgram = '0' AND student = '1'"
  },
  {
    "db_id": "computer_student",
    "question": "Who are the students advised by the professor who teaches a course with the course ID 49?",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE p_id IN (SELECT p_id FROM taughtBy WHERE course_id = 49) AND student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of students currently enrolled in the Pre_Quals phase?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE inPhase = 'Pre_Quals' AND student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of course with id 91?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 91"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of advisors who are affiliated to a course in 'Level_500'?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person AS T1 INNER JOIN advisedBy AS T2 ON T1.p_id = T2.p_id INNER JOIN taughtBy AS T3 ON T2.p_id = T3.p_id INNER JOIN course AS T4 ON T3.course_id = T4.course_id WHERE T1.hasPosition = 'Faculty_aff' AND T4.courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "Which course has the highest level of difficulty among courses taught by professors who have been in the program for at least 7 years?",
    "evidence": "",
    "SQL": "SELECT T1.course_id, T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS P ON T2.p_id = P.p_id WHERE P.yearsInProgram = 'Year_7' GROUP BY T1.course_id ORDER BY T1.courseLevel DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "Which person is teaching the course with course_id `86`?",
    "evidence": "",
    "SQL": "SELECT p_id FROM taughtBy WHERE course_id = 86"
  },
  {
    "db_id": "computer_student",
    "question": "What is the most recent year in program for a student who teaches the most courses?",
    "evidence": "",
    "SQL": "SELECT DISTINCT yearsInProgram FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id GROUP BY yearsInProgram ORDER BY COUNT(T2.course_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "Which students are taught by professors with more than one course taught?",
    "evidence": "",
    "SQL": "SELECT T1.p_id, T1.yearsInProgram FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id GROUP BY T1.p_id, T1.yearsInProgram HAVING COUNT(DISTINCT T3.course_id) > 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are the IDs of the courses taught by professor with ID 150?",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy WHERE p_id = 150"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of students who are in the 'Pre_Quals' phase?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE inPhase = 'Pre_Quals'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the courseLevel of the course with course_id 172?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 172"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course with id 147?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 147"
  },
  {
    "db_id": "computer_student",
    "question": "What are the names of all students who are taught by a teacher who teaches a Level_400 course?",
    "evidence": "",
    "SQL": "SELECT T2.p_id FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id WHERE T2.course_id IN (SELECT course_id FROM course WHERE courseLevel = 'Level_400') AND T1.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course taught by the person with id 165?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 165"
  },
  {
    "db_id": "computer_student",
    "question": "What is the most common course level among all courses?",
    "evidence": "",
    "SQL": "SELECT courseLevel, COUNT(*) AS count FROM course GROUP BY courseLevel ORDER BY count DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are the total number of students in 'Level_500' courses?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person AS T1 INNER JOIN course AS T2 ON T1.student = 1 AND T2.courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the ID of the course that is taught by professor with ID 101?",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy WHERE p_id = 101"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of professors who teach at least one Level_500 course?",
    "evidence": "",
    "SQL": "SELECT COUNT(DISTINCT T1.p_id) FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id WHERE T3.courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "What courses were taught by a professor who has more than 5 years of experience in the program?",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy INNER JOIN person ON taughtBy.p_id = person.p_id WHERE person.yearsInProgram > 'Year_5'"
  },
  {
    "db_id": "computer_student",
    "question": "What are the levels of undergraduate courses taught by the faculty professor with person ID 335?",
    "evidence": "",
    "SQL": "SELECT T3.courseLevel FROM course AS T3 INNER JOIN taughtBy AS T2 ON T3.course_id = T2.course_id INNER JOIN person AS T1 ON T2.p_id = T1.p_id WHERE T1.p_id = 335"
  },
  {
    "db_id": "computer_student",
    "question": "Which students are in pre-qualification phase and are advised by a professor who teaches courses with level 300?",
    "evidence": "",
    "SQL": "SELECT T1.p_id, T2.p_id_dummy FROM person AS T1 INNER JOIN advisedBy AS T2 ON T1.p_id = T2.p_id_dummy WHERE T1.inPhase = 'Pre_Quals' AND T2.p_id IN (SELECT p_id FROM taughtBy AS T3 INNER JOIN course AS T4 ON T3.course_id = T4.course_id WHERE T4.courseLevel = 'Level_300')"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of courses taught by professors having more than 1 advisor?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN advisedBy AS T3 ON T2.p_id = T3.p_id GROUP BY T2.p_id HAVING COUNT(T3.p_id) > 1"
  },
  {
    "db_id": "computer_student",
    "question": "Which course has more teachers?",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy GROUP BY course_id ORDER BY COUNT(course_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of students enrolled in the Year_3 program?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE yearsInProgram = 'Year_3' AND student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "How many students in postquals phase are currently not in a position?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE hasPosition = 0 AND inPhase = 'Post_Quals'"
  },
  {
    "db_id": "computer_student",
    "question": "What are the total number of courses taught by the professor with ID 394?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM taughtBy WHERE p_id = 394"
  },
  {
    "db_id": "computer_student",
    "question": "What is the most common course level taught by a professor?",
    "evidence": "",
    "SQL": "SELECT T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id GROUP BY T1.courseLevel ORDER BY COUNT(T2.course_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are all the course IDs taught by faculty members?",
    "evidence": "",
    "SQL": "SELECT T2.course_id FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id WHERE T1.hasPosition = 'Faculty'"
  },
  {
    "db_id": "computer_student",
    "question": "What are the names of all the faculty employees who have taught in courses with Level_400?",
    "evidence": "",
    "SQL": "SELECT T2.p_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T3.p_id = T2.p_id WHERE T1.courseLevel = 'Level_400' AND T3.hasPosition = 'Faculty_eme'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course with the most teachers?",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy GROUP BY course_id ORDER BY COUNT(course_id) DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of students in Phase Post_Generals?",
    "evidence": "",
    "SQL": "SELECT COUNT(student) FROM person WHERE inPhase = 'Post_Generals'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the list of students who have not taken a course with more than 3 teachers?",
    "evidence": "",
    "SQL": "SELECT * FROM person WHERE p_id NOT IN (SELECT p_id FROM taughtBy GROUP BY p_id HAVING COUNT(DISTINCT course_id) > 3)"
  },
  {
    "db_id": "computer_student",
    "question": "Which courses are taught by professors who have been in the program for at least 3 years?",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.hasPosition = 0 AND T2.yearsInProgram LIKE '%Year_%' ORDER BY course_id"
  },
  {
    "db_id": "computer_student",
    "question": "What is the years in program for students advised by a professor teaching a basic undergraduate course?",
    "evidence": "",
    "SQL": "SELECT yearsInProgram FROM person AS T1 INNER JOIN advisedBy AS T2 ON T1.p_id = T2.p_id INNER JOIN taughtBy AS T3 ON T3.p_id = T1.p_id INNER JOIN course AS T4 ON T3.course_id = T4.course_id WHERE T4.courseLevel = 'Level_300'"
  },
  {
    "db_id": "computer_student",
    "question": "Which person teaches courses with level 400 or above?",
    "evidence": "",
    "SQL": "SELECT P1.p_id FROM person AS P1 INNER JOIN taughtBy AS T1 ON P1.p_id = T1.p_id INNER JOIN course AS C1 ON T1.course_id = C1.course_id WHERE C1.courseLevel >= 'Level_400'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the ID of the student who has been in a program for the longest time among all the students in the 'Post_Quals' phase?",
    "evidence": "",
    "SQL": "SELECT p_id, MAX(yearsInProgram) FROM person WHERE inPhase='Post_Quals' GROUP BY p_id"
  },
  {
    "db_id": "computer_student",
    "question": "List the IDs of all students who are being advised by a professor having at least one year of experience in the program.",
    "evidence": "",
    "SQL": "SELECT T2.p_id FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.yearsInProgram > '0' AND T2.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are the names of all the courses that have no instructor?",
    "evidence": "",
    "SQL": "SELECT course_id FROM course WHERE course_id NOT IN (SELECT course_id FROM taughtBy)"
  },
  {
    "db_id": "computer_student",
    "question": "What are the professors who teach the most basic undergraduate courses and their general course levels?",
    "evidence": "",
    "SQL": "SELECT T1.p_id, T3.courseLevel FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id WHERE T3.courseLevel = 'Level_300' GROUP BY T1.p_id ORDER BY COUNT(T2.course_id) DESC"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course with ID 16?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 16"
  },
  {
    "db_id": "computer_student",
    "question": "What is the most common year in the program among all students?",
    "evidence": "",
    "SQL": "SELECT COUNT(DISTINCT yearsInProgram) AS count FROM person WHERE student = 1 GROUP BY yearsInProgram ORDER BY count DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level for the course with the highest course ID?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = (SELECT MAX(course_id) FROM course)"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of professors and students in the database?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE professor = 0 OR professor = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are the courses that were not taught by a professor with at least 5 years of program involvement?",
    "evidence": "",
    "SQL": "SELECT DISTINCT T1.course_id FROM course AS T1 LEFT JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id IS NULL OR (SELECT COUNT(*) FROM person WHERE yearsInProgram >= 5) <= 0"
  },
  {
    "db_id": "computer_student",
    "question": "What course is taught by a professor from 'Faculty_aff' having 7 years of experience in the program?",
    "evidence": "",
    "SQL": "SELECT T3.course_id, T3.courseLevel FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T1.course_id WHERE T2.hasPosition = 'Faculty_aff' AND T2.yearsInProgram = 'Year_7'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course ID of the 'Level_500' course?",
    "evidence": "",
    "SQL": "SELECT course_id FROM course WHERE courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course ID of a medium undergraduate course taught by a student who has not taken a position?",
    "evidence": "",
    "SQL": "SELECT T2.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T3.p_id = T2.p_id WHERE T1.courseLevel = 'Level_300' AND T3.hasPosition = '0'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of courses taught by each professor?",
    "evidence": "",
    "SQL": "SELECT T2.p_id, COUNT(T1.course_id) FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id GROUP BY T2.p_id"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of courses offered by all professors?",
    "evidence": "",
    "SQL": "SELECT COUNT(DISTINCT T1.course_id) FROM course AS T1 JOIN taughtBy AS T2 ON T1.course_id = T2.course_id"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are taught by the professors who are not part of a master's/graduate program?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T1.courseLevel NOT LIKE 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of courses taught by professors with 'Pre_Quals' as their phase?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.inPhase = 'Pre_Quals'"
  },
  {
    "db_id": "computer_student",
    "question": "Who taught the Level_400 course with ID less than 10 and has the highest professor ID?",
    "evidence": "",
    "SQL": "SELECT T1.p_id, T1.hasPosition FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id WHERE T3.courseLevel = 'Level_400' AND T2.course_id < 10 ORDER BY T1.p_id DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are the total number of courses taught by a person who has been a professor in the past?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.hasPosition = 'Professor'"
  },
  {
    "db_id": "computer_student",
    "question": "Which students have advisors who have taught at least one course for students in their same phase?",
    "evidence": "",
    "SQL": "SELECT P1.p_id FROM person AS P1 INNER JOIN advisedBy AS AB ON P1.p_id = AB.p_id_dummy INNER JOIN taughtBy AS TB ON AB.p_id = TB.p_id INNER JOIN person AS P2 ON TB.p_id = P2.p_id WHERE P2.inPhase = P1.inPhase AND P2.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total number of courses taught by professors who are in the faculty position and have taught more than one course?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.hasPosition = 'Faculty' GROUP BY T2.p_id HAVING COUNT(T1.course_id) > 1"
  },
  {
    "db_id": "computer_student",
    "question": "How many students have been advised by a professor who taught a course at Level_400 or above?",
    "evidence": "",
    "SQL": "SELECT COUNT(DISTINCT T1.p_id) FROM person AS T1 INNER JOIN advisedBy AS T2 ON T1.p_id = T2.p_id_dummy INNER JOIN taughtBy AS T3 ON T2.p_id = T3.p_id INNER JOIN course AS T4 ON T3.course_id = T4.course_id WHERE T4.courseLevel = 'Level_400' AND T1.student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "Which students have been advised by professors who have taught a master's level course?",
    "evidence": "",
    "SQL": "SELECT T1.p_id FROM person AS T1 INNER JOIN advisedBy AS T2 ON T1.p_id = T2.p_id_dummy INNER JOIN taughtBy AS T3 ON T2.p_id = T3.p_id INNER JOIN course AS T4 ON T3.course_id = T4.course_id WHERE T4.courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "In total, all the students in the 'Level_500' course are taught by how many professors?",
    "evidence": "",
    "SQL": "SELECT COUNT(DISTINCT T1.p_id) FROM taughtBy AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "Which professor has taught the most courses?",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE p_id IN (SELECT p_id FROM taughtBy GROUP BY p_id ORDER BY COUNT(p_id) DESC LIMIT 1) ORDER BY p_id"
  },
  {
    "db_id": "computer_student",
    "question": "What courses are not taught by the advisors who gave advice to a student with ID 205?",
    "evidence": "",
    "SQL": "SELECT C.course_id FROM course C LEFT JOIN taughtBy T ON C.course_id = T.course_id LEFT JOIN advisedBy A ON T.p_id = A.p_id WHERE A.p_id IS NULL"
  },
  {
    "db_id": "computer_student",
    "question": "List all courses that were not taught by Professor 324.",
    "evidence": "",
    "SQL": "SELECT * FROM course WHERE course_id NOT IN (SELECT course_id FROM taughtBy WHERE p_id = 324)"
  },
  {
    "db_id": "computer_student",
    "question": "What is the ID of the student who is advised by a professor who teaches a Level_500 course?",
    "evidence": "",
    "SQL": "SELECT T1.p_id FROM advisedBy AS T1 INNER JOIN course AS T2 ON T1.p_id = T2.course_id INNER JOIN taughtBy AS T3 ON T2.course_id = T3.course_id WHERE T3.p_id IS NOT NULL AND T2.courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "What are the undergraduate courses taught by faculty employees?",
    "evidence": "",
    "SQL": "SELECT T3.course_id, T3.courseLevel FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T1.course_id WHERE T2.hasPosition = 'Faculty'"
  },
  {
    "db_id": "computer_student",
    "question": "Which students are taught by professors who have taught at Level_300 or Level_400 courses?",
    "evidence": "",
    "SQL": "SELECT T2.student FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T1.course_id = T3.course_id WHERE T3.courseLevel IN ('Level_300', 'Level_400')"
  },
  {
    "db_id": "computer_student",
    "question": "What is the total count of students in the 'Level_500' course level who are not advised by any faculty professor?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person AS T1 INNER JOIN course AS T2 ON T1.hasPosition <> 0 WHERE T2.courseLevel = 'Level_500' AND T1.p_id NOT IN (SELECT p_id FROM advisedBy)"
  },
  {
    "db_id": "computer_student",
    "question": "How many students are there?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE student = 1"
  },
  {
    "db_id": "computer_student",
    "question": "Which courses are taught by professors who are not students and are in the post-qualifications phase?",
    "evidence": "",
    "SQL": "SELECT * FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.student = 0 AND T2.inPhase = 'Post_Quals'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the ID of the course taught by the professor who advised student no.373?",
    "evidence": "",
    "SQL": "SELECT T2.course_id FROM taughtBy AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id INNER JOIN advisedBy AS T3 ON T3.p_id = T1.p_id WHERE T3.p_id_dummy = 211"
  },
  {
    "db_id": "computer_student",
    "question": "Which professors teach a course that is not a professional course?",
    "evidence": "",
    "SQL": "SELECT p_id FROM taughtBy AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.courseLevel != 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the ID of the course that has most students?",
    "evidence": "",
    "SQL": "SELECT course_id, COUNT(*) as student_count FROM taughtBy GROUP BY course_id ORDER BY student_count DESC LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "What are the advisors who teach courses at level 400?",
    "evidence": "",
    "SQL": "SELECT T1.p_id FROM taughtBy AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.courseLevel = 'Level_400'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the list of courses taught by professor with ID 18?",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy WHERE p_id = 18"
  },
  {
    "db_id": "computer_student",
    "question": "Which students are studying in the Post_Generals phase?",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE inPhase = 'Post_Generals'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the name of the student who has been in the program for 0 years?",
    "evidence": "",
    "SQL": "SELECT * FROM person WHERE inPhase='0' AND student='1'"
  },
  {
    "db_id": "computer_student",
    "question": "What are the IDs of the students who have had advisors in their first year of the program?",
    "evidence": "",
    "SQL": "SELECT T2.p_id FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.yearsInProgram = 'Year_1'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the average number of years in program for students who have not yet held a position?",
    "evidence": "",
    "SQL": "SELECT AVG(yearsInProgram) FROM person WHERE student = 1 AND hasPosition = '0'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level of the course with course ID 71?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 71"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of courses with course level 'Level_500'?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM course WHERE courseLevel = 'Level_500'"
  },
  {
    "db_id": "computer_student",
    "question": "What course is taught by Professor 394?",
    "evidence": "",
    "SQL": "SELECT T1.course_id FROM taughtBy AS T1 WHERE T1.p_id = 394"
  },
  {
    "db_id": "computer_student",
    "question": "What is the ID of the person who teaches the 'Level_400' course?",
    "evidence": "",
    "SQL": "SELECT T2.p_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T1.courseLevel = 'Level_400'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course level for course no.97?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course WHERE course_id = 97"
  },
  {
    "db_id": "computer_student",
    "question": "Who are the students of the course with ID 144?",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE student = 1 AND NOT EXISTS (SELECT * FROM taughtBy WHERE course_id = 144 AND p_id = person.p_id)"
  },
  {
    "db_id": "computer_student",
    "question": "What is the average level of the courses taught by professors who have 'Faculty' as their position?",
    "evidence": "",
    "SQL": "SELECT AVG(courseLevel) FROM course JOIN taughtBy ON course.course_id = taughtBy.course_id JOIN person ON taughtBy.p_id = person.p_id WHERE person.hasPosition = 'Faculty'"
  },
  {
    "db_id": "computer_student",
    "question": "What course with ID less than 10 was taught by Professor 150?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id WHERE course.course_id < 10 AND taughtBy.p_id = 150"
  },
  {
    "db_id": "computer_student",
    "question": "Who is the student who has been in the program for four years and advised by Professor 72?",
    "evidence": "",
    "SQL": "SELECT p_id FROM person WHERE yearsInProgram = 'Year_4' AND inPhase = 'Post_Quals' AND student = 1 AND (SELECT COUNT(*) FROM advisedBy WHERE p_id_dummy = p_id AND p_id = 72) > 0"
  },
  {
    "db_id": "computer_student",
    "question": "what courses are taught by professor with p_id 373?",
    "evidence": "",
    "SQL": "SELECT * FROM taughtBy WHERE p_id = 373"
  },
  {
    "db_id": "computer_student",
    "question": "How many students of a given professor have never taught a course?",
    "evidence": "",
    "SQL": "SELECT COUNT(DISTINCT T1.p_id) FROM person AS T1 LEFT JOIN taughtBy AS T2 ON T1.p_id = T2.p_id WHERE T2.p_id IS NULL AND T1.professor = 1"
  },
  {
    "db_id": "computer_student",
    "question": "What is the course with the least amount of teachers?",
    "evidence": "",
    "SQL": "SELECT course_id FROM taughtBy GROUP BY course_id ORDER BY COUNT(course_id) LIMIT 1"
  },
  {
    "db_id": "computer_student",
    "question": "Who taught course 125?",
    "evidence": "",
    "SQL": "SELECT P.p_id FROM taughtBy AS T1 INNER JOIN person AS P ON T1.p_id = P.p_id WHERE T1.course_id = 125"
  },
  {
    "db_id": "computer_student",
    "question": "What is the number of students in the Pre_Quals phase?",
    "evidence": "",
    "SQL": "SELECT COUNT(*) FROM person WHERE inPhase = 'Pre_Quals'"
  },
  {
    "db_id": "computer_student",
    "question": "What are the course levels of the courses that are taught by a professor who has advised another professor to teach?",
    "evidence": "",
    "SQL": "SELECT courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id WHERE taughtBy.p_id IN (SELECT p_id_dummy FROM advisedBy)"
  },
  {
    "db_id": "computer_student",
    "question": "Which students are being advised by professors who have taught more than 2 courses?",
    "evidence": "",
    "SQL": "SELECT P.student FROM person AS P INNER JOIN advisedBy AS AB ON P.p_id = AB.p_id INNER JOIN taughtBy AS TB ON TB.p_id = P.p_id GROUP BY P.student HAVING COUNT(TB.course_id) > 2"
  },
  {
    "db_id": "computer_student",
    "question": "What are all the courses taught by a professor?",
    "evidence": "",
    "SQL": "SELECT course.course_id, course.courseLevel FROM course INNER JOIN taughtBy ON course.course_id = taughtBy.course_id"
  },
  {
    "db_id": "computer_student",
    "question": "What courses have students in phase Post_Quals?",
    "evidence": "",
    "SQL": "SELECT T2.course_id FROM taughtBy AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T1.p_id = T3.p_id WHERE T3.inPhase = 'Post_Quals'"
  },
  {
    "db_id": "computer_student",
    "question": "What is the name of the professor who teaches the most Level_500 courses?",
    "evidence": "",
    "SQL": "SELECT T1.p_id, T3.courseLevel FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id WHERE T3.courseLevel = 'Level_500' GROUP BY T1.p_id ORDER BY COUNT(T2.course_id) DESC LIMIT 1"
  }
]