id
int64
0
9.43k
db_id
stringclasses
69 values
schema
stringclasses
69 values
question
stringlengths
24
325
output
stringlengths
23
804
evidence
stringlengths
0
673
filtered_schema
listlengths
0
16
900
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
What are the names of the courses that the students with the lowest intelligence are least satisfied with?
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
lower intelligence refers to intelligence = 1; sat refers to student's satisfaction degree with the course where least satisfaction refers to sat = 1;
[ "course.course_id", "course.name", "registration.course_id", "registration.sat", "registration.student_id", "student.intelligence", "student.student_id" ]
901
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
Which of the two courses, "Advanced Operating System" or "Intro to BlockChain', did most of the students receive an A in?
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.name IN ('Advanced Operating System', 'Intro to BlockChain') GROUP BY T2.name ORDER BY COUNT(T1.student_id) DESC LIMIT 1
A refers to an excellent grade in which grade = 'A';
[ "course.course_id", "course.name", "registration.course_id", "registration.grade", "registration.student_id" ]
902
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
What is the popularity of the professor who advises the highest number of students with the highest research ability?
SELECT T2.popularity FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id GROUP BY T1.prof_id, T1.capability ORDER BY COUNT(T1.student_id) DESC, T1.capability DESC LIMIT 1
professor with the highest research ability refers to prof_id where MAX(capability);
[ "RA.capability", "RA.prof_id", "RA.student_id", "prof.popularity", "prof.prof_id" ]
903
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
What is the average number of students who registered for the courses with a difficulty of 4?
SELECT CAST(COUNT(T1.student_id) AS REAL) / COUNT(DISTINCT T2.course_id) FROM registration AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.diff = 4
diff refers to difficulty; DIVIDE(COUNT(student_id where diff = 4), COUNT(course_id where diff = 4));
[ "course.course_id", "course.diff", "registration.course_id", "registration.student_id" ]
904
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
How many students, who have a GPA between 3 to 4, failed a course?
SELECT COUNT(T2.student_id) FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id WHERE T2.grade IS NULL AND T1.gpa BETWEEN 3 AND 4
GPA is an abbreviated name of Grade Point Average where GPA between 3 to 4 refers to gpa BETWEEN 3 AND 4; If grade is null or empty, it means that this student fails to pass this course;
[ "registration.grade", "registration.student_id", "student.gpa", "student.student_id" ]
905
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
How many students taking a bachelor's degree received an A in all of the courses that they took?
SELECT COUNT(T2.student_id) FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id WHERE T2.grade = 'A' AND T1.type = 'UG'
bachelor's degree is an undergraduate degree in which type = 'UG'; A refers to an excellent grade in which grade = 'A';
[ "registration.grade", "registration.student_id", "student.student_id", "student.type" ]
906
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
What is the average GPA of the students with the highest research capability and high salary? List the full names of the students.
SELECT AVG(T2.gpa), T2.f_name, T2.l_name FROM RA AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id WHERE T1.salary = 'high' AND T1.capability = 5 GROUP BY T2.student_id
the highest research capability refers to capability = 5; high salary refers to salary = 'high'; prof_id refers to professor’s ID; GPA is an abbreviated name of Grade Point Average where average GPA refers to AVG(gpa);
[ "RA.capability", "RA.salary", "RA.student_id", "student.f_name", "student.gpa", "student.l_name", "student.student_id" ]
907
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
List the professors' IDs and students' IDs with the lowest research ability.
SELECT prof_id, student_id FROM RA WHERE capability = ( SELECT MIN(capability) FROM RA )
the lowest research ability refers to MIN(capability); professor’s ID refers to prof_id;
[ "RA.capability", "RA.prof_id", "RA.student_id" ]
908
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
Name the professor who got graduation from the University of Boston.
SELECT first_name, last_name FROM prof WHERE graduate_from = 'University of Boston'
Name the professor refers to full name which includes f_name and l_name;
[ "prof.first_name", "prof.graduate_from", "prof.last_name" ]
909
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
List the courses' IDs and students' IDs who failed to pass the course.
SELECT course_id, student_id FROM registration WHERE grade IS NULL OR grade = ''
If grade is null or empty, it means that this student fails to pass the course;
[ "registration.course_id", "registration.grade", "registration.student_id" ]
910
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
What is the male and female ratio among the professors?
SELECT CAST(SUM(CASE WHEN gender = 'Male' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN gender = 'Female' THEN 1 ELSE 0 END) FROM prof
DIVIDE(COUNT(prof_id where gender = 'Male'), COUNT(prof_id where gender = 'Female'));
[ "prof.gender" ]
911
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
Describe the names and credits of the least difficult courses.
SELECT name, credit FROM course WHERE diff = ( SELECT MIN(diff) FROM course )
diff refers to difficulty; the least difficult courses refer to MIN(diff);
[ "course.credit", "course.diff", "course.name" ]
912
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
Describe the students' full names and GPAs under the supervision of the most popular professor.
SELECT T3.f_name, T3.l_name, T3.gpa 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 ORDER BY T1.popularity DESC LIMIT 1
student's full names = f_name, l_name; most popular refers to MAX(popularity);
[ "RA.prof_id", "RA.student_id", "prof.popularity", "prof.prof_id", "student.f_name", "student.gpa", "student.l_name", "student.student_id" ]
913
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
Provide the full names and emails of unpaid research assistants.
SELECT T2.f_name, T2.l_name, T2.email FROM RA AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id WHERE T1.salary = 'free'
full names = f_name, l_name; research assistant refers to the student who serves for research where the abbreviation is RA; unpaid research assistant refers to salary = 'free';
[ "RA.salary", "RA.student_id", "student.email", "student.f_name", "student.l_name", "student.student_id" ]
914
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
List the research assistants' full names, capabilities and GPAs who were under the supervision of Merwyn Conkay.
SELECT T3.f_name, T3.l_name, T2.capability, T3.gpa 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 = 'Merwyn' AND T1.last_name = 'Conkay'
research assistant refers to the student who serves for research where the abbreviation is RA; full names = f_name, l_name;
[ "RA.capability", "RA.prof_id", "RA.student_id", "prof.first_name", "prof.last_name", "prof.prof_id", "student.f_name", "student.gpa", "student.l_name", "student.student_id" ]
915
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
Describe the students' full names and grades in Intro to BlockChain course.
SELECT T1.f_name, T1.l_name, T2.grade 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'
student's full names = f_name, l_name;
[ "course.course_id", "course.name", "registration.course_id", "registration.grade", "registration.student_id", "student.f_name", "student.l_name", "student.student_id" ]
916
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
Among students registered for the most difficult course, list the students' full names who got grade A.
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 T2.grade = 'A' ORDER BY T3.diff DESC LIMIT 1
difficulty refers to diff; most difficult course refers to MAX(diff); student's full names = f_name, l_name;
[ "course.course_id", "course.diff", "registration.course_id", "registration.grade", "registration.student_id", "student.f_name", "student.l_name", "student.student_id" ]
917
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
Describe the full names and graduated universities of the professors who advised Olia Rabier.
SELECT T1.first_name, T1.last_name, T1.graduate_from 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 = 'Olia' AND T3.l_name = 'Rabier'
full names of the professors = first_name, last_name; graduated universities of the professors refers to graduate_from;
[ "RA.prof_id", "RA.student_id", "prof.first_name", "prof.graduate_from", "prof.last_name", "prof.prof_id", "student.f_name", "student.l_name", "student.student_id" ]
918
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
Name the students of the Advanced Database Systems course with the highest satisfaction.
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 = 'Advanced Database Systems' ORDER BY T2.sat DESC LIMIT 1
full the students = f_name, l_name; course refers to name; satisfaction refers to sat; highest satisfaction refers to MAX(sat);
[ "course.course_id", "course.name", "registration.course_id", "registration.sat", "registration.student_id", "student.f_name", "student.l_name", "student.student_id" ]
919
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
Calculate the GPA of the semester for Laughton Antonio.
SELECT CAST(SUM(T3.credit * CASE T1.grade WHEN 'A' THEN 4 WHEN 'B' THEN 3 WHEN 'C' THEN 2 WHEN 'D' THEN 1 ELSE 1 END) AS REAL) / COUNT(T3.credit) FROM registration AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T1.course_id = T3.course_id WHERE T2.f_name = 'Laughton' AND T2.l...
GPA of the semester = DIVIDE(SUM(MULTIPLY(credit, grade)), SUM(credit)); grade 'A' refers to gpa = 4; grade 'B' refers to gpa = 3; grade 'C' refers to gpa = 2; grade 'D' refers to gpa = 1;
[ "course.course_id", "course.credit", "registration.course_id", "registration.grade", "registration.student_id", "student.f_name", "student.l_name", "student.student_id" ]
920
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
Provide the registered courses' names by undergraduate students with GPA of 3.7 and above.
SELECT DISTINCT T1.f_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 T1.type = 'UG' AND T1.gpa > 3.7
Undergraduate students refers to type = 'UG'; GPA of 3.7 and above refers to gpa > 3.7;
[ "course.course_id", "registration.course_id", "registration.student_id", "student.f_name", "student.gpa", "student.student_id", "student.type" ]
921
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
Describe the names and capability of the students who were advised by professors from the University of Washington.
SELECT T3.f_name, T3.l_name, T2.capability 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.graduate_from = 'University of Washington'
names of the students = f_name, l_name;
[ "RA.capability", "RA.prof_id", "RA.student_id", "prof.graduate_from", "prof.prof_id", "student.f_name", "student.l_name", "student.student_id" ]
922
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
Describe the full names, emails and intelligence of the students with the highest capability and salary.
SELECT f_name, l_name, email, intelligence FROM student WHERE student_id IN ( SELECT student_id FROM RA WHERE salary = 'high' AND capability = ( SELECT MAX(capability) FROM RA ) )
full names of the students = f_name; l_name; highest capability refers to MAX(capability); highest salary refers to salary = 'high';
[ "RA.capability", "RA.salary", "RA.student_id" ]
923
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
Mention the names and credits of course registered by the students who were under the supervision of female professor with the highest teaching ability.
SELECT T5.name, T5.credit 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 INNER JOIN registration AS T4 ON T3.student_id = T4.student_id INNER JOIN course AS T5 ON T4.course_id = T5.course_id WHERE T2.gender = 'Female' ORDER BY T2.teachingability ...
female refers to gender = 'Female'; highest teaching ability refers to MAX(teachingability);
[ "RA.prof_id", "RA.student_id", "course.course_id", "course.credit", "course.name", "prof.gender", "prof.prof_id", "prof.teachingability", "registration.course_id", "registration.student_id", "student.student_id" ]
924
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
How many of the professors are female?
SELECT COUNT(prof_id) FROM prof WHERE gender = 'Female'
female refers to gender = 'Female';
[ "prof.gender", "prof.prof_id" ]
925
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
What is the name of the most difficult course?
SELECT name FROM course WHERE diff = ( SELECT MAX(diff) FROM course )
difficulty of a course refers to diff; most difficult course refers to MAX(diff);
[ "course.diff", "course.name" ]
926
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
Among the students with a gpa of 3.1 to 3.7, how many of them are undergraduate students?
SELECT COUNT(student_id) FROM student WHERE gpa BETWEEN 3.1 AND 3.7 AND type = 'UG'
gpa of 3.1 to 3.7 refers to gpa BETWEEN 3.1 AND 3.7; undergraduate students refers to type = 'UG';
[ "student.gpa", "student.student_id", "student.type" ]
927
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
What is the credit of the course named "Computer Vision"?
SELECT credit FROM course WHERE name = 'Computer Vision'
[ "course.credit", "course.name" ]
928
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
Give the student's ID of students with 2.5 GPA and enrolled in C for Programmers.
SELECT T2.student_id 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 = 'C for Programmers' AND T1.gpa = 2.5
[ "course.course_id", "course.name", "registration.course_id", "registration.student_id", "student.gpa", "student.student_id" ]
929
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
Give the student's last name that gave the highest student satisfaction for the course "Intro to Database 2".
SELECT 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 = 'Intro to Database 2' ORDER BY T2.sat DESC LIMIT 1
student's last name refers to l_name; satisfaction refers to sat; highest satisfaction refers to MAX(sat);
[ "course.course_id", "course.name", "registration.course_id", "registration.sat", "registration.student_id", "student.l_name", "student.student_id" ]
930
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
Among the students with high salary, what is total number of students with a GPA higher than 3?
SELECT COUNT(T1.student_id) FROM RA AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id WHERE T1.salary = 'high' AND T2.gpa > 3
high salary refers to salary = 'high'; GPA higher than 3 refers to gpa > 3;
[ "RA.salary", "RA.student_id", "student.gpa", "student.student_id" ]
931
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
Among undergraduate students, list the name of the course with the highest student satisfaction.
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 T1.type = 'UG' ORDER BY T2.sat DESC LIMIT 1
Undergraduate students refers to type = 'UG'; satisfaction refers to sat; highest satisfaction refers to MAX(sat);
[ "course.course_id", "course.name", "registration.course_id", "registration.sat", "registration.student_id", "student.student_id", "student.type" ]
932
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
List the capability of research postgraduate students with an intellegence level of 4 and above.
SELECT T1.capability FROM RA AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id WHERE T2.type = 'RPG' AND T2.intelligence >= 4
research postgraduate students refers to type = 'RPG'; intelligence level of 4 and above refers to intelligence > = 4;
[ "RA.capability", "RA.student_id", "student.intelligence", "student.student_id", "student.type" ]
933
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
In students with a grade of B, how many of them have an intellegence level of 3?
SELECT COUNT(T1.student_id) FROM registration AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id WHERE T1.grade = 'B' AND T2.intelligence = 3
[ "registration.grade", "registration.student_id", "student.intelligence", "student.student_id" ]
934
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
What is the difficulty of the course in which a student with level of intellengence of 5 got an A grade?
SELECT T3.diff 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.grade = 'A' AND T1.intelligence = 5
difficulty of the course refers to diff;
[ "course.course_id", "course.diff", "registration.course_id", "registration.grade", "registration.student_id", "student.intelligence", "student.student_id" ]
935
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
Among professors with the highest popularity, how many of their students have research capability of 5?
SELECT COUNT(T1.student_id) FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id WHERE T1.capability = 5 ORDER BY T2.popularity DESC LIMIT 1
highest popularity refers to MAX(popularity); research capability refers to capability; capability = 5;
[ "RA.capability", "RA.prof_id", "RA.student_id", "prof.popularity", "prof.prof_id" ]
936
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
List the course's name where students acquired a grade of D.
SELECT T1.name FROM course AS T1 INNER JOIN registration AS T2 ON T1.course_id = T2.course_id WHERE T2.grade = 'D'
[ "course.course_id", "course.name", "registration.course_id", "registration.grade" ]
937
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
What is the capability on research of the student named Alvera McQuillin?
SELECT T2.capability FROM student AS T1 INNER JOIN RA AS T2 ON T1.student_id = T2.student_id WHERE T1.f_name = 'Alvera' AND T1.l_name = 'McQuillin'
capability on research refers to capability;
[ "RA.capability", "RA.student_id", "student.f_name", "student.l_name", "student.student_id" ]
938
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
Of courses with 3 credit, how many students have GPA of 3.2?
SELECT COUNT(T1.student_id) 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.credit = 3 AND T1.gpa = 3.2
[ "course.course_id", "course.credit", "registration.course_id", "registration.student_id", "student.gpa", "student.student_id" ]
939
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
Among students with low salary, how many of them have a gpa of 3.5?
SELECT COUNT(T1.student_id) FROM RA AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id WHERE T2.gpa = 3.5 AND T1.salary = 'low'
low salary refers to salary = 'low';
[ "RA.salary", "RA.student_id", "student.gpa", "student.student_id" ]
940
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
List the student's email with grade of B in a course with difficulty greater than the 80% of average difficulty of all courses.
SELECT T2.email FROM registration AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T1.course_id = T3.course_id WHERE T1.grade = 'B' GROUP BY T3.diff HAVING T3.diff > AVG(T3.diff) * 0.8
difficulty refers to diff; course with difficulty greater than the 80% of average difficulty refers to diff > MULTIPLY(AVG(diff), 80%);
[ "course.course_id", "course.diff", "registration.course_id", "registration.grade", "registration.student_id", "student.email", "student.student_id" ]
941
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
Among the professors with a teachability of 3 and below, what is the percentage of their student advisees with a low salary?
SELECT CAST(SUM(CASE WHEN T1.salary = 'low' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.salary) FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id WHERE T2.teachingability < 3
teachability < = 3; percentage = MULTIPLY(DIVIDE(COUNT(salary = 'low'), COUNT(salary)), 1.0);
[ "RA.prof_id", "RA.salary", "prof.prof_id", "prof.teachingability" ]
942
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
Find the most important and most difficult courses.
SELECT name FROM course WHERE credit = ( SELECT MAX(credit) FROM course ) AND diff = ( SELECT MAX(diff) FROM course )
most important refers to MAX(credit); most difficult refers to MAX(diff);
[ "course.credit", "course.diff", "course.name" ]
943
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
What is the average teaching ability of the most popular professors?
SELECT CAST(SUM(teachingability) AS REAL) / COUNT(prof_id) FROM prof WHERE popularity = ( SELECT MAX(popularity) FROM prof )
average = AVG(teachingability); most popular professor refers to MAX(popularity);
[ "prof.popularity", "prof.prof_id", "prof.teachingability" ]
944
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
Calculate the average satisfaction of the good students with their courses.
SELECT CAST(SUM(sat) AS REAL) / COUNT(course_id) FROM registration WHERE grade = 'B'
average satisfaction = DIVIDE(SUM(sat), COUNT(course_id)); satisfaction refers to sat; good student refers to grade = 'B';
[ "registration.course_id", "registration.grade", "registration.sat" ]
945
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
Among the students with less than four intelligence, list the full name and phone number of students with a greater than 3 GPA.
SELECT f_name, l_name, phone_number FROM student WHERE gpa > 3 AND intelligence < 4
intelligence < 4; full name = f_name, l_name; gpa > 3;
[ "student.f_name", "student.gpa", "student.intelligence", "student.l_name", "student.phone_number" ]
946
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
Name the students with above-average capability.
SELECT T1.f_name, T1.l_name FROM student AS T1 INNER JOIN RA AS T2 ON T1.student_id = T2.student_id WHERE T2.capability > ( SELECT AVG(capability) FROM RA )
name of the students = f_name, l_name; above average-capability refers to capability > AVG(capability);
[ "RA.capability", "RA.student_id", "student.f_name", "student.l_name", "student.student_id" ]
947
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
For the students with an intelligence of 5, list the full name and courses taken by them who have less than a 3 GPA.
SELECT T1.f_name, T1.l_name, 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 T1.intelligence = 5 AND T1.gpa < 3
full name of the students = f_name, l_name; gpa < 3;
[ "course.course_id", "course.name", "registration.course_id", "registration.student_id", "student.f_name", "student.gpa", "student.intelligence", "student.l_name", "student.student_id" ]
948
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
What is the average capability of students with less than a 2.5 GPA?
SELECT CAST(SUM(T1.capability) AS REAL) / COUNT(T1.student_id) FROM RA AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id WHERE T2.gpa < 2.5
average capability = AVG(capability); gpa < 2.5;
[ "RA.capability", "RA.student_id", "student.gpa", "student.student_id" ]
949
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
List the full name of the professors who advised students with intelligence 1.
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.intelligence = 1
full name of the professors = first_name, last_name;
[ "RA.prof_id", "RA.student_id", "prof.first_name", "prof.last_name", "prof.prof_id", "student.intelligence", "student.student_id" ]
950
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
What is the difference in the average GPA of students who took the hardest and easiest courses?
SELECT AVG(T1.gpa) 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.diff IN (2, 1) GROUP BY T3.diff
difference in the average gpa = SUBTRACT(AVG(gpa WHERE MAX(diff)), AVG(gpa where min(diff))); difficulty of the course refers to diff; hardest course refers to MAX(diff); easiest course refers to MIN(diff);
[ "course.course_id", "course.diff", "registration.course_id", "registration.student_id", "student.gpa", "student.student_id" ]
951
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
Give the full name and capability of students who failed in any courses.
SELECT T2.f_name, T2.l_name, T1.capability FROM RA AS T1 INNER JOIN student AS T2 ON T2.student_id = T1.student_id INNER JOIN registration AS T3 ON T2.student_id = T3.student_id WHERE T3.grade IS NULL OR T3.grade = ''
full name of students = f_name, l_name; failed refers to grade IS NULL;
[ "RA.capability", "RA.student_id", "registration.grade", "registration.student_id", "student.f_name", "student.l_name", "student.student_id" ]
952
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
Of the students with high salaries, how many took the computer vision course?
SELECT COUNT(T1.student_id) FROM RA AS T1 INNER JOIN registration AS T2 ON T2.student_id = T1.student_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T1.salary = 'high' AND T3.name = 'Computer Vision'
high salaries refers to salary = 'High';
[ "RA.salary", "RA.student_id", "course.course_id", "course.name", "registration.course_id", "registration.student_id" ]
953
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
Find the full name and popularity of the professor who advises the most number of students.
SELECT T1.first_name, T1.last_name, T1.popularity FROM prof AS T1 INNER JOIN RA AS T2 ON T1.prof_id = T2.prof_id GROUP BY T1.prof_id ORDER BY COUNT(T2.student_id) DESC LIMIT 1
full name of the professor = first_name, last_name; most number of students refers to MAX(COUNT(student_id));
[ "RA.prof_id", "RA.student_id", "prof.first_name", "prof.last_name", "prof.popularity", "prof.prof_id" ]
954
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
Please give the name of the course in which most numbers of the students got an A. Also, list the full name of the students who got an A in this course.
SELECT T3.name, T2.f_name, T2.l_name FROM registration AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T1.course_id = T3.course_id WHERE T1.grade = 'A' GROUP BY T3.name ORDER BY COUNT(T1.student_id) DESC LIMIT 1
most number of students got an A refers MAX(COUNT(student_id WHERE grade = 'A')); full name = f_name, l_name; got an A refers to grade = 'A';
[ "course.course_id", "course.name", "registration.course_id", "registration.grade", "registration.student_id", "student.f_name", "student.l_name", "student.student_id" ]
955
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
Calculate the difference between the average satisfaction of the students with high salaries and no salary.
SELECT AVG(T2.sat) - ( SELECT AVG(T2.sat) FROM RA AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id WHERE T1.salary = 'free' ) AS diff FROM RA AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id WHERE T1.salary = 'high'
average satisfaction difference = SUBTRACT(AVG(sat where salary = 'high')), (AVG(sat where salary = 'free')); satisfaction refers to sat; no salary refers to salary = 'free';
[ "RA.salary", "RA.student_id", "registration.sat", "registration.student_id" ]
956
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
Find the university from which the professor who advised most undergraduate students graduated.
SELECT T1.graduate_from 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.type = 'UG' GROUP BY T1.prof_id ORDER BY COUNT(T2.student_id) DESC LIMIT 1
university from which the professor graduated refers to graduate_from; undergraduate students refers to type = 'UG';
[ "RA.prof_id", "RA.student_id", "prof.graduate_from", "prof.prof_id", "student.student_id", "student.type" ]
957
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
Among the professors with more than average teaching ability, list the full name and email address of the professors who advise two or more students.
SELECT T2.first_name, T2.last_name, T2.email FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id WHERE T2.teachingability > ( SELECT AVG(teachingability) FROM prof ) GROUP BY T2.prof_id HAVING COUNT(T1.student_id) >= 2
more than average teaching ability refers to teachingability > AVG(teachingability); full_name of the professor = first_name, last_name; email address of the professor refers to email; advises two or more students refers to COUNT(student_id) > = 2;
[ "RA.prof_id", "RA.student_id", "prof.email", "prof.first_name", "prof.last_name", "prof.prof_id", "prof.teachingability" ]
958
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
What percentage of students are highly satisfied with the Intro to Database 2 course?
SELECT CAST(( SELECT COUNT(*) FROM course WHERE name = 'Intro to Database 2' AND course_id IN ( SELECT course_id FROM registration WHERE sat = ( SELECT MAX(sat) FROM registration ) ) ) 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 = '...
percentage = MULTIPLY(DIVIDE(COUNT(MAX(sat)), (COUNT(student_id))), 1.0); highly satisfied refers to MAX(sat);
[ "course.course_id", "course.name", "registration.course_id", "registration.sat", "registration.student_id" ]
959
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
What is the first and last name of students with highest gpa?
SELECT f_name, l_name FROM student WHERE gpa = ( SELECT MAX(gpa) FROM student )
first name refers of students refers to f_name; last name of students refers to l_name; highest gpa refers to MAX(gpa);
[ "student.f_name", "student.gpa", "student.l_name" ]
960
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
Among professors with the highest teachability, how many of their students have high salary?
SELECT COUNT(T1.student_id) FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id WHERE T1.salary = 'high' ORDER BY T2.teachingability DESC LIMIT 1
highest teachability refers to MAX(teachability); high salary refers to salary = 'high';
[ "RA.prof_id", "RA.salary", "RA.student_id", "prof.prof_id", "prof.teachingability" ]
961
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
What is the salary range of the student with an email of grosellg@hku.hk?
SELECT T1.salary FROM RA AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id WHERE T2.email = 'grosellg@hku.hk'
salary range refers to salary;
[ "RA.salary", "RA.student_id", "student.email", "student.student_id" ]
962
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
Among students that gave satisfaction of value 4 for the course named "Statistical Learning", how many of them have a gpa of 3.8?
SELECT COUNT(T1.student_id) 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 = 'Statistical learning' AND T2.sat = 4 AND T1.gpa = 3.8
satisfaction refers to sat; sat = 4; gpa = 3.8
[ "course.course_id", "course.name", "registration.course_id", "registration.sat", "registration.student_id", "student.gpa", "student.student_id" ]
963
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
Among courses with difficulty of 3, how many students have intellegence level of 2?
SELECT COUNT(T1.student_id) 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.diff = 3 AND T1.intelligence = 2
difficulty of 3 refers to diff = 3; intelligence = 2
[ "course.course_id", "course.diff", "registration.course_id", "registration.student_id", "student.intelligence", "student.student_id" ]
964
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
List the student's first and last name that got a C in the course named "Applied Deep Learning".
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 = 'C'
student's first name refers to f_name; student's last name refers to l_name; got a C refers to grade = 'C';
[ "course.course_id", "course.name", "registration.course_id", "registration.grade", "registration.student_id", "student.f_name", "student.l_name", "student.student_id" ]
965
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
Among research postgraduate students, give the name of the course with the student satisfaction value of 1.
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.type = 'RPG'
research postgraduate students refers to type = 'RPG'; name of the course refers to name; satisfaction refers to sat; sat = 1;
[ "course.course_id", "course.name", "registration.course_id", "registration.sat", "registration.student_id", "student.student_id", "student.type" ]
966
cs_semester
CREATE TABLE "course" ( course_id INTEGER constraint course_pk primary key, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER constraint prof_pk primary key, gender TEXT, first_name TEXT,...
Among the students with a capability below 3, what is the difference of undergraduate students from research postgraduate students?
SELECT SUM(CASE WHEN T2.type = 'UG' THEN 1 ELSE 0 END) - SUM(CASE WHEN T2.type = 'RPG' THEN 1 ELSE 0 END) FROM RA AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id WHERE T1.capability < 3
capability < 3; difference = subtract(count(type = 'UG')), (count(type = 'RPG')); undergraduate students refers to type = 'UG'; research postgraduate students refers to type = 'RPG';
[ "RA.capability", "RA.student_id", "student.student_id", "student.type" ]
967
computer_student
CREATE TABLE course ( course_id INTEGER constraint course_pk primary key, courseLevel TEXT ); CREATE TABLE person ( p_id INTEGER constraint person_pk primary key, professor INTEGER, student INTEGER, hasPosition TEXT, inPhase...
What is the average number of students for each advisor?
SELECT CAST(COUNT(p_id) AS REAL) / COUNT(DISTINCT p_id_dummy) AS avgnum FROM advisedBy GROUP BY p_id_dummy
students refers to advisedBy.p_id; advisor refers to p_id_dummy; average number = avg(count(advisedBy.p_id))
[ "advisedBy.p_id", "advisedBy.p_id_dummy" ]
968
computer_student
CREATE TABLE course ( course_id INTEGER constraint course_pk primary key, courseLevel TEXT ); CREATE TABLE person ( p_id INTEGER constraint person_pk primary key, professor INTEGER, student INTEGER, hasPosition TEXT, inPhase...
How many professors are teaching course ID 18?
SELECT COUNT(DISTINCT p_id) FROM taughtBy WHERE course_id = 18
professors refers to taughtBy.p_id; course ID 18 refers to taughtBy.course_id
[ "taughtBy.course_id", "taughtBy.p_id" ]
969
computer_student
CREATE TABLE course ( course_id INTEGER constraint course_pk primary key, courseLevel TEXT ); CREATE TABLE person ( p_id INTEGER constraint person_pk primary key, professor INTEGER, student INTEGER, hasPosition TEXT, inPhase...
List all the course IDs for professional or master/graduate courses.
SELECT course_id FROM course WHERE courseLevel = 'Level_500'
professional or master/graduate courses refers to courseLevel = 'Level_500'
[ "course.courseLevel", "course.course_id" ]
970
computer_student
CREATE TABLE course ( course_id INTEGER constraint course_pk primary key, courseLevel TEXT ); CREATE TABLE person ( p_id INTEGER constraint person_pk primary key, professor INTEGER, student INTEGER, hasPosition TEXT, inPhase...
How many courses are there for basic or medium undergraduate courses?
SELECT COUNT(course_id) FROM course WHERE courseLevel = 'Level_300'
basic or medium undergraduate courses refers to courseLevel = 'Level_300'; courses refers to course.course_id
[ "course.courseLevel", "course.course_id" ]
971
computer_student
CREATE TABLE course ( course_id INTEGER constraint course_pk primary key, courseLevel TEXT ); CREATE TABLE person ( p_id INTEGER constraint person_pk primary key, professor INTEGER, student INTEGER, hasPosition TEXT, inPhase...
List the ID of all professors who are not faculty member along with the courses taught by him/her.
SELECT T2.p_id, 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.hasPosition <> 0
ID of all professors refers to person.p_id where professor = 1; not faculty member refers to hasPosition = 0; courses refers to taughtBy.course_id
[ "person.hasPosition", "person.p_id", "person.professor", "taughtBy.course_id", "taughtBy.p_id" ]
972
computer_student
CREATE TABLE course ( course_id INTEGER constraint course_pk primary key, courseLevel TEXT ); CREATE TABLE person ( p_id INTEGER constraint person_pk primary key, professor INTEGER, student INTEGER, hasPosition TEXT, inPhase...
Provide the ID of professors who are teaching high-level or harder undergraduate course.
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'
ID of professors refers to taughtBy.p_id; high-level or harder undergraduate course refers to courseLevel = 'Level_400'
[ "course.courseLevel", "course.course_id", "taughtBy.course_id", "taughtBy.p_id" ]
973
computer_student
CREATE TABLE course ( course_id INTEGER constraint course_pk primary key, courseLevel TEXT ); CREATE TABLE person ( p_id INTEGER constraint person_pk primary key, professor INTEGER, student INTEGER, hasPosition TEXT, inPhase...
What are the courses taught by the advisors who gave advice to student with ID 376?
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
courses refers to course_id; advisors refers to p_id_dummy and taughtBy.p_id; student with ID 376 refers to advisedBy.p_id = 376
[ "advisedBy.p_id", "person.p_id", "taughtBy.course_id", "taughtBy.p_id" ]
974
computer_student
CREATE TABLE course ( course_id INTEGER constraint course_pk primary key, courseLevel TEXT ); CREATE TABLE person ( p_id INTEGER constraint person_pk primary key, professor INTEGER, student INTEGER, hasPosition TEXT, inPhase...
Name the advisors for students in Year 3 of the program.
SELECT T1.p_id FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.yearsInProgram = 'Year_3'
advisors refers to p_id_dummy; students in Year 3 of the program refers to yearsInProgram = 'Year_3'
[ "advisedBy.p_id", "person.p_id", "person.yearsInProgram" ]
975
computer_student
CREATE TABLE course ( course_id INTEGER constraint course_pk primary key, courseLevel TEXT ); CREATE TABLE person ( p_id INTEGER constraint person_pk primary key, professor INTEGER, student INTEGER, hasPosition TEXT, inPhase...
Which level of courses is taught by professor ID 297?
SELECT T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 297
professor ID 297 refers to taughtBy.p_id = 297
[ "course.courseLevel", "course.course_id", "taughtBy.course_id", "taughtBy.p_id" ]
976
computer_student
CREATE TABLE course ( course_id INTEGER constraint course_pk primary key, courseLevel TEXT ); CREATE TABLE person ( p_id INTEGER constraint person_pk primary key, professor INTEGER, student INTEGER, hasPosition TEXT, inPhase...
What level is course 165? List the professors who teach the course.
SELECT T1.courseLevel, T2.p_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.course_id = 165
course 165 refers to course_id = 165; professors refers to taughtBy.p_id
[ "course.courseLevel", "course.course_id", "taughtBy.course_id", "taughtBy.p_id" ]
977
computer_student
CREATE TABLE course ( course_id INTEGER constraint course_pk primary key, courseLevel TEXT ); CREATE TABLE person ( p_id INTEGER constraint person_pk primary key, professor INTEGER, student INTEGER, hasPosition TEXT, inPhase...
List the ID and years in program for students taught by advisor with ID 5.
SELECT T1.p_id, T2.yearsInProgram FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T1.p_id_dummy = 5
advisor with ID 5 refers to p_id_dummy = 5
[ "advisedBy.p_id", "advisedBy.p_id_dummy", "person.p_id", "person.yearsInProgram" ]
978
computer_student
CREATE TABLE course ( course_id INTEGER constraint course_pk primary key, courseLevel TEXT ); CREATE TABLE person ( p_id INTEGER constraint person_pk primary key, professor INTEGER, student INTEGER, hasPosition TEXT, inPhase...
State the courses and level of courses by professors who are faculty employees.
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'
professors who are faculty employees refers to professor = 1; faculty employees refers to hasPosition = 'Faculty_eme'
[ "course.courseLevel", "course.course_id", "person.hasPosition", "person.p_id", "taughtBy.course_id", "taughtBy.p_id" ]
979
computer_student
CREATE TABLE course ( course_id INTEGER constraint course_pk primary key, courseLevel TEXT ); CREATE TABLE person ( p_id INTEGER constraint person_pk primary key, professor INTEGER, student INTEGER, hasPosition TEXT, inPhase...
Find the ID of advisor of student ID 80 and state the level of courses taught by him/her.
SELECT T1.p_id_dummy, T2.courseLevel 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 T1.p_id = 80
ID of advisor refers to p_id_dummy; student ID 80 refers to advisedBy.p_id = 80; level of courses refers to courseLevel
[ "advisedBy.p_id", "advisedBy.p_id_dummy", "course.courseLevel", "course.course_id", "taughtBy.course_id" ]
980
computer_student
CREATE TABLE course ( course_id INTEGER constraint course_pk primary key, courseLevel TEXT ); CREATE TABLE person ( p_id INTEGER constraint person_pk primary key, professor INTEGER, student INTEGER, hasPosition TEXT, inPhase...
Provide the ID of professors who teach in both harder undergraduate course and master/graduate courses.
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_400' OR T1.courseLevel = 'Level_500'
harder undergraduate course refers to courseLevel = 'Level_400'; master/graduate courses refers to courseLevel = 'Level_500'; ID of professors refers to taughtBy.p_id
[ "course.courseLevel", "course.course_id", "taughtBy.course_id", "taughtBy.p_id" ]
981
computer_student
CREATE TABLE course ( course_id INTEGER constraint course_pk primary key, courseLevel TEXT ); CREATE TABLE person ( p_id INTEGER constraint person_pk primary key, professor INTEGER, student INTEGER, hasPosition TEXT, inPhase...
Who are the professors who gave advice to students in the 12th years of program?
SELECT T1.p_id_dummy FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.yearsInProgram = 'Year_12'
professors refers to p_id_dummy; 12th years of program refers to yearsInProgram = 'Year_12'
[ "advisedBy.p_id", "advisedBy.p_id_dummy", "person.p_id", "person.yearsInProgram" ]
982
computer_student
CREATE TABLE course ( course_id INTEGER constraint course_pk primary key, courseLevel TEXT ); CREATE TABLE person ( p_id INTEGER constraint person_pk primary key, professor INTEGER, student INTEGER, hasPosition TEXT, inPhase...
Which are the courses with the most number of professors? State the course ID and the level of the course.
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
courses refers taughtBy.course_id; most number of professors  refers to max(count(taughtBy.p_id)); level of the course refers to courseLevel
[ "course.courseLevel", "course.course_id", "taughtBy.course_id" ]
983
computer_student
CREATE TABLE course ( course_id INTEGER constraint course_pk primary key, courseLevel TEXT ); CREATE TABLE person ( p_id INTEGER constraint person_pk primary key, professor INTEGER, student INTEGER, hasPosition TEXT, inPhase...
How many basic and medium undergraduate courses are there?
SELECT COUNT(*) FROM course WHERE courseLevel = 'Level_300'
basic and medium undergraduate courses refers to courseLevel = 'Level_300' and courses refers to course.course_id
[ "course.courseLevel" ]
984
computer_student
CREATE TABLE course ( course_id INTEGER constraint course_pk primary key, courseLevel TEXT ); CREATE TABLE person ( p_id INTEGER constraint person_pk primary key, professor INTEGER, student INTEGER, hasPosition TEXT, inPhase...
How many people teaches course no.11?
SELECT COUNT(*) FROM taughtBy WHERE course_id = 11
people refers to taughtBy.p_id; course no.11 refers to course_id = 11
[ "taughtBy.course_id" ]
985
computer_student
CREATE TABLE course ( course_id INTEGER constraint course_pk primary key, courseLevel TEXT ); CREATE TABLE person ( p_id INTEGER constraint person_pk primary key, professor INTEGER, student INTEGER, hasPosition TEXT, inPhase...
Which course has more teachers, course no.16 or course no.18?
SELECT course_id FROM taughtBy WHERE course_id = 11 OR course_id = 18 GROUP BY course_id ORDER BY COUNT(course_id) DESC LIMIT 1
teachers refers to taughtBy.p_id; course no.16 refers to course_id = 16; course no.18 refers to course_id = 18
[ "taughtBy.course_id" ]
986
computer_student
CREATE TABLE course ( course_id INTEGER constraint course_pk primary key, courseLevel TEXT ); CREATE TABLE person ( p_id INTEGER constraint person_pk primary key, professor INTEGER, student INTEGER, hasPosition TEXT, inPhase...
How many teachers are faculty employees?
SELECT COUNT(*) FROM person WHERE hasPosition = 'Faculty_eme'
teachers refers to professor = 1; faculty employees refers to hasPosition = 'Faculty_eme'
[ "person.hasPosition" ]
987
computer_student
CREATE TABLE course ( course_id INTEGER constraint course_pk primary key, courseLevel TEXT ); CREATE TABLE person ( p_id INTEGER constraint person_pk primary key, professor INTEGER, student INTEGER, hasPosition TEXT, inPhase...
Please list the IDs of the teachers who have advised more than 4 others to teach.
SELECT p_id_dummy FROM advisedBy GROUP BY p_id_dummy HAVING COUNT(p_id_dummy) > 4
teachers refers to p_id_dummy; have advised more than 4 others refers to count(advisedBy.p_id) > 4
[ "advisedBy.p_id_dummy" ]
988
computer_student
CREATE TABLE course ( course_id INTEGER constraint course_pk primary key, courseLevel TEXT ); CREATE TABLE person ( p_id INTEGER constraint person_pk primary key, professor INTEGER, student INTEGER, hasPosition TEXT, inPhase...
How many basic or medium undergraduate courses are taught by a professor?
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 T1.courseLevel = 'Level_300' AND T3.professor = 1
basic or medium undergraduate courses refers to courseLevel = 'Level_300'; professor refers to professor = 1
[ "course.courseLevel", "course.course_id", "person.p_id", "person.professor", "taughtBy.course_id", "taughtBy.p_id" ]
989
computer_student
CREATE TABLE course ( course_id INTEGER constraint course_pk primary key, courseLevel TEXT ); CREATE TABLE person ( p_id INTEGER constraint person_pk primary key, professor INTEGER, student INTEGER, hasPosition TEXT, inPhase...
Please list the IDs of all the faculty employees who teaches a basic or medium undergraduate course.
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_300' AND T3.hasPosition = 'Faculty_eme'
faculty employees refers to hasPosition = 'Faculty_eme'; basic or medium undergraduate course refers to courseLevel = 'Level_300'
[ "course.courseLevel", "course.course_id", "person.hasPosition", "person.p_id", "taughtBy.course_id", "taughtBy.p_id" ]
990
computer_student
CREATE TABLE course ( course_id INTEGER constraint course_pk primary key, courseLevel TEXT ); CREATE TABLE person ( p_id INTEGER constraint person_pk primary key, professor INTEGER, student INTEGER, hasPosition TEXT, inPhase...
Is the teacher who teaches course no.9 a faculty member?
SELECT T2.hasPosition FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T1.course_id = 9
teacher refers to taughtBy.p_id; course no.9 refers to taughtBy.course_id = 9; faculty member refers to hasPosition ! = 0
[ "person.hasPosition", "person.p_id", "taughtBy.course_id", "taughtBy.p_id" ]
991
computer_student
CREATE TABLE course ( course_id INTEGER constraint course_pk primary key, courseLevel TEXT ); CREATE TABLE person ( p_id INTEGER constraint person_pk primary key, professor INTEGER, student INTEGER, hasPosition TEXT, inPhase...
Please list the levels of the all courses taught by teacher no.79.
SELECT T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 79
levels of the all courses refers to courseLevel; teacher no.79 refers to taughtBy.p_id = 79
[ "course.courseLevel", "course.course_id", "taughtBy.course_id", "taughtBy.p_id" ]
992
computer_student
CREATE TABLE course ( course_id INTEGER constraint course_pk primary key, courseLevel TEXT ); CREATE TABLE person ( p_id INTEGER constraint person_pk primary key, professor INTEGER, student INTEGER, hasPosition TEXT, inPhase...
Please list the IDs of the advisors of the students who are in the 5th year of their program.
SELECT T1.p_id_dummy FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.yearsInProgram = 'Year_5'
IDs of the advisors refers to p_id_dummy; in the 5th year of their program refers to yearsInProgram = 'Year_5'
[ "advisedBy.p_id", "advisedBy.p_id_dummy", "person.p_id", "person.yearsInProgram" ]
993
computer_student
CREATE TABLE course ( course_id INTEGER constraint course_pk primary key, courseLevel TEXT ); CREATE TABLE person ( p_id INTEGER constraint person_pk primary key, professor INTEGER, student INTEGER, hasPosition TEXT, inPhase...
How many students are advised to teach by a professor teaching basic or medium undergraduate courses?
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 T1.professor = 1 AND T3.courseLevel = 'Level_300'
students refers to advisedBy.p_id; professor refers to p_id_dummy and taughtBy.p_id and professor = 1; basic or medium undergraduate courses refers to courseLevel = 'Level_300'
[ "advisedBy.p_id", "course.courseLevel", "course.course_id", "person.p_id", "person.professor", "taughtBy.course_id", "taughtBy.p_id" ]
994
computer_student
CREATE TABLE course ( course_id INTEGER constraint course_pk primary key, courseLevel TEXT ); CREATE TABLE person ( p_id INTEGER constraint person_pk primary key, professor INTEGER, student INTEGER, hasPosition TEXT, inPhase...
Among the courses that are basic or medium undergraduate courses, how many of them are taught by a faculty member?
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 = 'Level_300'
courses that are basic or medium undergraduate courses refers to courseLevel = 'Level_300'; faculty member refers to hasPosition ! = 0
[ "course.courseLevel", "course.course_id", "person.p_id", "person.professor", "taughtBy.course_id", "taughtBy.p_id" ]
995
computer_student
CREATE TABLE course ( course_id INTEGER constraint course_pk primary key, courseLevel TEXT ); CREATE TABLE person ( p_id INTEGER constraint person_pk primary key, professor INTEGER, student INTEGER, hasPosition TEXT, inPhase...
For the professor who advised student no.6, please list the IDs of the courses he or she teaches.
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 T1.p_id = 9
professor refers to p_id_dummy and professor = 1; student no.6 refers to advisedBy.p_id = 6; IDs of the courses refers to taughtBy.course_id
[ "advisedBy.p_id", "course.course_id", "taughtBy.course_id", "taughtBy.p_id" ]
996
computer_student
CREATE TABLE course ( course_id INTEGER constraint course_pk primary key, courseLevel TEXT ); CREATE TABLE person ( p_id INTEGER constraint person_pk primary key, professor INTEGER, student INTEGER, hasPosition TEXT, inPhase...
What is the level of the course with the most number of teachers?
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
level of the course refers to courseLevel; course with most number of teachers refers to course_id = max(count(taughtBy.p_id))
[ "course.courseLevel", "course.course_id", "taughtBy.course_id", "taughtBy.p_id" ]
997
computer_student
CREATE TABLE course ( course_id INTEGER constraint course_pk primary key, courseLevel TEXT ); CREATE TABLE person ( p_id INTEGER constraint person_pk primary key, professor INTEGER, student INTEGER, hasPosition TEXT, inPhase...
Please list the IDs of the professors that teaches more than 3 courses.
SELECT T1.p_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.professor = 1 GROUP BY T1.p_id HAVING COUNT(DISTINCT T1.course_id) > 3
IDs of the professors refers to taughtBy.p_id and professor = 1; teaches more than 3 courses  refers to count(course_id) > 3
[ "person.p_id", "person.professor", "taughtBy.course_id", "taughtBy.p_id" ]
998
computer_student
CREATE TABLE course ( course_id INTEGER constraint course_pk primary key, courseLevel TEXT ); CREATE TABLE person ( p_id INTEGER constraint person_pk primary key, professor INTEGER, student INTEGER, hasPosition TEXT, inPhase...
Please list the IDs of the top 3 professors that teaches the most courses.
SELECT T1.p_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.professor = 1 GROUP BY T1.p_id ORDER BY COUNT(*) DESC LIMIT 3
IDs of the professors refers to taughtBy.p_id and professor = 1; teaches the most courses refers to max(count(course_id))
[ "person.p_id", "person.professor", "taughtBy.p_id" ]
999
computer_student
CREATE TABLE course ( course_id INTEGER constraint course_pk primary key, courseLevel TEXT ); CREATE TABLE person ( p_id INTEGER constraint person_pk primary key, professor INTEGER, student INTEGER, hasPosition TEXT, inPhase...
In total, all the students in the 3rd year of their program are advised by how many professors?
SELECT COUNT(DISTINCT T1.p_id_dummy) FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.yearsInProgram = 'Year_3'
3rd year of their program refers to yearsInProgram = 'Year_3'; professors refers to p_id_dummy
[ "advisedBy.p_id", "advisedBy.p_id_dummy", "person.p_id", "person.yearsInProgram" ]