QIAN-ME/bird_schema_data huggingface dataset:
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 cs_semester
【Schema】
# Table: student
[
(student_id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(f_name:TEXT, Examples: [Kerry, Chrysa, Elsy]),
(l_name:TEXT, Examples: [Pryor, Dine-Hart, Shiril]),
(phone_number:TEXT, Examples: [(243) 6836472, (672) 9245255, (521) 7680522]),
(email:TEXT),
(intelligence:INTEGER, Examples: [5, 2, 1]),
(gpa:REAL, Examples: [2.4, 2.7, 3.5]),
(type:TEXT, Examples: [RPG, TPG, UG])
]
# Table: prof
[
(prof_id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(gender:TEXT, Examples: [Male, Female]),
(first_name:TEXT, Examples: [Nathaniel, Zhihua, Ogdon]),
(last_name:TEXT, Examples: [Pigford, Zhou, Zywicki]),
(email:TEXT),
(popularity:INTEGER, Examples: [3, 2]),
(teachingability:INTEGER, Examples: [5, 1, 2]),
(graduate_from:TEXT, Examples: [University of Washington])
]
# Table: registration
[
(course_id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(student_id:INTEGER, Primary Key, Examples: [2, 3, 4]),
(grade:TEXT, Examples: [A, B, C]),
(sat:INTEGER, Examples: [5, 4, 3])
]
# Table: course
[
(course_id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(name:TEXT, Examples: [Machine Learning Theory]),
(credit:INTEGER, Examples: [3, 2]),
(diff:INTEGER, Examples: [3, 4, 1])
]
# Table: RA
[
(student_id:INTEGER, Primary Key, Examples: [2, 5, 6]),
(capability:INTEGER, Examples: [2, 5, 4]),
(prof_id:INTEGER, Primary Key, Examples: [7, 10, 13]),
(salary:TEXT, Examples: [med, high, low])
]
【Foreign keys】
registration.course_id=course.course_id
registration.student_id=student.student_id
RA.prof_id=prof.prof_id
RA.student_id=student.student_id

    【Question】
    Which of the two courses, "Advanced Operating System" or "Intro to BlockChain', did most of the students receive an A in? A refers to an excellent grade in which grade = 'A';

    【Evidence】
    A refers to an excellent grade in which grade = 'A';

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

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
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 cs_semester
【Schema】
# Table: student
[
(student_id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(f_name:TEXT, Examples: [Kerry, Chrysa, Elsy]),
(l_name:TEXT, Examples: [Pryor, Dine-Hart, Shiril]),
(phone_number:TEXT, Examples: [(243) 6836472, (672) 9245255, (521) 7680522]),
(email:TEXT),
(intelligence:INTEGER, Examples: [5, 2, 1]),
(gpa:REAL, Examples: [2.4, 2.7, 3.5]),
(type:TEXT, Examples: [RPG, TPG, UG])
]
# Table: prof
[
(prof_id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(gender:TEXT, Examples: [Male, Female]),
(first_name:TEXT, Examples: [Nathaniel, Zhihua, Ogdon]),
(last_name:TEXT, Examples: [Pigford, Zhou, Zywicki]),
(email:TEXT),
(popularity:INTEGER, Examples: [3, 2]),
(teachingability:INTEGER, Examples: [5, 1, 2]),
(graduate_from:TEXT, Examples: [University of Washington])
]
# Table: registration
[
(course_id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(student_id:INTEGER, Primary Key, Examples: [2, 3, 4]),
(grade:TEXT, Examples: [A, B, C]),
(sat:INTEGER, Examples: [5, 4, 3])
]
# Table: course
[
(course_id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(name:TEXT, Examples: [Machine Learning Theory]),
(credit:INTEGER, Examples: [3, 2]),
(diff:INTEGER, Examples: [3, 4, 1])
]
# Table: RA
[
(student_id:INTEGER, Primary Key, Examples: [2, 5, 6]),
(capability:INTEGER, Examples: [2, 5, 4]),
(prof_id:INTEGER, Primary Key, Examples: [7, 10, 13]),
(salary:TEXT, Examples: [med, high, low])
]
【Foreign keys】
registration.course_id=course.course_id
registration.student_id=student.student_id
RA.prof_id=prof.prof_id
RA.student_id=student.student_id

    【Question】
    What is the popularity of the professor who advises the highest number of students with the highest research ability? professor with the highest research ability refers to prof_id where MAX(capability);

    【Evidence】
    professor with the highest research ability refers to prof_id where MAX(capability);

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

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
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 cs_semester
【Schema】
# Table: student
[
(student_id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(f_name:TEXT, Examples: [Kerry, Chrysa, Elsy]),
(l_name:TEXT, Examples: [Pryor, Dine-Hart, Shiril]),
(phone_number:TEXT, Examples: [(243) 6836472, (672) 9245255, (521) 7680522]),
(email:TEXT),
(intelligence:INTEGER, Examples: [5, 2, 1]),
(gpa:REAL, Examples: [2.4, 2.7, 3.5]),
(type:TEXT, Examples: [RPG, TPG, UG])
]
# Table: prof
[
(prof_id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(gender:TEXT, Examples: [Male, Female]),
(first_name:TEXT, Examples: [Nathaniel, Zhihua, Ogdon]),
(last_name:TEXT, Examples: [Pigford, Zhou, Zywicki]),
(email:TEXT),
(popularity:INTEGER, Examples: [3, 2]),
(teachingability:INTEGER, Examples: [5, 1, 2]),
(graduate_from:TEXT, Examples: [University of Washington])
]
# Table: registration
[
(course_id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(student_id:INTEGER, Primary Key, Examples: [2, 3, 4]),
(grade:TEXT, Examples: [A, B, C]),
(sat:INTEGER, Examples: [5, 4, 3])
]
# Table: course
[
(course_id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(name:TEXT, Examples: [Machine Learning Theory]),
(credit:INTEGER, Examples: [3, 2]),
(diff:INTEGER, Examples: [3, 4, 1])
]
# Table: RA
[
(student_id:INTEGER, Primary Key, Examples: [2, 5, 6]),
(capability:INTEGER, Examples: [2, 5, 4]),
(prof_id:INTEGER, Primary Key, Examples: [7, 10, 13]),
(salary:TEXT, Examples: [med, high, low])
]
【Foreign keys】
registration.course_id=course.course_id
registration.student_id=student.student_id
RA.prof_id=prof.prof_id
RA.student_id=student.student_id

    【Question】
    What is the average number of students who registered for the courses with a difficulty of 4? diff refers to difficulty; DIVIDE(COUNT(student_id where diff = 4), COUNT(course_id where diff = 4));

    【Evidence】
    diff refers to difficulty; DIVIDE(COUNT(student_id where diff = 4), COUNT(course_id where diff = 4));

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

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
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 cs_semester
【Schema】
# Table: student
[
(student_id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(f_name:TEXT, Examples: [Kerry, Chrysa, Elsy]),
(l_name:TEXT, Examples: [Pryor, Dine-Hart, Shiril]),
(phone_number:TEXT, Examples: [(243) 6836472, (672) 9245255, (521) 7680522]),
(email:TEXT),
(intelligence:INTEGER, Examples: [5, 2, 1]),
(gpa:REAL, Examples: [2.4, 2.7, 3.5]),
(type:TEXT, Examples: [RPG, TPG, UG])
]
# Table: prof
[
(prof_id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(gender:TEXT, Examples: [Male, Female]),
(first_name:TEXT, Examples: [Nathaniel, Zhihua, Ogdon]),
(last_name:TEXT, Examples: [Pigford, Zhou, Zywicki]),
(email:TEXT),
(popularity:INTEGER, Examples: [3, 2]),
(teachingability:INTEGER, Examples: [5, 1, 2]),
(graduate_from:TEXT, Examples: [University of Washington])
]
# Table: registration
[
(course_id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(student_id:INTEGER, Primary Key, Examples: [2, 3, 4]),
(grade:TEXT, Examples: [A, B, C]),
(sat:INTEGER, Examples: [5, 4, 3])
]
# Table: course
[
(course_id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(name:TEXT, Examples: [Machine Learning Theory]),
(credit:INTEGER, Examples: [3, 2]),
(diff:INTEGER, Examples: [3, 4, 1])
]
# Table: RA
[
(student_id:INTEGER, Primary Key, Examples: [2, 5, 6]),
(capability:INTEGER, Examples: [2, 5, 4]),
(prof_id:INTEGER, Primary Key, Examples: [7, 10, 13]),
(salary:TEXT, Examples: [med, high, low])
]
【Foreign keys】
registration.course_id=course.course_id
registration.student_id=student.student_id
RA.prof_id=prof.prof_id
RA.student_id=student.student_id

    【Question】
    How many students, who have a GPA between 3 to 4, failed a course? 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;

    【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;

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

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
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 cs_semester
【Schema】
# Table: student
[
(student_id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(f_name:TEXT, Examples: [Kerry, Chrysa, Elsy]),
(l_name:TEXT, Examples: [Pryor, Dine-Hart, Shiril]),
(phone_number:TEXT, Examples: [(243) 6836472, (672) 9245255, (521) 7680522]),
(email:TEXT),
(intelligence:INTEGER, Examples: [5, 2, 1]),
(gpa:REAL, Examples: [2.4, 2.7, 3.5]),
(type:TEXT, Examples: [RPG, TPG, UG])
]
# Table: prof
[
(prof_id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(gender:TEXT, Examples: [Male, Female]),
(first_name:TEXT, Examples: [Nathaniel, Zhihua, Ogdon]),
(last_name:TEXT, Examples: [Pigford, Zhou, Zywicki]),
(email:TEXT),
(popularity:INTEGER, Examples: [3, 2]),
(teachingability:INTEGER, Examples: [5, 1, 2]),
(graduate_from:TEXT, Examples: [University of Washington])
]
# Table: registration
[
(course_id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(student_id:INTEGER, Primary Key, Examples: [2, 3, 4]),
(grade:TEXT, Examples: [A, B, C]),
(sat:INTEGER, Examples: [5, 4, 3])
]
# Table: course
[
(course_id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(name:TEXT, Examples: [Machine Learning Theory]),
(credit:INTEGER, Examples: [3, 2]),
(diff:INTEGER, Examples: [3, 4, 1])
]
# Table: RA
[
(student_id:INTEGER, Primary Key, Examples: [2, 5, 6]),
(capability:INTEGER, Examples: [2, 5, 4]),
(prof_id:INTEGER, Primary Key, Examples: [7, 10, 13]),
(salary:TEXT, Examples: [med, high, low])
]
【Foreign keys】
registration.course_id=course.course_id
registration.student_id=student.student_id
RA.prof_id=prof.prof_id
RA.student_id=student.student_id

    【Question】
    How many students taking a bachelor's degree received an A in all of the courses that they took? bachelor's degree is an undergraduate degree in which type = 'UG'; A refers to an excellent grade in which grade = 'A';

    【Evidence】
    bachelor's degree is an undergraduate degree in which type = 'UG'; A refers to an excellent grade in which grade = 'A';

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

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'
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 cs_semester
【Schema】
# Table: student
[
(student_id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(f_name:TEXT, Examples: [Kerry, Chrysa, Elsy]),
(l_name:TEXT, Examples: [Pryor, Dine-Hart, Shiril]),
(phone_number:TEXT, Examples: [(243) 6836472, (672) 9245255, (521) 7680522]),
(email:TEXT),
(intelligence:INTEGER, Examples: [5, 2, 1]),
(gpa:REAL, Examples: [2.4, 2.7, 3.5]),
(type:TEXT, Examples: [RPG, TPG, UG])
]
# Table: prof
[
(prof_id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(gender:TEXT, Examples: [Male, Female]),
(first_name:TEXT, Examples: [Nathaniel, Zhihua, Ogdon]),
(last_name:TEXT, Examples: [Pigford, Zhou, Zywicki]),
(email:TEXT),
(popularity:INTEGER, Examples: [3, 2]),
(teachingability:INTEGER, Examples: [5, 1, 2]),
(graduate_from:TEXT, Examples: [University of Washington])
]
# Table: registration
[
(course_id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(student_id:INTEGER, Primary Key, Examples: [2, 3, 4]),
(grade:TEXT, Examples: [A, B, C]),
(sat:INTEGER, Examples: [5, 4, 3])
]
# Table: course
[
(course_id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(name:TEXT, Examples: [Machine Learning Theory]),
(credit:INTEGER, Examples: [3, 2]),
(diff:INTEGER, Examples: [3, 4, 1])
]
# Table: RA
[
(student_id:INTEGER, Primary Key, Examples: [2, 5, 6]),
(capability:INTEGER, Examples: [2, 5, 4]),
(prof_id:INTEGER, Primary Key, Examples: [7, 10, 13]),
(salary:TEXT, Examples: [med, high, low])
]
【Foreign keys】
registration.course_id=course.course_id
registration.student_id=student.student_id
RA.prof_id=prof.prof_id
RA.student_id=student.student_id

    【Question】
    What is the average GPA of the students with the highest research capability and high salary? List the full names of the students. 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);

    【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);

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

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
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 cs_semester
【Schema】
# Table: student
[
(student_id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(f_name:TEXT, Examples: [Kerry, Chrysa, Elsy]),
(l_name:TEXT, Examples: [Pryor, Dine-Hart, Shiril]),
(phone_number:TEXT, Examples: [(243) 6836472, (672) 9245255, (521) 7680522]),
(email:TEXT),
(intelligence:INTEGER, Examples: [5, 2, 1]),
(gpa:REAL, Examples: [2.4, 2.7, 3.5]),
(type:TEXT, Examples: [RPG, TPG, UG])
]
# Table: prof
[
(prof_id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(gender:TEXT, Examples: [Male, Female]),
(first_name:TEXT, Examples: [Nathaniel, Zhihua, Ogdon]),
(last_name:TEXT, Examples: [Pigford, Zhou, Zywicki]),
(email:TEXT),
(popularity:INTEGER, Examples: [3, 2]),
(teachingability:INTEGER, Examples: [5, 1, 2]),
(graduate_from:TEXT, Examples: [University of Washington])
]
# Table: registration
[
(course_id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(student_id:INTEGER, Primary Key, Examples: [2, 3, 4]),
(grade:TEXT, Examples: [A, B, C]),
(sat:INTEGER, Examples: [5, 4, 3])
]
# Table: course
[
(course_id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(name:TEXT, Examples: [Machine Learning Theory]),
(credit:INTEGER, Examples: [3, 2]),
(diff:INTEGER, Examples: [3, 4, 1])
]
# Table: RA
[
(student_id:INTEGER, Primary Key, Examples: [2, 5, 6]),
(capability:INTEGER, Examples: [2, 5, 4]),
(prof_id:INTEGER, Primary Key, Examples: [7, 10, 13]),
(salary:TEXT, Examples: [med, high, low])
]
【Foreign keys】
registration.course_id=course.course_id
registration.student_id=student.student_id
RA.prof_id=prof.prof_id
RA.student_id=student.student_id

    【Question】
    List the professors' IDs and students' IDs with the lowest research ability. the lowest research ability refers to MIN(capability); professor’s ID refers to prof_id;

    【Evidence】
    the lowest research ability refers to MIN(capability); professor’s ID refers to prof_id;

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT prof_id, student_id FROM RA WHERE capability = ( SELECT MIN(capability) FROM RA )
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 cs_semester
【Schema】
# Table: student
[
(student_id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(f_name:TEXT, Examples: [Kerry, Chrysa, Elsy]),
(l_name:TEXT, Examples: [Pryor, Dine-Hart, Shiril]),
(phone_number:TEXT, Examples: [(243) 6836472, (672) 9245255, (521) 7680522]),
(email:TEXT),
(intelligence:INTEGER, Examples: [5, 2, 1]),
(gpa:REAL, Examples: [2.4, 2.7, 3.5]),
(type:TEXT, Examples: [RPG, TPG, UG])
]
# Table: prof
[
(prof_id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(gender:TEXT, Examples: [Male, Female]),
(first_name:TEXT, Examples: [Nathaniel, Zhihua, Ogdon]),
(last_name:TEXT, Examples: [Pigford, Zhou, Zywicki]),
(email:TEXT),
(popularity:INTEGER, Examples: [3, 2]),
(teachingability:INTEGER, Examples: [5, 1, 2]),
(graduate_from:TEXT, Examples: [University of Washington])
]
# Table: registration
[
(course_id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(student_id:INTEGER, Primary Key, Examples: [2, 3, 4]),
(grade:TEXT, Examples: [A, B, C]),
(sat:INTEGER, Examples: [5, 4, 3])
]
# Table: course
[
(course_id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(name:TEXT, Examples: [Machine Learning Theory]),
(credit:INTEGER, Examples: [3, 2]),
(diff:INTEGER, Examples: [3, 4, 1])
]
# Table: RA
[
(student_id:INTEGER, Primary Key, Examples: [2, 5, 6]),
(capability:INTEGER, Examples: [2, 5, 4]),
(prof_id:INTEGER, Primary Key, Examples: [7, 10, 13]),
(salary:TEXT, Examples: [med, high, low])
]
【Foreign keys】
registration.course_id=course.course_id
registration.student_id=student.student_id
RA.prof_id=prof.prof_id
RA.student_id=student.student_id

    【Question】
    Name the professor who got graduation from the University of Boston. Name the professor refers to full name which includes f_name and l_name;

    【Evidence】
    Name the professor refers to full name which includes f_name and l_name;

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT first_name, last_name FROM prof WHERE graduate_from = 'University of Boston'
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 cs_semester
【Schema】
# Table: student
[
(student_id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(f_name:TEXT, Examples: [Kerry, Chrysa, Elsy]),
(l_name:TEXT, Examples: [Pryor, Dine-Hart, Shiril]),
(phone_number:TEXT, Examples: [(243) 6836472, (672) 9245255, (521) 7680522]),
(email:TEXT),
(intelligence:INTEGER, Examples: [5, 2, 1]),
(gpa:REAL, Examples: [2.4, 2.7, 3.5]),
(type:TEXT, Examples: [RPG, TPG, UG])
]
# Table: prof
[
(prof_id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(gender:TEXT, Examples: [Male, Female]),
(first_name:TEXT, Examples: [Nathaniel, Zhihua, Ogdon]),
(last_name:TEXT, Examples: [Pigford, Zhou, Zywicki]),
(email:TEXT),
(popularity:INTEGER, Examples: [3, 2]),
(teachingability:INTEGER, Examples: [5, 1, 2]),
(graduate_from:TEXT, Examples: [University of Washington])
]
# Table: registration
[
(course_id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(student_id:INTEGER, Primary Key, Examples: [2, 3, 4]),
(grade:TEXT, Examples: [A, B, C]),
(sat:INTEGER, Examples: [5, 4, 3])
]
# Table: course
[
(course_id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(name:TEXT, Examples: [Machine Learning Theory]),
(credit:INTEGER, Examples: [3, 2]),
(diff:INTEGER, Examples: [3, 4, 1])
]
# Table: RA
[
(student_id:INTEGER, Primary Key, Examples: [2, 5, 6]),
(capability:INTEGER, Examples: [2, 5, 4]),
(prof_id:INTEGER, Primary Key, Examples: [7, 10, 13]),
(salary:TEXT, Examples: [med, high, low])
]
【Foreign keys】
registration.course_id=course.course_id
registration.student_id=student.student_id
RA.prof_id=prof.prof_id
RA.student_id=student.student_id

    【Question】
    List the courses' IDs and students' IDs who failed to pass the course. If grade is null or empty, it means that this student fails to pass the course;

    【Evidence】
    If grade is null or empty, it means that this student fails to pass the course;

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT course_id, student_id FROM registration WHERE grade IS NULL OR grade = ''
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 cs_semester
【Schema】
# Table: student
[
(student_id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(f_name:TEXT, Examples: [Kerry, Chrysa, Elsy]),
(l_name:TEXT, Examples: [Pryor, Dine-Hart, Shiril]),
(phone_number:TEXT, Examples: [(243) 6836472, (672) 9245255, (521) 7680522]),
(email:TEXT),
(intelligence:INTEGER, Examples: [5, 2, 1]),
(gpa:REAL, Examples: [2.4, 2.7, 3.5]),
(type:TEXT, Examples: [RPG, TPG, UG])
]
# Table: prof
[
(prof_id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(gender:TEXT, Examples: [Male, Female]),
(first_name:TEXT, Examples: [Nathaniel, Zhihua, Ogdon]),
(last_name:TEXT, Examples: [Pigford, Zhou, Zywicki]),
(email:TEXT),
(popularity:INTEGER, Examples: [3, 2]),
(teachingability:INTEGER, Examples: [5, 1, 2]),
(graduate_from:TEXT, Examples: [University of Washington])
]
# Table: registration
[
(course_id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(student_id:INTEGER, Primary Key, Examples: [2, 3, 4]),
(grade:TEXT, Examples: [A, B, C]),
(sat:INTEGER, Examples: [5, 4, 3])
]
# Table: course
[
(course_id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(name:TEXT, Examples: [Machine Learning Theory]),
(credit:INTEGER, Examples: [3, 2]),
(diff:INTEGER, Examples: [3, 4, 1])
]
# Table: RA
[
(student_id:INTEGER, Primary Key, Examples: [2, 5, 6]),
(capability:INTEGER, Examples: [2, 5, 4]),
(prof_id:INTEGER, Primary Key, Examples: [7, 10, 13]),
(salary:TEXT, Examples: [med, high, low])
]
【Foreign keys】
registration.course_id=course.course_id
registration.student_id=student.student_id
RA.prof_id=prof.prof_id
RA.student_id=student.student_id

    【Question】
    What is the male and female ratio among the professors? DIVIDE(COUNT(prof_id where gender = 'Male'), COUNT(prof_id where gender = 'Female'));

    【Evidence】
    DIVIDE(COUNT(prof_id where gender = 'Male'), COUNT(prof_id where gender = 'Female'));

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

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