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】 computer_student
【Schema】
# Table: taughtBy
[
(course_id:INTEGER, Primary Key, Examples: [0, 1, 2]),
(p_id:INTEGER, Primary Key, Examples: [40, 180, 279])
]
# Table: person
[
(p_id:INTEGER, Primary Key, Examples: [3, 4, 5]),
(professor:INTEGER, Examples: [0, 1]),
(student:INTEGER, Examples: [1, 0]),
(hasPosition:TEXT, Examples: [0, Faculty, Faculty_adj]),
(inPhase:TEXT, Examples: [0, Post_Quals, Post_Generals]),
(yearsInProgram:TEXT, Examples: [0, Year_2, Year_5])
]
# Table: course
[
(course_id:INTEGER, Primary Key, Examples: [0, 1, 2]),
(courseLevel:TEXT, Examples: [Level_500, Level_300, Level_400])
]
# Table: advisedBy
[
(p_id:INTEGER, Primary Key, Examples: [6, 9, 13]),
(p_id_dummy:INTEGER, Primary Key, Examples: [5, 7, 29])
]
【Foreign keys】
taughtBy.p_id=person.p_id
taughtBy.course_id=course.course_id
advisedBy.p_id=person.p_id
advisedBy.p_id_dummy=person.p_id

    【Question】
    How many basic or medium undergraduate courses are taught by a professor? basic or medium undergraduate courses refers to courseLevel = 'Level_300'; professor refers to professor = 1

    【Evidence】
    basic or medium undergraduate courses refers to courseLevel = 'Level_300'; professor refers to professor = 1

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

SQL: SELECT COUNT(*) FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T3.p_id = T2.p_id WHERE T1.courseLevel = 'Level_300' AND T3.professor = 1
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 computer_student
【Schema】
# Table: taughtBy
[
(course_id:INTEGER, Primary Key, Examples: [0, 1, 2]),
(p_id:INTEGER, Primary Key, Examples: [40, 180, 279])
]
# Table: person
[
(p_id:INTEGER, Primary Key, Examples: [3, 4, 5]),
(professor:INTEGER, Examples: [0, 1]),
(student:INTEGER, Examples: [1, 0]),
(hasPosition:TEXT, Examples: [0, Faculty, Faculty_adj]),
(inPhase:TEXT, Examples: [0, Post_Quals, Post_Generals]),
(yearsInProgram:TEXT, Examples: [0, Year_2, Year_5])
]
# Table: course
[
(course_id:INTEGER, Primary Key, Examples: [0, 1, 2]),
(courseLevel:TEXT, Examples: [Level_500, Level_300, Level_400])
]
# Table: advisedBy
[
(p_id:INTEGER, Primary Key, Examples: [6, 9, 13]),
(p_id_dummy:INTEGER, Primary Key, Examples: [5, 7, 29])
]
【Foreign keys】
taughtBy.p_id=person.p_id
taughtBy.course_id=course.course_id
advisedBy.p_id=person.p_id
advisedBy.p_id_dummy=person.p_id

    【Question】
    Please list the IDs of all the faculty employees who teaches a basic or medium undergraduate course. faculty employees refers to hasPosition = 'Faculty_eme'; basic or medium undergraduate course refers to courseLevel = 'Level_300'

    【Evidence】
    faculty employees refers to hasPosition = 'Faculty_eme'; basic or medium undergraduate course refers to courseLevel = 'Level_300'

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

SQL: SELECT T2.p_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T3.p_id = T2.p_id WHERE T1.courseLevel = 'Level_300' AND T3.hasPosition = 'Faculty_eme'
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 computer_student
【Schema】
# Table: taughtBy
[
(course_id:INTEGER, Primary Key, Examples: [0, 1, 2]),
(p_id:INTEGER, Primary Key, Examples: [40, 180, 279])
]
# Table: person
[
(p_id:INTEGER, Primary Key, Examples: [3, 4, 5]),
(professor:INTEGER, Examples: [0, 1]),
(student:INTEGER, Examples: [1, 0]),
(hasPosition:TEXT, Examples: [0, Faculty, Faculty_adj]),
(inPhase:TEXT, Examples: [0, Post_Quals, Post_Generals]),
(yearsInProgram:TEXT, Examples: [0, Year_2, Year_5])
]
# Table: course
[
(course_id:INTEGER, Primary Key, Examples: [0, 1, 2]),
(courseLevel:TEXT, Examples: [Level_500, Level_300, Level_400])
]
# Table: advisedBy
[
(p_id:INTEGER, Primary Key, Examples: [6, 9, 13]),
(p_id_dummy:INTEGER, Primary Key, Examples: [5, 7, 29])
]
【Foreign keys】
taughtBy.p_id=person.p_id
taughtBy.course_id=course.course_id
advisedBy.p_id=person.p_id
advisedBy.p_id_dummy=person.p_id

    【Question】
    Is the teacher who teaches course no.9 a faculty member? teacher refers to taughtBy.p_id; course no.9 refers to taughtBy.course_id = 9; faculty member refers to hasPosition ! = 0

    【Evidence】
    teacher refers to taughtBy.p_id; course no.9 refers to taughtBy.course_id = 9; faculty member refers to hasPosition ! = 0

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

SQL: SELECT T2.hasPosition FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T1.course_id = 9
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 computer_student
【Schema】
# Table: taughtBy
[
(course_id:INTEGER, Primary Key, Examples: [0, 1, 2]),
(p_id:INTEGER, Primary Key, Examples: [40, 180, 279])
]
# Table: person
[
(p_id:INTEGER, Primary Key, Examples: [3, 4, 5]),
(professor:INTEGER, Examples: [0, 1]),
(student:INTEGER, Examples: [1, 0]),
(hasPosition:TEXT, Examples: [0, Faculty, Faculty_adj]),
(inPhase:TEXT, Examples: [0, Post_Quals, Post_Generals]),
(yearsInProgram:TEXT, Examples: [0, Year_2, Year_5])
]
# Table: course
[
(course_id:INTEGER, Primary Key, Examples: [0, 1, 2]),
(courseLevel:TEXT, Examples: [Level_500, Level_300, Level_400])
]
# Table: advisedBy
[
(p_id:INTEGER, Primary Key, Examples: [6, 9, 13]),
(p_id_dummy:INTEGER, Primary Key, Examples: [5, 7, 29])
]
【Foreign keys】
taughtBy.p_id=person.p_id
taughtBy.course_id=course.course_id
advisedBy.p_id=person.p_id
advisedBy.p_id_dummy=person.p_id

    【Question】
    Please list the levels of the all courses taught by teacher no.79. levels of the all courses refers to courseLevel; teacher no.79 refers to taughtBy.p_id = 79

    【Evidence】
    levels of the all courses refers to courseLevel; teacher no.79 refers to taughtBy.p_id = 79

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

SQL: SELECT T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 79
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 computer_student
【Schema】
# Table: taughtBy
[
(course_id:INTEGER, Primary Key, Examples: [0, 1, 2]),
(p_id:INTEGER, Primary Key, Examples: [40, 180, 279])
]
# Table: person
[
(p_id:INTEGER, Primary Key, Examples: [3, 4, 5]),
(professor:INTEGER, Examples: [0, 1]),
(student:INTEGER, Examples: [1, 0]),
(hasPosition:TEXT, Examples: [0, Faculty, Faculty_adj]),
(inPhase:TEXT, Examples: [0, Post_Quals, Post_Generals]),
(yearsInProgram:TEXT, Examples: [0, Year_2, Year_5])
]
# Table: course
[
(course_id:INTEGER, Primary Key, Examples: [0, 1, 2]),
(courseLevel:TEXT, Examples: [Level_500, Level_300, Level_400])
]
# Table: advisedBy
[
(p_id:INTEGER, Primary Key, Examples: [6, 9, 13]),
(p_id_dummy:INTEGER, Primary Key, Examples: [5, 7, 29])
]
【Foreign keys】
taughtBy.p_id=person.p_id
taughtBy.course_id=course.course_id
advisedBy.p_id=person.p_id
advisedBy.p_id_dummy=person.p_id

    【Question】
    Please list the IDs of the advisors of the students who are in the 5th year of their program. IDs of the advisors refers to p_id_dummy; in the 5th year of their program refers to yearsInProgram = 'Year_5'

    【Evidence】
    IDs of the advisors refers to p_id_dummy; in the 5th year of their program refers to yearsInProgram = 'Year_5'

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

SQL: SELECT T1.p_id_dummy FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.yearsInProgram = 'Year_5'
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 computer_student
【Schema】
# Table: taughtBy
[
(course_id:INTEGER, Primary Key, Examples: [0, 1, 2]),
(p_id:INTEGER, Primary Key, Examples: [40, 180, 279])
]
# Table: person
[
(p_id:INTEGER, Primary Key, Examples: [3, 4, 5]),
(professor:INTEGER, Examples: [0, 1]),
(student:INTEGER, Examples: [1, 0]),
(hasPosition:TEXT, Examples: [0, Faculty, Faculty_adj]),
(inPhase:TEXT, Examples: [0, Post_Quals, Post_Generals]),
(yearsInProgram:TEXT, Examples: [0, Year_2, Year_5])
]
# Table: course
[
(course_id:INTEGER, Primary Key, Examples: [0, 1, 2]),
(courseLevel:TEXT, Examples: [Level_500, Level_300, Level_400])
]
# Table: advisedBy
[
(p_id:INTEGER, Primary Key, Examples: [6, 9, 13]),
(p_id_dummy:INTEGER, Primary Key, Examples: [5, 7, 29])
]
【Foreign keys】
taughtBy.p_id=person.p_id
taughtBy.course_id=course.course_id
advisedBy.p_id=person.p_id
advisedBy.p_id_dummy=person.p_id

    【Question】
    How many students are advised to teach by a professor teaching basic or medium undergraduate courses? 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'

    【Evidence】
    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'

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

SQL: SELECT COUNT(DISTINCT T4.p_id) FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id INNER JOIN advisedBy AS T4 ON T4.p_id = T1.p_id WHERE T1.professor = 1 AND T3.courseLevel = 'Level_300'
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 computer_student
【Schema】
# Table: taughtBy
[
(course_id:INTEGER, Primary Key, Examples: [0, 1, 2]),
(p_id:INTEGER, Primary Key, Examples: [40, 180, 279])
]
# Table: person
[
(p_id:INTEGER, Primary Key, Examples: [3, 4, 5]),
(professor:INTEGER, Examples: [0, 1]),
(student:INTEGER, Examples: [1, 0]),
(hasPosition:TEXT, Examples: [0, Faculty, Faculty_adj]),
(inPhase:TEXT, Examples: [0, Post_Quals, Post_Generals]),
(yearsInProgram:TEXT, Examples: [0, Year_2, Year_5])
]
# Table: course
[
(course_id:INTEGER, Primary Key, Examples: [0, 1, 2]),
(courseLevel:TEXT, Examples: [Level_500, Level_300, Level_400])
]
# Table: advisedBy
[
(p_id:INTEGER, Primary Key, Examples: [6, 9, 13]),
(p_id_dummy:INTEGER, Primary Key, Examples: [5, 7, 29])
]
【Foreign keys】
taughtBy.p_id=person.p_id
taughtBy.course_id=course.course_id
advisedBy.p_id=person.p_id
advisedBy.p_id_dummy=person.p_id

    【Question】
    Among the courses that are basic or medium undergraduate courses, how many of them are taught by a faculty member? courses that are basic or medium undergraduate courses refers to courseLevel = 'Level_300'; faculty member refers to hasPosition ! = 0

    【Evidence】
    courses that are basic or medium undergraduate courses refers to courseLevel = 'Level_300'; faculty member refers to hasPosition ! = 0

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

SQL: SELECT COUNT(*) FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.professor = 1 AND T1.courseLevel = 'Level_300'
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 computer_student
【Schema】
# Table: taughtBy
[
(course_id:INTEGER, Primary Key, Examples: [0, 1, 2]),
(p_id:INTEGER, Primary Key, Examples: [40, 180, 279])
]
# Table: person
[
(p_id:INTEGER, Primary Key, Examples: [3, 4, 5]),
(professor:INTEGER, Examples: [0, 1]),
(student:INTEGER, Examples: [1, 0]),
(hasPosition:TEXT, Examples: [0, Faculty, Faculty_adj]),
(inPhase:TEXT, Examples: [0, Post_Quals, Post_Generals]),
(yearsInProgram:TEXT, Examples: [0, Year_2, Year_5])
]
# Table: course
[
(course_id:INTEGER, Primary Key, Examples: [0, 1, 2]),
(courseLevel:TEXT, Examples: [Level_500, Level_300, Level_400])
]
# Table: advisedBy
[
(p_id:INTEGER, Primary Key, Examples: [6, 9, 13]),
(p_id_dummy:INTEGER, Primary Key, Examples: [5, 7, 29])
]
【Foreign keys】
taughtBy.p_id=person.p_id
taughtBy.course_id=course.course_id
advisedBy.p_id=person.p_id
advisedBy.p_id_dummy=person.p_id

    【Question】
    For the professor who advised student no.6, please list the IDs of the courses he or she teaches. 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

    【Evidence】
    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

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

SQL: SELECT T2.course_id FROM taughtBy AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id INNER JOIN advisedBy AS T3 ON T3.p_id = T1.p_id WHERE T1.p_id = 9
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 computer_student
【Schema】
# Table: taughtBy
[
(course_id:INTEGER, Primary Key, Examples: [0, 1, 2]),
(p_id:INTEGER, Primary Key, Examples: [40, 180, 279])
]
# Table: person
[
(p_id:INTEGER, Primary Key, Examples: [3, 4, 5]),
(professor:INTEGER, Examples: [0, 1]),
(student:INTEGER, Examples: [1, 0]),
(hasPosition:TEXT, Examples: [0, Faculty, Faculty_adj]),
(inPhase:TEXT, Examples: [0, Post_Quals, Post_Generals]),
(yearsInProgram:TEXT, Examples: [0, Year_2, Year_5])
]
# Table: course
[
(course_id:INTEGER, Primary Key, Examples: [0, 1, 2]),
(courseLevel:TEXT, Examples: [Level_500, Level_300, Level_400])
]
# Table: advisedBy
[
(p_id:INTEGER, Primary Key, Examples: [6, 9, 13]),
(p_id_dummy:INTEGER, Primary Key, Examples: [5, 7, 29])
]
【Foreign keys】
taughtBy.p_id=person.p_id
taughtBy.course_id=course.course_id
advisedBy.p_id=person.p_id
advisedBy.p_id_dummy=person.p_id

    【Question】
    What is the level of the course with the most number of teachers? level of the course refers to courseLevel; course with most number of teachers refers to course_id = max(count(taughtBy.p_id))

    【Evidence】
    level of the course refers to courseLevel; course with most number of teachers refers to course_id = max(count(taughtBy.p_id))

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

SQL: SELECT T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id ORDER BY COUNT(T2.p_id) DESC LIMIT 1
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 computer_student
【Schema】
# Table: taughtBy
[
(course_id:INTEGER, Primary Key, Examples: [0, 1, 2]),
(p_id:INTEGER, Primary Key, Examples: [40, 180, 279])
]
# Table: person
[
(p_id:INTEGER, Primary Key, Examples: [3, 4, 5]),
(professor:INTEGER, Examples: [0, 1]),
(student:INTEGER, Examples: [1, 0]),
(hasPosition:TEXT, Examples: [0, Faculty, Faculty_adj]),
(inPhase:TEXT, Examples: [0, Post_Quals, Post_Generals]),
(yearsInProgram:TEXT, Examples: [0, Year_2, Year_5])
]
# Table: course
[
(course_id:INTEGER, Primary Key, Examples: [0, 1, 2]),
(courseLevel:TEXT, Examples: [Level_500, Level_300, Level_400])
]
# Table: advisedBy
[
(p_id:INTEGER, Primary Key, Examples: [6, 9, 13]),
(p_id_dummy:INTEGER, Primary Key, Examples: [5, 7, 29])
]
【Foreign keys】
taughtBy.p_id=person.p_id
taughtBy.course_id=course.course_id
advisedBy.p_id=person.p_id
advisedBy.p_id_dummy=person.p_id

    【Question】
    Please list the IDs of the professors that teaches more than 3 courses. IDs of the professors refers to taughtBy.p_id and professor = 1; teaches more than 3 courses  refers to count(course_id) > 3

    【Evidence】
    IDs of the professors refers to taughtBy.p_id and professor = 1; teaches more than 3 courses  refers to count(course_id) > 3

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

SQL: SELECT T1.p_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.professor = 1 GROUP BY T1.p_id HAVING COUNT(DISTINCT T1.course_id) > 3
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 computer_student
【Schema】
# Table: taughtBy
[
(course_id:INTEGER, Primary Key, Examples: [0, 1, 2]),
(p_id:INTEGER, Primary Key, Examples: [40, 180, 279])
]
# Table: person
[
(p_id:INTEGER, Primary Key, Examples: [3, 4, 5]),
(professor:INTEGER, Examples: [0, 1]),
(student:INTEGER, Examples: [1, 0]),
(hasPosition:TEXT, Examples: [0, Faculty, Faculty_adj]),
(inPhase:TEXT, Examples: [0, Post_Quals, Post_Generals]),
(yearsInProgram:TEXT, Examples: [0, Year_2, Year_5])
]
# Table: course
[
(course_id:INTEGER, Primary Key, Examples: [0, 1, 2]),
(courseLevel:TEXT, Examples: [Level_500, Level_300, Level_400])
]
# Table: advisedBy
[
(p_id:INTEGER, Primary Key, Examples: [6, 9, 13]),
(p_id_dummy:INTEGER, Primary Key, Examples: [5, 7, 29])
]
【Foreign keys】
taughtBy.p_id=person.p_id
taughtBy.course_id=course.course_id
advisedBy.p_id=person.p_id
advisedBy.p_id_dummy=person.p_id

    【Question】
    Please list the IDs of the top 3 professors that teaches the most courses. IDs of the professors refers to taughtBy.p_id and professor = 1; teaches the most courses refers to max(count(course_id))

    【Evidence】
    IDs of the professors refers to taughtBy.p_id and professor = 1; teaches the most courses refers to max(count(course_id))

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

SQL: SELECT T1.p_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.professor = 1 GROUP BY T1.p_id ORDER BY COUNT(*) DESC LIMIT 3
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 computer_student
【Schema】
# Table: taughtBy
[
(course_id:INTEGER, Primary Key, Examples: [0, 1, 2]),
(p_id:INTEGER, Primary Key, Examples: [40, 180, 279])
]
# Table: person
[
(p_id:INTEGER, Primary Key, Examples: [3, 4, 5]),
(professor:INTEGER, Examples: [0, 1]),
(student:INTEGER, Examples: [1, 0]),
(hasPosition:TEXT, Examples: [0, Faculty, Faculty_adj]),
(inPhase:TEXT, Examples: [0, Post_Quals, Post_Generals]),
(yearsInProgram:TEXT, Examples: [0, Year_2, Year_5])
]
# Table: course
[
(course_id:INTEGER, Primary Key, Examples: [0, 1, 2]),
(courseLevel:TEXT, Examples: [Level_500, Level_300, Level_400])
]
# Table: advisedBy
[
(p_id:INTEGER, Primary Key, Examples: [6, 9, 13]),
(p_id_dummy:INTEGER, Primary Key, Examples: [5, 7, 29])
]
【Foreign keys】
taughtBy.p_id=person.p_id
taughtBy.course_id=course.course_id
advisedBy.p_id=person.p_id
advisedBy.p_id_dummy=person.p_id

    【Question】
    In total, all the students in the 3rd year of their program are advised by how many professors? 3rd year of their program refers to yearsInProgram = 'Year_3'; professors refers to p_id_dummy

    【Evidence】
    3rd year of their program refers to yearsInProgram = 'Year_3'; professors refers to p_id_dummy

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

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

    【Schema】
    【DB_ID】 computer_student
【Schema】
# Table: taughtBy
[
(course_id:INTEGER, Primary Key, Examples: [0, 1, 2]),
(p_id:INTEGER, Primary Key, Examples: [40, 180, 279])
]
# Table: person
[
(p_id:INTEGER, Primary Key, Examples: [3, 4, 5]),
(professor:INTEGER, Examples: [0, 1]),
(student:INTEGER, Examples: [1, 0]),
(hasPosition:TEXT, Examples: [0, Faculty, Faculty_adj]),
(inPhase:TEXT, Examples: [0, Post_Quals, Post_Generals]),
(yearsInProgram:TEXT, Examples: [0, Year_2, Year_5])
]
# Table: course
[
(course_id:INTEGER, Primary Key, Examples: [0, 1, 2]),
(courseLevel:TEXT, Examples: [Level_500, Level_300, Level_400])
]
# Table: advisedBy
[
(p_id:INTEGER, Primary Key, Examples: [6, 9, 13]),
(p_id_dummy:INTEGER, Primary Key, Examples: [5, 7, 29])
]
【Foreign keys】
taughtBy.p_id=person.p_id
taughtBy.course_id=course.course_id
advisedBy.p_id=person.p_id
advisedBy.p_id_dummy=person.p_id

    【Question】
    What is the average number of courses taught by a professor? professor refers to professor = 1; average number of courses = divide(count(taughtBy.course_id), count(taughtBy.p_id) where professor = 1 )

    【Evidence】
    professor refers to professor = 1; average number of courses = divide(count(taughtBy.course_id), count(taughtBy.p_id) where professor = 1 )

    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.course_id) AS REAL) / COUNT(DISTINCT T2.p_id) AS num FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.professor = 1
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 computer_student
【Schema】
# Table: taughtBy
[
(course_id:INTEGER, Primary Key, Examples: [0, 1, 2]),
(p_id:INTEGER, Primary Key, Examples: [40, 180, 279])
]
# Table: person
[
(p_id:INTEGER, Primary Key, Examples: [3, 4, 5]),
(professor:INTEGER, Examples: [0, 1]),
(student:INTEGER, Examples: [1, 0]),
(hasPosition:TEXT, Examples: [0, Faculty, Faculty_adj]),
(inPhase:TEXT, Examples: [0, Post_Quals, Post_Generals]),
(yearsInProgram:TEXT, Examples: [0, Year_2, Year_5])
]
# Table: course
[
(course_id:INTEGER, Primary Key, Examples: [0, 1, 2]),
(courseLevel:TEXT, Examples: [Level_500, Level_300, Level_400])
]
# Table: advisedBy
[
(p_id:INTEGER, Primary Key, Examples: [6, 9, 13]),
(p_id_dummy:INTEGER, Primary Key, Examples: [5, 7, 29])
]
【Foreign keys】
taughtBy.p_id=person.p_id
taughtBy.course_id=course.course_id
advisedBy.p_id=person.p_id
advisedBy.p_id_dummy=person.p_id

    【Question】
    What is the ratio of professors and students? professors refers to professor = 1; students refers to student = 1; ratio = divide(count(person.p_id) when professor = 1, count(person.p_id) when student = 1)

    【Evidence】
    professors refers to professor = 1; students refers to student = 1; ratio = divide(count(person.p_id) when professor = 1, count(person.p_id) when student = 1)

    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 professor = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / SUM(CASE  WHEN student = 1 THEN 1 ELSE 0 END) AS per FROM person