1sf/bird-sql-train-with-schema huggingface dataset:
Database: cs_semester
Tables: course, prof, RA, registration, student
Columns (table index, column name): -1, *, 0, course_id, 0, name, 0, credit, 0, diff, 1, prof_id, 1, gender, 1, first_name, 1, last_name, 1, email, 1, popularity, 1, teachingability, 1, graduate_from, 2, student_id, 2, capability, 2, prof_id, 2, salary, 3, course_id, 3, student_id, 3, grade, 3, sat, 4, student_id, 4, f_name, 4, l_name, 4, phone_number, 4, email, 4, intelligence, 4, gpa, 4, type
Question: Which student has the highest gpa? Give the full name.
Evidence: GPA is an abbreviated name of Grade Point Average where highest GPA = MAX(gpa); full name refers to f_name and l_name;
SQL: SELECT f_name, l_name FROM student WHERE gpa = ( SELECT MAX(gpa) FROM student )
Database: cs_semester
Tables: course, prof, RA, registration, student
Columns (table index, column name): -1, *, 0, course_id, 0, name, 0, credit, 0, diff, 1, prof_id, 1, gender, 1, first_name, 1, last_name, 1, email, 1, popularity, 1, teachingability, 1, graduate_from, 2, student_id, 2, capability, 2, prof_id, 2, salary, 3, course_id, 3, student_id, 3, grade, 3, sat, 4, student_id, 4, f_name, 4, l_name, 4, phone_number, 4, email, 4, intelligence, 4, gpa, 4, type
Question: For the 3-credit course with the easiest difficulty, how many students get an "A" in that course?
Evidence: diff refers to difficulty; diff is higher means the course is more difficult in which easiest difficulty refers to diff = 1; 3-credit course refers to credit = '3'; get an "A" refers to grade = 'A' for the course;
SQL: SELECT COUNT(T1.student_id) FROM registration AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T1.grade = 'A' AND T2.credit = '3' AND T2.diff = 1
Database: cs_semester
Tables: course, prof, RA, registration, student
Columns (table index, column name): -1, *, 0, course_id, 0, name, 0, credit, 0, diff, 1, prof_id, 1, gender, 1, first_name, 1, last_name, 1, email, 1, popularity, 1, teachingability, 1, graduate_from, 2, student_id, 2, capability, 2, prof_id, 2, salary, 3, course_id, 3, student_id, 3, grade, 3, sat, 4, student_id, 4, f_name, 4, l_name, 4, phone_number, 4, email, 4, intelligence, 4, gpa, 4, type
Question: How many students took the hardest course?
Evidence: diff refers to difficulty; diff is higher means the course is more difficult in which hardest difficulty is expressed as diff = 5;
SQL: SELECT COUNT(T1.student_id) FROM registration AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.diff = 5
Database: cs_semester
Tables: course, prof, RA, registration, student
Columns (table index, column name): -1, *, 0, course_id, 0, name, 0, credit, 0, diff, 1, prof_id, 1, gender, 1, first_name, 1, last_name, 1, email, 1, popularity, 1, teachingability, 1, graduate_from, 2, student_id, 2, capability, 2, prof_id, 2, salary, 3, course_id, 3, student_id, 3, grade, 3, sat, 4, student_id, 4, f_name, 4, l_name, 4, phone_number, 4, email, 4, intelligence, 4, gpa, 4, type
Question: Which professor is Oliy Spratling working with? Give the full name.
Evidence: research assistant refers to the student who serves for research where the abbreviation is RA; full name refers to f_name and l_name;
SQL: SELECT T1.first_name, T1.last_name FROM prof AS T1 INNER JOIN RA AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T2.student_id = T3.student_id WHERE T3.f_name = 'Oliy' AND T3.l_name = 'Spratling'
Database: cs_semester
Tables: course, prof, RA, registration, student
Columns (table index, column name): -1, *, 0, course_id, 0, name, 0, credit, 0, diff, 1, prof_id, 1, gender, 1, first_name, 1, last_name, 1, email, 1, popularity, 1, teachingability, 1, graduate_from, 2, student_id, 2, capability, 2, prof_id, 2, salary, 3, course_id, 3, student_id, 3, grade, 3, sat, 4, student_id, 4, f_name, 4, l_name, 4, phone_number, 4, email, 4, intelligence, 4, gpa, 4, type
Question: For the professor who is working with Harrietta Lydford, how is his popularity?
Evidence: research assistant refers to the student who serves for research where the abbreviation is RA; higher popularity means more popular; prof_id refers to professor’s ID;
SQL: SELECT T1.popularity FROM prof AS T1 INNER JOIN RA AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T2.student_id = T3.student_id WHERE T3.f_name = 'Harrietta' AND T3.l_name = 'Lydford'
Database: cs_semester
Tables: course, prof, RA, registration, student
Columns (table index, column name): -1, *, 0, course_id, 0, name, 0, credit, 0, diff, 1, prof_id, 1, gender, 1, first_name, 1, last_name, 1, email, 1, popularity, 1, teachingability, 1, graduate_from, 2, student_id, 2, capability, 2, prof_id, 2, salary, 3, course_id, 3, student_id, 3, grade, 3, sat, 4, student_id, 4, f_name, 4, l_name, 4, phone_number, 4, email, 4, intelligence, 4, gpa, 4, type
Question: How many research assistants does the female professor with the lowest teaching ability have?
Evidence: research assistant refers to the student who serves for research where the abbreviation is RA; professor with the lowest teaching ability refers to prof_id where teachability = '1';
SQL: SELECT COUNT(T1.student_id) FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id WHERE T2.teachingability = '1' AND T2.gender = 'Female'
Database: cs_semester
Tables: course, prof, RA, registration, student
Columns (table index, column name): -1, *, 0, course_id, 0, name, 0, credit, 0, diff, 1, prof_id, 1, gender, 1, first_name, 1, last_name, 1, email, 1, popularity, 1, teachingability, 1, graduate_from, 2, student_id, 2, capability, 2, prof_id, 2, salary, 3, course_id, 3, student_id, 3, grade, 3, sat, 4, student_id, 4, f_name, 4, l_name, 4, phone_number, 4, email, 4, intelligence, 4, gpa, 4, type
Question: For the professors who advise more than 2 students, which professor has a higher teaching ability? Give the full name.
Evidence: professor advising more than 2 students refers to COUNT(student_id) > 2; higher teachability refers to MAX(teachingability); full name refers to f_name and l_name;
SQL: SELECT T.first_name, T.last_name FROM ( SELECT T2.first_name, T2.last_name, T2.teachingability FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id GROUP BY T1.prof_id HAVING COUNT(student_id) > 2 ) T ORDER BY T.teachingability DESC LIMIT 1
Database: cs_semester
Tables: course, prof, RA, registration, student
Columns (table index, column name): -1, *, 0, course_id, 0, name, 0, credit, 0, diff, 1, prof_id, 1, gender, 1, first_name, 1, last_name, 1, email, 1, popularity, 1, teachingability, 1, graduate_from, 2, student_id, 2, capability, 2, prof_id, 2, salary, 3, course_id, 3, student_id, 3, grade, 3, sat, 4, student_id, 4, f_name, 4, l_name, 4, phone_number, 4, email, 4, intelligence, 4, gpa, 4, type
Question: Give the grade score for Rik Unsworth in "Computer Network".
Evidence: Academic grades awarded for participation in a course are A, B, C, D and F where Grade 'A' means excellent, Grade 'B' means good, Grade 'C' means fair, Grade 'D' means poorly pass, if grade is null or empty, it means that this student fails to pass this course in which grade = NULL;
SQL: SELECT CASE grade WHEN 'A' THEN 4 WHEN 'B' THEN 3 WHEN 'C' THEN 2 ELSE 1 END AS result FROM registration WHERE student_id IN ( SELECT student_id FROM student WHERE f_name = 'Rik' AND l_name = 'Unsworth' AND course_id IN ( SELECT course_id FROM course WHERE name = 'Computer Network' ) )
Database: cs_semester
Tables: course, prof, RA, registration, student
Columns (table index, column name): -1, *, 0, course_id, 0, name, 0, credit, 0, diff, 1, prof_id, 1, gender, 1, first_name, 1, last_name, 1, email, 1, popularity, 1, teachingability, 1, graduate_from, 2, student_id, 2, capability, 2, prof_id, 2, salary, 3, course_id, 3, student_id, 3, grade, 3, sat, 4, student_id, 4, f_name, 4, l_name, 4, phone_number, 4, email, 4, intelligence, 4, gpa, 4, type
Question: How many courses does Alvera McQuillin take?
SQL: SELECT COUNT(T1.course_id) FROM registration AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id WHERE T2.f_name = 'Alvera' AND T2.l_name = 'McQuillin'
Database: cs_semester
Tables: course, prof, RA, registration, student
Columns (table index, column name): -1, *, 0, course_id, 0, name, 0, credit, 0, diff, 1, prof_id, 1, gender, 1, first_name, 1, last_name, 1, email, 1, popularity, 1, teachingability, 1, graduate_from, 2, student_id, 2, capability, 2, prof_id, 2, salary, 3, course_id, 3, student_id, 3, grade, 3, sat, 4, student_id, 4, f_name, 4, l_name, 4, phone_number, 4, email, 4, intelligence, 4, gpa, 4, type
Question: State the name of research postgraduate student among Professor Zhihua Zhou's research assistants.
Evidence: research postgraduate student refers to type = 'RPG'; research assistant refers to the student who serves for research where the abbreviation is RA;
SQL: SELECT T3.f_name, T3.l_name FROM prof AS T1 INNER JOIN RA AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T2.student_id = T3.student_id WHERE T1.first_name = 'Zhihua' AND T3.type = 'RPG' AND T1.last_name = 'Zhou'
Database: cs_semester
Tables: course, prof, RA, registration, student
Columns (table index, column name): -1, *, 0, course_id, 0, name, 0, credit, 0, diff, 1, prof_id, 1, gender, 1, first_name, 1, last_name, 1, email, 1, popularity, 1, teachingability, 1, graduate_from, 2, student_id, 2, capability, 2, prof_id, 2, salary, 3, course_id, 3, student_id, 3, grade, 3, sat, 4, student_id, 4, f_name, 4, l_name, 4, phone_number, 4, email, 4, intelligence, 4, gpa, 4, type
Question: Provide the number of students enrolled in the "Statistical Learning" course.
SQL: SELECT COUNT(T2.student_id) FROM course AS T1 INNER JOIN registration AS T2 ON T1.course_id = T2.course_id WHERE T1.name = 'Statistical learning'
Database: cs_semester
Tables: course, prof, RA, registration, student
Columns (table index, column name): -1, *, 0, course_id, 0, name, 0, credit, 0, diff, 1, prof_id, 1, gender, 1, first_name, 1, last_name, 1, email, 1, popularity, 1, teachingability, 1, graduate_from, 2, student_id, 2, capability, 2, prof_id, 2, salary, 3, course_id, 3, student_id, 3, grade, 3, sat, 4, student_id, 4, f_name, 4, l_name, 4, phone_number, 4, email, 4, intelligence, 4, gpa, 4, type
Question: Who were the students who failed the course "Applied Deep Learning"? Give the full name.
Evidence: If grade is null or empty, it means that this student fails to pass the course in which grade = NULL;
SQL: SELECT T1.f_name, T1.l_name FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T3.name = 'Applied Deep Learning ' AND T2.grade IS NULL
Database: cs_semester
Tables: course, prof, RA, registration, student
Columns (table index, column name): -1, *, 0, course_id, 0, name, 0, credit, 0, diff, 1, prof_id, 1, gender, 1, first_name, 1, last_name, 1, email, 1, popularity, 1, teachingability, 1, graduate_from, 2, student_id, 2, capability, 2, prof_id, 2, salary, 3, course_id, 3, student_id, 3, grade, 3, sat, 4, student_id, 4, f_name, 4, l_name, 4, phone_number, 4, email, 4, intelligence, 4, gpa, 4, type
Question: Give the phone number of the only student who obtained "A" in the course "Intro to BlockChain".
Evidence: A refers to an excellent grade in which grade = 'A' for the course;
SQL: SELECT T1.phone_number FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T3.name = 'Intro to BlockChain' AND T2.grade = 'A'
Database: cs_semester
Tables: course, prof, RA, registration, student
Columns (table index, column name): -1, *, 0, course_id, 0, name, 0, credit, 0, diff, 1, prof_id, 1, gender, 1, first_name, 1, last_name, 1, email, 1, popularity, 1, teachingability, 1, graduate_from, 2, student_id, 2, capability, 2, prof_id, 2, salary, 3, course_id, 3, student_id, 3, grade, 3, sat, 4, student_id, 4, f_name, 4, l_name, 4, phone_number, 4, email, 4, intelligence, 4, gpa, 4, type
Question: What is the percentage of Professor Ogdon Zywicki's research assistants are taught postgraduate students?
Evidence: research assistant refers to the student who serves for research where the abbreviation is RA; taught postgraduate student refers to type = 'TPG'; DIVIDE(COUNT(student_id where type = 'TPG' and first_name = 'Ogdon', last_name = 'Zywicki'), COUNT(first_name = 'Ogdon', last_name = 'Zywicki')) as percentage;
SQL: SELECT CAST(SUM(CASE WHEN T3.type = 'TPG' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.student_id) FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T1.student_id = T3.student_id WHERE T2.first_name = 'Ogdon' AND T2.last_name = 'Zywicki'
Database: cs_semester
Tables: course, prof, RA, registration, student
Columns (table index, column name): -1, *, 0, course_id, 0, name, 0, credit, 0, diff, 1, prof_id, 1, gender, 1, first_name, 1, last_name, 1, email, 1, popularity, 1, teachingability, 1, graduate_from, 2, student_id, 2, capability, 2, prof_id, 2, salary, 3, course_id, 3, student_id, 3, grade, 3, sat, 4, student_id, 4, f_name, 4, l_name, 4, phone_number, 4, email, 4, intelligence, 4, gpa, 4, type
Question: What is the percentage of students who get a "B" in the course "Computer Network"?
Evidence: DIVIDE(COUNT(student_id(grade = 'B' and name = 'Computer Network')), COUNT(student_id where name = ' Computer Network')) as percentage;
SQL: SELECT CAST(SUM(CASE WHEN T1.grade = 'B' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.student_id) FROM registration AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.name = 'Computer Network'
Database: cs_semester
Tables: course, prof, RA, registration, student
Columns (table index, column name): -1, *, 0, course_id, 0, name, 0, credit, 0, diff, 1, prof_id, 1, gender, 1, first_name, 1, last_name, 1, email, 1, popularity, 1, teachingability, 1, graduate_from, 2, student_id, 2, capability, 2, prof_id, 2, salary, 3, course_id, 3, student_id, 3, grade, 3, sat, 4, student_id, 4, f_name, 4, l_name, 4, phone_number, 4, email, 4, intelligence, 4, gpa, 4, type
Question: How many courses have the highest difficulty?
Evidence: diff refers to difficulty; diff is higher means the course is more difficult in which highest difficulty is expessed as diff = 5;
SQL: SELECT COUNT(course_id) FROM course WHERE diff = 5
Database: cs_semester
Tables: course, prof, RA, registration, student
Columns (table index, column name): -1, *, 0, course_id, 0, name, 0, credit, 0, diff, 1, prof_id, 1, gender, 1, first_name, 1, last_name, 1, email, 1, popularity, 1, teachingability, 1, graduate_from, 2, student_id, 2, capability, 2, prof_id, 2, salary, 3, course_id, 3, student_id, 3, grade, 3, sat, 4, student_id, 4, f_name, 4, l_name, 4, phone_number, 4, email, 4, intelligence, 4, gpa, 4, type
Question: What is the full name of the professor who graduated from an Ivy League School?
Evidence: Ivy League school is assembled by 8 universities: Brown University, Columbia University, Cornell University, Dartmouth College, Harvard University, Princeton University, University of Pennsylvania and Yale University;
SQL: SELECT first_name, last_name FROM prof WHERE graduate_from IN ( 'Brown University',  'Columbia University',  'Cornell University',  'Dartmouth College',  'Harvard University',  'Princeton University',  'University of Pennsylvania',  'Yale University' )
Database: cs_semester
Tables: course, prof, RA, registration, student
Columns (table index, column name): -1, *, 0, course_id, 0, name, 0, credit, 0, diff, 1, prof_id, 1, gender, 1, first_name, 1, last_name, 1, email, 1, popularity, 1, teachingability, 1, graduate_from, 2, student_id, 2, capability, 2, prof_id, 2, salary, 3, course_id, 3, student_id, 3, grade, 3, sat, 4, student_id, 4, f_name, 4, l_name, 4, phone_number, 4, email, 4, intelligence, 4, gpa, 4, type
Question: Among the most important courses, what is the name of the most difficult course?
Evidence: Higher credit means more important in which most important refers to MAX(credit); diff refers to difficulty; the most difficult course refers to MAX(diff);
SQL: SELECT name FROM course WHERE credit = ( SELECT MAX(credit) FROM course ) AND diff = ( SELECT MAX(diff) FROM course )
Database: cs_semester
Tables: course, prof, RA, registration, student
Columns (table index, column name): -1, *, 0, course_id, 0, name, 0, credit, 0, diff, 1, prof_id, 1, gender, 1, first_name, 1, last_name, 1, email, 1, popularity, 1, teachingability, 1, graduate_from, 2, student_id, 2, capability, 2, prof_id, 2, salary, 3, course_id, 3, student_id, 3, grade, 3, sat, 4, student_id, 4, f_name, 4, l_name, 4, phone_number, 4, email, 4, intelligence, 4, gpa, 4, type
Question: How many students have the highest intelligence among those taking a bachelor's degree?
Evidence: bachelor's degree is an undergraduate degree in which type = 'UG'; the highest intelligence refers to MAX(intelligence);
SQL: SELECT COUNT(student_id) FROM student WHERE type = 'UG' AND intelligence = ( SELECT MAX(intelligence) FROM student )
Database: cs_semester
Tables: course, prof, RA, registration, student
Columns (table index, column name): -1, *, 0, course_id, 0, name, 0, credit, 0, diff, 1, prof_id, 1, gender, 1, first_name, 1, last_name, 1, email, 1, popularity, 1, teachingability, 1, graduate_from, 2, student_id, 2, capability, 2, prof_id, 2, salary, 3, course_id, 3, student_id, 3, grade, 3, sat, 4, student_id, 4, f_name, 4, l_name, 4, phone_number, 4, email, 4, intelligence, 4, gpa, 4, type
Question: Among the most popular professors, how many are females?
Evidence: the most popular professors refers to prof_id where MAX(popularity); female refers to gender;
SQL: SELECT COUNT(prof_id) FROM prof WHERE gender = 'Female' AND popularity = ( SELECT MAX(popularity) FROM prof )
Database: cs_semester
Tables: course, prof, RA, registration, student
Columns (table index, column name): -1, *, 0, course_id, 0, name, 0, credit, 0, diff, 1, prof_id, 1, gender, 1, first_name, 1, last_name, 1, email, 1, popularity, 1, teachingability, 1, graduate_from, 2, student_id, 2, capability, 2, prof_id, 2, salary, 3, course_id, 3, student_id, 3, grade, 3, sat, 4, student_id, 4, f_name, 4, l_name, 4, phone_number, 4, email, 4, intelligence, 4, gpa, 4, type
Question: How many research postgraduate students are there?
Evidence: research postgraduate student refers to type = 'RPG';
SQL: SELECT COUNT(student_id) FROM student WHERE type = 'RPG'
Database: cs_semester
Tables: course, prof, RA, registration, student
Columns (table index, column name): -1, *, 0, course_id, 0, name, 0, credit, 0, diff, 1, prof_id, 1, gender, 1, first_name, 1, last_name, 1, email, 1, popularity, 1, teachingability, 1, graduate_from, 2, student_id, 2, capability, 2, prof_id, 2, salary, 3, course_id, 3, student_id, 3, grade, 3, sat, 4, student_id, 4, f_name, 4, l_name, 4, phone_number, 4, email, 4, intelligence, 4, gpa, 4, type
Question: How many students got an A in Applied Deep Learning?
Evidence: A refers to an excellent grade in which grade = 'A' for the course;
SQL: SELECT COUNT(T2.student_id) FROM course AS T1 INNER JOIN registration AS T2 ON T1.course_id = T2.course_id WHERE T2.grade = 'A' AND T1.name = 'Applied Deep Learning '
Database: cs_semester
Tables: course, prof, RA, registration, student
Columns (table index, column name): -1, *, 0, course_id, 0, name, 0, credit, 0, diff, 1, prof_id, 1, gender, 1, first_name, 1, last_name, 1, email, 1, popularity, 1, teachingability, 1, graduate_from, 2, student_id, 2, capability, 2, prof_id, 2, salary, 3, course_id, 3, student_id, 3, grade, 3, sat, 4, student_id, 4, f_name, 4, l_name, 4, phone_number, 4, email, 4, intelligence, 4, gpa, 4, type
Question: What are the GPAs of the unpaid Research Assistants?
Evidence: Unpaid Research Assistants undertake their work without payment in which salary = 'free';
SQL: SELECT T2.gpa FROM RA AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id WHERE T1.salary = 'free'
Database: cs_semester
Tables: course, prof, RA, registration, student
Columns (table index, column name): -1, *, 0, course_id, 0, name, 0, credit, 0, diff, 1, prof_id, 1, gender, 1, first_name, 1, last_name, 1, email, 1, popularity, 1, teachingability, 1, graduate_from, 2, student_id, 2, capability, 2, prof_id, 2, salary, 3, course_id, 3, student_id, 3, grade, 3, sat, 4, student_id, 4, f_name, 4, l_name, 4, phone_number, 4, email, 4, intelligence, 4, gpa, 4, type
Question: Among the easiest courses, what is the name of the course where most students got an A?
Evidence: diff refers to difficulty; the easiest courses refers to diff = 1; A refers to an excellent grade in which grade = 'A' for the course;
SQL: SELECT T2.name FROM registration AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T1.grade = 'A' AND T2.diff = 1 GROUP BY T2.name ORDER BY COUNT(T1.student_id) DESC LIMIT 1
Database: cs_semester
Tables: course, prof, RA, registration, student
Columns (table index, column name): -1, *, 0, course_id, 0, name, 0, credit, 0, diff, 1, prof_id, 1, gender, 1, first_name, 1, last_name, 1, email, 1, popularity, 1, teachingability, 1, graduate_from, 2, student_id, 2, capability, 2, prof_id, 2, salary, 3, course_id, 3, student_id, 3, grade, 3, sat, 4, student_id, 4, f_name, 4, l_name, 4, phone_number, 4, email, 4, intelligence, 4, gpa, 4, type
Question: How many courses does the student with the highest GPA this semester take?
Evidence: student with the highest GPA refers to student_id where MAX(gpa);
SQL: SELECT COUNT(course_id) FROM registration WHERE student_id IN ( SELECT student_id FROM student WHERE gpa = ( SELECT MAX(gpa) FROM student ) )
Database: cs_semester
Tables: course, prof, RA, registration, student
Columns (table index, column name): -1, *, 0, course_id, 0, name, 0, credit, 0, diff, 1, prof_id, 1, gender, 1, first_name, 1, last_name, 1, email, 1, popularity, 1, teachingability, 1, graduate_from, 2, student_id, 2, capability, 2, prof_id, 2, salary, 3, course_id, 3, student_id, 3, grade, 3, sat, 4, student_id, 4, f_name, 4, l_name, 4, phone_number, 4, email, 4, intelligence, 4, gpa, 4, type
Question: How many students does Ogdon Zywicki advise?
Evidence: Ogdon Zywicki is a professor;
SQL: SELECT COUNT(T1.student_id) FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id WHERE T2.first_name = 'Ogdon' AND T2.last_name = 'Zywicki'
Database: cs_semester
Tables: course, prof, RA, registration, student
Columns (table index, column name): -1, *, 0, course_id, 0, name, 0, credit, 0, diff, 1, prof_id, 1, gender, 1, first_name, 1, last_name, 1, email, 1, popularity, 1, teachingability, 1, graduate_from, 2, student_id, 2, capability, 2, prof_id, 2, salary, 3, course_id, 3, student_id, 3, grade, 3, sat, 4, student_id, 4, f_name, 4, l_name, 4, phone_number, 4, email, 4, intelligence, 4, gpa, 4, type
Question: What is the name of the course with the highest satisfaction from students?
Evidence: sat refers to student's satisfaction degree with the course where sat = 5 stands for the highest satisfaction;
SQL: SELECT DISTINCT T2.name FROM registration AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T1.sat = 5
Database: cs_semester
Tables: course, prof, RA, registration, student
Columns (table index, column name): -1, *, 0, course_id, 0, name, 0, credit, 0, diff, 1, prof_id, 1, gender, 1, first_name, 1, last_name, 1, email, 1, popularity, 1, teachingability, 1, graduate_from, 2, student_id, 2, capability, 2, prof_id, 2, salary, 3, course_id, 3, student_id, 3, grade, 3, sat, 4, student_id, 4, f_name, 4, l_name, 4, phone_number, 4, email, 4, intelligence, 4, gpa, 4, type
Question: What are the names of the courses that the students with the lowest intelligence are least satisfied with?
Evidence: lower intelligence refers to intelligence = 1; sat refers to student's satisfaction degree with the course where least satisfaction refers to sat = 1;
SQL: SELECT T3.name FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T2.sat = 1 AND T1.intelligence = 1