Input:
[INST] Here is a database schema:
program :
Program_ID [ INT ] primary_key
Name [ TEXT ]
Origin [ TEXT ]
Launch [ INT ]
Owner [ TEXT ]

channel :
Channel_ID [ INT ] primary_key
Name [ TEXT ]
Owner [ TEXT ]
Share_in_percent [ INT ]
Rating_in_percent [ INT ]

broadcast :
Channel_ID [ INT ] primary_key broadcast.Channel_ID = channel.Channel_ID
Program_ID [ INT ] broadcast.Program_ID = program.Program_ID
Time_of_day [ TEXT ]

broadcast_share :
Channel_ID [ INT ] primary_key broadcast_share.Channel_ID = channel.Channel_ID
Program_ID [ INT ] broadcast_share.Program_ID = program.Program_ID
Date [ TEXT ]
Share_in_percent [ INT ]

Please write me a SQL statement that answers the following question: find the names of programs whose origin is not in Beijing. [/INST]

Output: SELECT name FROM program WHERE origin != 'Beijing';


Input:
[INST] Here is a database schema:
program :
Program_ID [ INT ] primary_key
Name [ TEXT ]
Origin [ TEXT ]
Launch [ INT ]
Owner [ TEXT ]

channel :
Channel_ID [ INT ] primary_key
Name [ TEXT ]
Owner [ TEXT ]
Share_in_percent [ INT ]
Rating_in_percent [ INT ]

broadcast :
Channel_ID [ INT ] primary_key broadcast.Channel_ID = channel.Channel_ID
Program_ID [ INT ] broadcast.Program_ID = program.Program_ID
Time_of_day [ TEXT ]

broadcast_share :
Channel_ID [ INT ] primary_key broadcast_share.Channel_ID = channel.Channel_ID
Program_ID [ INT ] broadcast_share.Program_ID = program.Program_ID
Date [ TEXT ]
Share_in_percent [ INT ]

Please write me a SQL statement that answers the following question: Which programs' origins are not "Beijing"? Give me the program names. [/INST]

Output: SELECT name FROM program WHERE origin != 'Beijing';


Input:
[INST] Here is a database schema:
program :
Program_ID [ INT ] primary_key
Name [ TEXT ]
Origin [ TEXT ]
Launch [ INT ]
Owner [ TEXT ]

channel :
Channel_ID [ INT ] primary_key
Name [ TEXT ]
Owner [ TEXT ]
Share_in_percent [ INT ]
Rating_in_percent [ INT ]

broadcast :
Channel_ID [ INT ] primary_key broadcast.Channel_ID = channel.Channel_ID
Program_ID [ INT ] broadcast.Program_ID = program.Program_ID
Time_of_day [ TEXT ]

broadcast_share :
Channel_ID [ INT ] primary_key broadcast_share.Channel_ID = channel.Channel_ID
Program_ID [ INT ] broadcast_share.Program_ID = program.Program_ID
Date [ TEXT ]
Share_in_percent [ INT ]

Please write me a SQL statement that answers the following question: What are the names of the channels owned by CCTV or HBS? [/INST]

Output: SELECT name FROM channel WHERE OWNER  =  'CCTV' OR OWNER  =  'HBS';


Input:
[INST] Here is a database schema:
program :
Program_ID [ INT ] primary_key
Name [ TEXT ]
Origin [ TEXT ]
Launch [ INT ]
Owner [ TEXT ]

channel :
Channel_ID [ INT ] primary_key
Name [ TEXT ]
Owner [ TEXT ]
Share_in_percent [ INT ]
Rating_in_percent [ INT ]

broadcast :
Channel_ID [ INT ] primary_key broadcast.Channel_ID = channel.Channel_ID
Program_ID [ INT ] broadcast.Program_ID = program.Program_ID
Time_of_day [ TEXT ]

broadcast_share :
Channel_ID [ INT ] primary_key broadcast_share.Channel_ID = channel.Channel_ID
Program_ID [ INT ] broadcast_share.Program_ID = program.Program_ID
Date [ TEXT ]
Share_in_percent [ INT ]

Please write me a SQL statement that answers the following question: List the names of all the channels owned by either CCTV or HBS [/INST]

Output: SELECT name FROM channel WHERE OWNER  =  'CCTV' OR OWNER  =  'HBS';


Input:
[INST] Here is a database schema:
program :
Program_ID [ INT ] primary_key
Name [ TEXT ]
Origin [ TEXT ]
Launch [ INT ]
Owner [ TEXT ]

channel :
Channel_ID [ INT ] primary_key
Name [ TEXT ]
Owner [ TEXT ]
Share_in_percent [ INT ]
Rating_in_percent [ INT ]

broadcast :
Channel_ID [ INT ] primary_key broadcast.Channel_ID = channel.Channel_ID
Program_ID [ INT ] broadcast.Program_ID = program.Program_ID
Time_of_day [ TEXT ]

broadcast_share :
Channel_ID [ INT ] primary_key broadcast_share.Channel_ID = channel.Channel_ID
Program_ID [ INT ] broadcast_share.Program_ID = program.Program_ID
Date [ TEXT ]
Share_in_percent [ INT ]

Please write me a SQL statement that answers the following question: Find the total rating ratio for each channel owner. [/INST]

Output: SELECT sum(Rating_in_percent) ,  OWNER FROM channel GROUP BY OWNER;


Input:
[INST] Here is a database schema:
program :
Program_ID [ INT ] primary_key
Name [ TEXT ]
Origin [ TEXT ]
Launch [ INT ]
Owner [ TEXT ]

channel :
Channel_ID [ INT ] primary_key
Name [ TEXT ]
Owner [ TEXT ]
Share_in_percent [ INT ]
Rating_in_percent [ INT ]

broadcast :
Channel_ID [ INT ] primary_key broadcast.Channel_ID = channel.Channel_ID
Program_ID [ INT ] broadcast.Program_ID = program.Program_ID
Time_of_day [ TEXT ]

broadcast_share :
Channel_ID [ INT ] primary_key broadcast_share.Channel_ID = channel.Channel_ID
Program_ID [ INT ] broadcast_share.Program_ID = program.Program_ID
Date [ TEXT ]
Share_in_percent [ INT ]

Please write me a SQL statement that answers the following question: What is the total rating of channel for each channel owner? [/INST]

Output: SELECT sum(Rating_in_percent) ,  OWNER FROM channel GROUP BY OWNER;


Input:
[INST] Here is a database schema:
program :
Program_ID [ INT ] primary_key
Name [ TEXT ]
Origin [ TEXT ]
Launch [ INT ]
Owner [ TEXT ]

channel :
Channel_ID [ INT ] primary_key
Name [ TEXT ]
Owner [ TEXT ]
Share_in_percent [ INT ]
Rating_in_percent [ INT ]

broadcast :
Channel_ID [ INT ] primary_key broadcast.Channel_ID = channel.Channel_ID
Program_ID [ INT ] broadcast.Program_ID = program.Program_ID
Time_of_day [ TEXT ]

broadcast_share :
Channel_ID [ INT ] primary_key broadcast_share.Channel_ID = channel.Channel_ID
Program_ID [ INT ] broadcast_share.Program_ID = program.Program_ID
Date [ TEXT ]
Share_in_percent [ INT ]

Please write me a SQL statement that answers the following question: Find the name of the program that is broadcast most frequently. [/INST]

Output: SELECT t1.name FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id  =  t2.program_id GROUP BY t2.program_id ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
program :
Program_ID [ INT ] primary_key
Name [ TEXT ]
Origin [ TEXT ]
Launch [ INT ]
Owner [ TEXT ]

channel :
Channel_ID [ INT ] primary_key
Name [ TEXT ]
Owner [ TEXT ]
Share_in_percent [ INT ]
Rating_in_percent [ INT ]

broadcast :
Channel_ID [ INT ] primary_key broadcast.Channel_ID = channel.Channel_ID
Program_ID [ INT ] broadcast.Program_ID = program.Program_ID
Time_of_day [ TEXT ]

broadcast_share :
Channel_ID [ INT ] primary_key broadcast_share.Channel_ID = channel.Channel_ID
Program_ID [ INT ] broadcast_share.Program_ID = program.Program_ID
Date [ TEXT ]
Share_in_percent [ INT ]

Please write me a SQL statement that answers the following question: Which program is broadcast most frequently? Give me the program name. [/INST]

Output: SELECT t1.name FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id  =  t2.program_id GROUP BY t2.program_id ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: How many courses are there in total? [/INST]

Output: SELECT count(*) FROM COURSES;


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: Find the total number of courses offered. [/INST]

Output: SELECT count(*) FROM COURSES;


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: What are the descriptions of the courses with name "database"? [/INST]

Output: SELECT course_description FROM COURSES WHERE course_name  =  "database";


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: Return the description for the courses named "database". [/INST]

Output: SELECT course_description FROM COURSES WHERE course_name  =  "database";


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: What are the addresses of the course authors or tutors with personal name "Cathrine" [/INST]

Output: SELECT address_line_1 FROM Course_Authors_and_Tutors WHERE personal_name	 =  "Cathrine";


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: Return the addresses of the course authors or tutors whose personal name is "Cathrine". [/INST]

Output: SELECT address_line_1 FROM Course_Authors_and_Tutors WHERE personal_name	 =  "Cathrine";


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: List the addresses of all the course authors or tutors. [/INST]

Output: SELECT address_line_1 FROM Course_Authors_and_Tutors;


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: What is the address of each course author or tutor? [/INST]

Output: SELECT address_line_1 FROM Course_Authors_and_Tutors;


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: List all the login names and family names of course author and tutors. [/INST]

Output: SELECT login_name ,  family_name FROM Course_Authors_and_Tutors;


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: What are the login names and family names of course author and tutors? [/INST]

Output: SELECT login_name ,  family_name FROM Course_Authors_and_Tutors;


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: List all the dates of enrollment and completion of students. [/INST]

Output: SELECT date_of_enrolment ,  date_of_completion FROM Student_Course_Enrolment;


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: What are all the dates of enrollment and completion in record? [/INST]

Output: SELECT date_of_enrolment ,  date_of_completion FROM Student_Course_Enrolment;


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: How many distinct students are enrolled in courses? [/INST]

Output: SELECT count(DISTINCT student_id) FROM Student_Course_Enrolment;


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: Find the number of distinct students enrolled in courses. [/INST]

Output: SELECT count(DISTINCT student_id) FROM Student_Course_Enrolment;


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: How many distinct courses are enrolled in by students? [/INST]

Output: SELECT count(course_id) FROM Student_Course_Enrolment;


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: Find the number of distinct courses that have enrolled students. [/INST]

Output: SELECT count(course_id) FROM Student_Course_Enrolment;


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: Find the dates of the tests taken with result "Pass". [/INST]

Output: SELECT date_test_taken FROM Student_Tests_Taken WHERE test_result  =  "Pass";


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: Which tests have "Pass" results? Return the dates when the tests were taken. [/INST]

Output: SELECT date_test_taken FROM Student_Tests_Taken WHERE test_result  =  "Pass";


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: How many tests have result "Fail"? [/INST]

Output: SELECT count(*) FROM Student_Tests_Taken WHERE test_result  =  "Fail";


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: Count the number of tests with "Fail" result. [/INST]

Output: SELECT count(*) FROM Student_Tests_Taken WHERE test_result  =  "Fail";


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: What are the login names of the students with family name "Ward"? [/INST]

Output: SELECT login_name FROM Students WHERE family_name  =  "Ward";


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: Return the login names of the students whose family name is "Ward". [/INST]

Output: SELECT login_name FROM Students WHERE family_name  =  "Ward";


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: What are the dates of the latest logon of the students with family name "Jaskolski" or "Langosh"? [/INST]

Output: SELECT date_of_latest_logon FROM Students WHERE family_name  =  "Jaskolski" OR family_name  =  "Langosh";


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: Find the latest logon date of the students whose family name is "Jaskolski" or "Langosh". [/INST]

Output: SELECT date_of_latest_logon FROM Students WHERE family_name  =  "Jaskolski" OR family_name  =  "Langosh";


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: How many students have personal names that contain the word "son"? [/INST]

Output: SELECT COUNT(*) FROM Students WHERE personal_name LIKE "%son%";


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: Find the number of students who have the word "son" in their personal names. [/INST]

Output: SELECT COUNT(*) FROM Students WHERE personal_name LIKE "%son%";


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: List all the subject names. [/INST]

Output: SELECT subject_name FROM SUBJECTS;


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: What are the names of all the subjects. [/INST]

Output: SELECT subject_name FROM SUBJECTS;


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: List all the information about course authors and tutors in alphabetical order of the personal name. [/INST]

Output: SELECT * FROM Course_Authors_and_Tutors ORDER BY personal_name;


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: Sort the information about course authors and tutors in alphabetical order of the personal name. [/INST]

Output: SELECT * FROM Course_Authors_and_Tutors ORDER BY personal_name;


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: List the personal names and family names of all the students in alphabetical order of family name. [/INST]

Output: SELECT personal_name ,  family_name FROM Students ORDER BY family_name;


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: What are the personal names and family names of the students? Sort the result in alphabetical order of the family name. [/INST]

Output: SELECT personal_name ,  family_name FROM Students ORDER BY family_name;


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: List each test result and its count in descending order of count. [/INST]

Output: SELECT test_result ,  COUNT(*) FROM Student_Tests_Taken GROUP BY test_result ORDER BY COUNT(*) DESC;


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: For each distinct test result, find the number of students who got the result. [/INST]

Output: SELECT test_result ,  COUNT(*) FROM Student_Tests_Taken GROUP BY test_result ORDER BY COUNT(*) DESC;


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: Find the login name of the course author that teaches the course with name "advanced database". [/INST]

Output: SELECT T1.login_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id  =  T2.author_id WHERE T2.course_name  =  "advanced database";


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: Which course author teaches the "advanced database" course? Give me his or her login name. [/INST]

Output: SELECT T1.login_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id  =  T2.author_id WHERE T2.course_name  =  "advanced database";


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: Find the addresses of the course authors who teach the course with name "operating system" or "data structure". [/INST]

Output: SELECT T1.address_line_1 FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id  =  T2.author_id WHERE T2.course_name  =  "operating system" OR T2.course_name  =  "data structure";


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: What are the addresses of the course authors who teach either "operating system" or "data structure" course. [/INST]

Output: SELECT T1.address_line_1 FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id  =  T2.author_id WHERE T2.course_name  =  "operating system" OR T2.course_name  =  "data structure";


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: Find the personal name, family name, and author ID of the course author that teaches the most courses. [/INST]

Output: SELECT T1.personal_name ,  T1.family_name ,  T2.author_id FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id  =  T2.author_id GROUP BY T2.author_id ORDER BY COUNT(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: What are the personal name, family name, and author ID of the course author who teaches the most courses? [/INST]

Output: SELECT T1.personal_name ,  T1.family_name ,  T2.author_id FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id  =  T2.author_id GROUP BY T2.author_id ORDER BY COUNT(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: Find the addresses and author IDs of the course authors that teach at least two courses. [/INST]

Output: SELECT T1.address_line_1 ,  T2.author_id FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id  =  T2.author_id GROUP BY T2.author_id HAVING Count(*)  >=  2;


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: Which course authors teach two or more courses? Give me their addresses and author IDs. [/INST]

Output: SELECT T1.address_line_1 ,  T2.author_id FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id  =  T2.author_id GROUP BY T2.author_id HAVING Count(*)  >=  2;


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: Find the names of courses taught by the tutor who has personal name "Julio". [/INST]

Output: SELECT T2.course_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id  =  T2.author_id WHERE T1.personal_name  =  "Julio";


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: What are the names of the courses taught by the tutor whose personal name is "Julio"? [/INST]

Output: SELECT T2.course_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id  =  T2.author_id WHERE T1.personal_name  =  "Julio";


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: Find the names and descriptions of courses that belong to the subject named "Computer Science". [/INST]

Output: SELECT T1.course_name ,  T1.course_description FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id  =  T2.subject_id WHERE T2.subject_name  =  "Computer Science";


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: What are the names and descriptions of the all courses under the "Computer Science" subject? [/INST]

Output: SELECT T1.course_name ,  T1.course_description FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id  =  T2.subject_id WHERE T2.subject_name  =  "Computer Science";


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: Find the subject ID, subject name, and the corresponding number of available courses for each subject. [/INST]

Output: SELECT T1.subject_id ,  T2.subject_name ,  COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id  =  T2.subject_id GROUP BY T1.subject_id;


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: What are the subject ID, subject name, and the number of available courses for each subject? [/INST]

Output: SELECT T1.subject_id ,  T2.subject_name ,  COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id  =  T2.subject_id GROUP BY T1.subject_id;


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: Find the subject ID, name of subject and the corresponding number of courses for each subject, and sort by the course count in ascending order. [/INST]

Output: SELECT T1.subject_id ,  T2.subject_name ,  COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id  =  T2.subject_id GROUP BY T1.subject_id ORDER BY COUNT(*) ASC;


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: List the subject ID, name of subject and the number of courses available for each subject in ascending order of the course counts. [/INST]

Output: SELECT T1.subject_id ,  T2.subject_name ,  COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id  =  T2.subject_id GROUP BY T1.subject_id ORDER BY COUNT(*) ASC;


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: What is the date of enrollment of the course named "Spanish"? [/INST]

Output: SELECT T2.date_of_enrolment FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id  =  T2.course_id WHERE T1.course_name  =  "Spanish";


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: Find the the date of enrollment of the "Spanish" course. [/INST]

Output: SELECT T2.date_of_enrolment FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id  =  T2.course_id WHERE T1.course_name  =  "Spanish";


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: What is the name of the course that has the most student enrollment? [/INST]

Output: SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id  =  T2.course_id GROUP BY T1.course_name ORDER BY COUNT(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: Which course is enrolled in by the most students? Give me the course name. [/INST]

Output: SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id  =  T2.course_id GROUP BY T1.course_name ORDER BY COUNT(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: What are the names of the courses that have exactly 1 student enrollment? [/INST]

Output: SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id  =  T2.course_id GROUP BY T1.course_name HAVING COUNT(*)  =  1;


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: Find the names of the courses that have just one student enrollment. [/INST]

Output: SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id  =  T2.course_id GROUP BY T1.course_name HAVING COUNT(*)  =  1;


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: What are the descriptions and names of the courses that have student enrollment bigger than 2? [/INST]

Output: SELECT T1.course_description ,  T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id  =  T2.course_id GROUP BY T1.course_name HAVING COUNT(*)  >  2;


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: Return the descriptions and names of the courses that have more than two students enrolled in. [/INST]

Output: SELECT T1.course_description ,  T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id  =  T2.course_id GROUP BY T1.course_name HAVING COUNT(*)  >  2;


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: What is the name of each course and the corresponding number of student enrollment? [/INST]

Output: SELECT T1.course_name ,  COUNT(*) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id  =  T2.course_id GROUP BY T1.course_name;


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: List the name and the number of enrolled student for each course. [/INST]

Output: SELECT T1.course_name ,  COUNT(*) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id  =  T2.course_id GROUP BY T1.course_name;


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: What are the enrollment dates of all the tests that have result "Pass"? [/INST]

Output: SELECT T1.date_of_enrolment FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id  =  T2.registration_id WHERE T2.test_result  =  "Pass";


Input:
[INST] Here is a database schema:
Course_Authors_and_Tutors :
author_id [ INT ] primary_key
author_tutor_ATB [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]
gender_mf [ TEXT ]
address_line_1 [ TEXT ]

Students :
student_id [ INT ] primary_key
date_of_registration [ TEXT ]
date_of_latest_logon [ TEXT ]
login_name [ TEXT ]
password [ TEXT ]
personal_name [ TEXT ]
middle_name [ TEXT ]
family_name [ TEXT ]

Subjects :
subject_id [ INT ] primary_key
subject_name [ TEXT ]

Courses :
course_id [ INT ] primary_key
author_id [ INT ] Courses.author_id = Course_Authors_and_Tutors.author_id
subject_id [ INT ] Courses.subject_id = Subjects.subject_id
course_name [ TEXT ]
course_description [ TEXT ]

Student_Course_Enrolment :
registration_id [ INT ] primary_key
student_id [ INT ] Student_Course_Enrolment.student_id = Students.student_id
course_id [ INT ] Student_Course_Enrolment.course_id = Courses.course_id
date_of_enrolment [ TEXT ]
date_of_completion [ TEXT ]

Student_Tests_Taken :
registration_id [ INT ] Student_Tests_Taken.registration_id = Student_Course_Enrolment.registration_id
date_test_taken [ TEXT ]
test_result [ TEXT ]

Please write me a SQL statement that answers the following question: Find the enrollment date for all the tests that have "Pass" result. [/INST]

Output: SELECT T1.date_of_enrolment FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id  =  T2.registration_id WHERE T2.test_result  =  "Pass";