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 of the two courses, "Advanced Operating System" or "Intro to BlockChain', did most of the students receive an A in?
Evidence: A refers to an excellent grade in which grade = 'A';
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.name IN ('Advanced Operating System', 'Intro to BlockChain') 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: What is the popularity of the professor who advises the highest number of students with the highest research ability?
Evidence: professor with the highest research ability refers to prof_id where MAX(capability);
SQL: 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
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 average number of students who registered for the courses with a difficulty of 4?
Evidence: diff refers to difficulty; DIVIDE(COUNT(student_id where diff = 4), COUNT(course_id where diff = 4));
SQL: 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
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, who have a GPA between 3 to 4, failed a course?
Evidence: 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;
SQL: 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
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 taking a bachelor's degree received an A in all of the courses that they took?
Evidence: bachelor's degree is an undergraduate degree in which type = 'UG'; A refers to an excellent grade in which grade = 'A';
SQL: 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'
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 average GPA of the students with the highest research capability and high salary? List the full names of the students.
Evidence: 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);
SQL: 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
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: List the professors' IDs and students' IDs with the lowest research ability.
Evidence: the lowest research ability refers to MIN(capability); professor’s ID refers to prof_id;
SQL: SELECT prof_id, student_id FROM RA WHERE capability = ( SELECT MIN(capability) FROM RA )
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: Name the professor who got graduation from the University of Boston.
Evidence: Name the professor refers to full name which includes f_name and l_name;
SQL: SELECT first_name, last_name FROM prof WHERE graduate_from = 'University of Boston'
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: List the courses' IDs and students' IDs who failed to pass the course.
Evidence: If grade is null or empty, it means that this student fails to pass the course;
SQL: SELECT course_id, student_id FROM registration WHERE grade IS NULL OR grade = ''
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 male and female ratio among the professors?
Evidence: DIVIDE(COUNT(prof_id where gender = 'Male'), COUNT(prof_id where gender = 'Female'));
SQL: 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
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: Describe the names and credits of the least difficult courses.
Evidence: diff refers to difficulty; the least difficult courses refer to MIN(diff);
SQL: SELECT name, credit FROM course WHERE diff = ( SELECT MIN(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: Describe the students' full names and GPAs under the supervision of the most popular professor.
Evidence: student's full names = f_name, l_name; most popular refers to MAX(popularity);
SQL: 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
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 full names and emails of unpaid research assistants.
Evidence: 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';
SQL: 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'
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: List the research assistants' full names, capabilities and GPAs who were under the supervision of Merwyn Conkay.
Evidence: research assistant refers to the student who serves for research where the abbreviation is RA; full names = f_name, l_name;
SQL: 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'
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: Describe the students' full names and grades in Intro to BlockChain course.
Evidence: student's full names = f_name, l_name;
SQL: 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'
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 students registered for the most difficult course, list the students' full names who got grade A.
Evidence: difficulty refers to diff; most difficult course refers to MAX(diff); student's full names = f_name, l_name;
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 T2.grade = 'A' ORDER BY T3.diff 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: Describe the full names and graduated universities of the professors who advised Olia Rabier.
Evidence: full names of the professors = first_name, last_name; graduated universities of the professors refers to graduate_from;
SQL: 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'
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: Name the students of the Advanced Database Systems course with the highest satisfaction.
Evidence: full the students = f_name, l_name; course refers to name; satisfaction refers to sat; highest satisfaction refers to MAX(sat);
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 = 'Advanced Database Systems' ORDER BY T2.sat 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: Calculate the GPA of the semester for Laughton Antonio.
Evidence: 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;
SQL: 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_name = 'Antonio'
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 registered courses' names by undergraduate students with GPA of 3.7 and above.
Evidence: Undergraduate students refers to type = 'UG'; GPA of 3.7 and above refers to gpa > 3.7;
SQL: 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
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: Describe the names and capability of the students who were advised by professors from the University of Washington.
Evidence: names of the students = f_name, l_name;
SQL: 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'
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: Describe the full names, emails and intelligence of the students with the highest capability and salary.
Evidence: full names of the students = f_name; l_name; highest capability refers to MAX(capability); highest salary refers to salary = 'high';
SQL: 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 ) )
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: Mention the names and credits of course registered by the students who were under the supervision of female professor with the highest teaching ability.
Evidence: female refers to gender = 'Female'; highest teaching ability refers to MAX(teachingability);
SQL: 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 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 of the professors are female?
Evidence: female refers to gender = 'Female';
SQL: SELECT COUNT(prof_id) FROM prof WHERE 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: What is the name of the most difficult course?
Evidence: difficulty of a course refers to diff; most difficult course refers to MAX(diff);
SQL: SELECT name FROM course WHERE 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: Among the students with a gpa of 3.1 to 3.7, how many of them are undergraduate students?
Evidence: gpa of 3.1 to 3.7 refers to gpa BETWEEN 3.1 AND 3.7; undergraduate students refers to type = 'UG';
SQL: SELECT COUNT(student_id) FROM student WHERE gpa BETWEEN 3.1 AND 3.7 AND type = 'UG'
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 credit of the course named "Computer Vision"?
SQL: SELECT credit FROM course WHERE name = 'Computer Vision'
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 student's ID of students with 2.5 GPA and enrolled in C for Programmers.
SQL: 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