sert121/SpiderSQL huggingface dataset:
-- Language PostgreSQL
        -- Tables: 
             -- Table: course authors and tutors 
columns : [['author id', 'number'], ['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']]

 -- Table: students 
columns : [['student id', 'number'], ['date of registration', 'time'], ['date of latest logon', 'time'], ['login name', 'text'], ['password', 'text'], ['personal name', 'text'], ['middle name', 'text'], ['family name', 'text']]

 -- Table: subjects 
columns : [['subject id', 'number'], ['subject name', 'text']]

 -- Table: courses 
columns : [['course id', 'number'], ['author id', 'number'], ['subject id', 'number'], ['course name', 'text'], ['course description', 'text']]

 -- Table: student course enrolment 
columns : [['registration id', 'number'], ['student id', 'number'], ['course id', 'number'], ['date of enrolment', 'time'], ['date of completion', 'time']]

 -- Table: student tests taken 
columns : [['registration id', 'number'], ['date test taken', 'time'], ['test result', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Find the names and descriptions of courses that belong to the subject named "Computer Science".
SQL: 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"
-- Language PostgreSQL
        -- Tables: 
             -- Table: course authors and tutors 
columns : [['author id', 'number'], ['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']]

 -- Table: students 
columns : [['student id', 'number'], ['date of registration', 'time'], ['date of latest logon', 'time'], ['login name', 'text'], ['password', 'text'], ['personal name', 'text'], ['middle name', 'text'], ['family name', 'text']]

 -- Table: subjects 
columns : [['subject id', 'number'], ['subject name', 'text']]

 -- Table: courses 
columns : [['course id', 'number'], ['author id', 'number'], ['subject id', 'number'], ['course name', 'text'], ['course description', 'text']]

 -- Table: student course enrolment 
columns : [['registration id', 'number'], ['student id', 'number'], ['course id', 'number'], ['date of enrolment', 'time'], ['date of completion', 'time']]

 -- Table: student tests taken 
columns : [['registration id', 'number'], ['date test taken', 'time'], ['test result', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the names and descriptions of the all courses under the "Computer Science" subject?
SQL: 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"
-- Language PostgreSQL
        -- Tables: 
             -- Table: course authors and tutors 
columns : [['author id', 'number'], ['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']]

 -- Table: students 
columns : [['student id', 'number'], ['date of registration', 'time'], ['date of latest logon', 'time'], ['login name', 'text'], ['password', 'text'], ['personal name', 'text'], ['middle name', 'text'], ['family name', 'text']]

 -- Table: subjects 
columns : [['subject id', 'number'], ['subject name', 'text']]

 -- Table: courses 
columns : [['course id', 'number'], ['author id', 'number'], ['subject id', 'number'], ['course name', 'text'], ['course description', 'text']]

 -- Table: student course enrolment 
columns : [['registration id', 'number'], ['student id', 'number'], ['course id', 'number'], ['date of enrolment', 'time'], ['date of completion', 'time']]

 -- Table: student tests taken 
columns : [['registration id', 'number'], ['date test taken', 'time'], ['test result', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Find the subject ID, subject name, and the corresponding number of available courses for each subject.
SQL: 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
-- Language PostgreSQL
        -- Tables: 
             -- Table: course authors and tutors 
columns : [['author id', 'number'], ['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']]

 -- Table: students 
columns : [['student id', 'number'], ['date of registration', 'time'], ['date of latest logon', 'time'], ['login name', 'text'], ['password', 'text'], ['personal name', 'text'], ['middle name', 'text'], ['family name', 'text']]

 -- Table: subjects 
columns : [['subject id', 'number'], ['subject name', 'text']]

 -- Table: courses 
columns : [['course id', 'number'], ['author id', 'number'], ['subject id', 'number'], ['course name', 'text'], ['course description', 'text']]

 -- Table: student course enrolment 
columns : [['registration id', 'number'], ['student id', 'number'], ['course id', 'number'], ['date of enrolment', 'time'], ['date of completion', 'time']]

 -- Table: student tests taken 
columns : [['registration id', 'number'], ['date test taken', 'time'], ['test result', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the subject ID, subject name, and the number of available courses for each subject?
SQL: 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
-- Language PostgreSQL
        -- Tables: 
             -- Table: course authors and tutors 
columns : [['author id', 'number'], ['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']]

 -- Table: students 
columns : [['student id', 'number'], ['date of registration', 'time'], ['date of latest logon', 'time'], ['login name', 'text'], ['password', 'text'], ['personal name', 'text'], ['middle name', 'text'], ['family name', 'text']]

 -- Table: subjects 
columns : [['subject id', 'number'], ['subject name', 'text']]

 -- Table: courses 
columns : [['course id', 'number'], ['author id', 'number'], ['subject id', 'number'], ['course name', 'text'], ['course description', 'text']]

 -- Table: student course enrolment 
columns : [['registration id', 'number'], ['student id', 'number'], ['course id', 'number'], ['date of enrolment', 'time'], ['date of completion', 'time']]

 -- Table: student tests taken 
columns : [['registration id', 'number'], ['date test taken', 'time'], ['test result', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



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.
SQL: 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
-- Language PostgreSQL
        -- Tables: 
             -- Table: course authors and tutors 
columns : [['author id', 'number'], ['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']]

 -- Table: students 
columns : [['student id', 'number'], ['date of registration', 'time'], ['date of latest logon', 'time'], ['login name', 'text'], ['password', 'text'], ['personal name', 'text'], ['middle name', 'text'], ['family name', 'text']]

 -- Table: subjects 
columns : [['subject id', 'number'], ['subject name', 'text']]

 -- Table: courses 
columns : [['course id', 'number'], ['author id', 'number'], ['subject id', 'number'], ['course name', 'text'], ['course description', 'text']]

 -- Table: student course enrolment 
columns : [['registration id', 'number'], ['student id', 'number'], ['course id', 'number'], ['date of enrolment', 'time'], ['date of completion', 'time']]

 -- Table: student tests taken 
columns : [['registration id', 'number'], ['date test taken', 'time'], ['test result', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: List the subject ID, name of subject and the number of courses available for each subject in ascending order of the course counts.
SQL: 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
-- Language PostgreSQL
        -- Tables: 
             -- Table: course authors and tutors 
columns : [['author id', 'number'], ['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']]

 -- Table: students 
columns : [['student id', 'number'], ['date of registration', 'time'], ['date of latest logon', 'time'], ['login name', 'text'], ['password', 'text'], ['personal name', 'text'], ['middle name', 'text'], ['family name', 'text']]

 -- Table: subjects 
columns : [['subject id', 'number'], ['subject name', 'text']]

 -- Table: courses 
columns : [['course id', 'number'], ['author id', 'number'], ['subject id', 'number'], ['course name', 'text'], ['course description', 'text']]

 -- Table: student course enrolment 
columns : [['registration id', 'number'], ['student id', 'number'], ['course id', 'number'], ['date of enrolment', 'time'], ['date of completion', 'time']]

 -- Table: student tests taken 
columns : [['registration id', 'number'], ['date test taken', 'time'], ['test result', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What is the date of enrollment of the course named "Spanish"?
SQL: 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"
-- Language PostgreSQL
        -- Tables: 
             -- Table: course authors and tutors 
columns : [['author id', 'number'], ['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']]

 -- Table: students 
columns : [['student id', 'number'], ['date of registration', 'time'], ['date of latest logon', 'time'], ['login name', 'text'], ['password', 'text'], ['personal name', 'text'], ['middle name', 'text'], ['family name', 'text']]

 -- Table: subjects 
columns : [['subject id', 'number'], ['subject name', 'text']]

 -- Table: courses 
columns : [['course id', 'number'], ['author id', 'number'], ['subject id', 'number'], ['course name', 'text'], ['course description', 'text']]

 -- Table: student course enrolment 
columns : [['registration id', 'number'], ['student id', 'number'], ['course id', 'number'], ['date of enrolment', 'time'], ['date of completion', 'time']]

 -- Table: student tests taken 
columns : [['registration id', 'number'], ['date test taken', 'time'], ['test result', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Find the the date of enrollment of the "Spanish" course.
SQL: 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"
-- Language PostgreSQL
        -- Tables: 
             -- Table: course authors and tutors 
columns : [['author id', 'number'], ['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']]

 -- Table: students 
columns : [['student id', 'number'], ['date of registration', 'time'], ['date of latest logon', 'time'], ['login name', 'text'], ['password', 'text'], ['personal name', 'text'], ['middle name', 'text'], ['family name', 'text']]

 -- Table: subjects 
columns : [['subject id', 'number'], ['subject name', 'text']]

 -- Table: courses 
columns : [['course id', 'number'], ['author id', 'number'], ['subject id', 'number'], ['course name', 'text'], ['course description', 'text']]

 -- Table: student course enrolment 
columns : [['registration id', 'number'], ['student id', 'number'], ['course id', 'number'], ['date of enrolment', 'time'], ['date of completion', 'time']]

 -- Table: student tests taken 
columns : [['registration id', 'number'], ['date test taken', 'time'], ['test result', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What is the name of the course that has the most student enrollment?
SQL: 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
-- Language PostgreSQL
        -- Tables: 
             -- Table: course authors and tutors 
columns : [['author id', 'number'], ['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']]

 -- Table: students 
columns : [['student id', 'number'], ['date of registration', 'time'], ['date of latest logon', 'time'], ['login name', 'text'], ['password', 'text'], ['personal name', 'text'], ['middle name', 'text'], ['family name', 'text']]

 -- Table: subjects 
columns : [['subject id', 'number'], ['subject name', 'text']]

 -- Table: courses 
columns : [['course id', 'number'], ['author id', 'number'], ['subject id', 'number'], ['course name', 'text'], ['course description', 'text']]

 -- Table: student course enrolment 
columns : [['registration id', 'number'], ['student id', 'number'], ['course id', 'number'], ['date of enrolment', 'time'], ['date of completion', 'time']]

 -- Table: student tests taken 
columns : [['registration id', 'number'], ['date test taken', 'time'], ['test result', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Which course is enrolled in by the most students? Give me the course name.
SQL: 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
-- Language PostgreSQL
        -- Tables: 
             -- Table: course authors and tutors 
columns : [['author id', 'number'], ['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']]

 -- Table: students 
columns : [['student id', 'number'], ['date of registration', 'time'], ['date of latest logon', 'time'], ['login name', 'text'], ['password', 'text'], ['personal name', 'text'], ['middle name', 'text'], ['family name', 'text']]

 -- Table: subjects 
columns : [['subject id', 'number'], ['subject name', 'text']]

 -- Table: courses 
columns : [['course id', 'number'], ['author id', 'number'], ['subject id', 'number'], ['course name', 'text'], ['course description', 'text']]

 -- Table: student course enrolment 
columns : [['registration id', 'number'], ['student id', 'number'], ['course id', 'number'], ['date of enrolment', 'time'], ['date of completion', 'time']]

 -- Table: student tests taken 
columns : [['registration id', 'number'], ['date test taken', 'time'], ['test result', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the names of the courses that have exactly 1 student enrollment?
SQL: 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
-- Language PostgreSQL
        -- Tables: 
             -- Table: course authors and tutors 
columns : [['author id', 'number'], ['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']]

 -- Table: students 
columns : [['student id', 'number'], ['date of registration', 'time'], ['date of latest logon', 'time'], ['login name', 'text'], ['password', 'text'], ['personal name', 'text'], ['middle name', 'text'], ['family name', 'text']]

 -- Table: subjects 
columns : [['subject id', 'number'], ['subject name', 'text']]

 -- Table: courses 
columns : [['course id', 'number'], ['author id', 'number'], ['subject id', 'number'], ['course name', 'text'], ['course description', 'text']]

 -- Table: student course enrolment 
columns : [['registration id', 'number'], ['student id', 'number'], ['course id', 'number'], ['date of enrolment', 'time'], ['date of completion', 'time']]

 -- Table: student tests taken 
columns : [['registration id', 'number'], ['date test taken', 'time'], ['test result', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Find the names of the courses that have just one student enrollment.
SQL: 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
-- Language PostgreSQL
        -- Tables: 
             -- Table: course authors and tutors 
columns : [['author id', 'number'], ['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']]

 -- Table: students 
columns : [['student id', 'number'], ['date of registration', 'time'], ['date of latest logon', 'time'], ['login name', 'text'], ['password', 'text'], ['personal name', 'text'], ['middle name', 'text'], ['family name', 'text']]

 -- Table: subjects 
columns : [['subject id', 'number'], ['subject name', 'text']]

 -- Table: courses 
columns : [['course id', 'number'], ['author id', 'number'], ['subject id', 'number'], ['course name', 'text'], ['course description', 'text']]

 -- Table: student course enrolment 
columns : [['registration id', 'number'], ['student id', 'number'], ['course id', 'number'], ['date of enrolment', 'time'], ['date of completion', 'time']]

 -- Table: student tests taken 
columns : [['registration id', 'number'], ['date test taken', 'time'], ['test result', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the descriptions and names of the courses that have student enrollment bigger than 2?
SQL: 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
-- Language PostgreSQL
        -- Tables: 
             -- Table: course authors and tutors 
columns : [['author id', 'number'], ['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']]

 -- Table: students 
columns : [['student id', 'number'], ['date of registration', 'time'], ['date of latest logon', 'time'], ['login name', 'text'], ['password', 'text'], ['personal name', 'text'], ['middle name', 'text'], ['family name', 'text']]

 -- Table: subjects 
columns : [['subject id', 'number'], ['subject name', 'text']]

 -- Table: courses 
columns : [['course id', 'number'], ['author id', 'number'], ['subject id', 'number'], ['course name', 'text'], ['course description', 'text']]

 -- Table: student course enrolment 
columns : [['registration id', 'number'], ['student id', 'number'], ['course id', 'number'], ['date of enrolment', 'time'], ['date of completion', 'time']]

 -- Table: student tests taken 
columns : [['registration id', 'number'], ['date test taken', 'time'], ['test result', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Return the descriptions and names of the courses that have more than two students enrolled in.
SQL: 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
-- Language PostgreSQL
        -- Tables: 
             -- Table: course authors and tutors 
columns : [['author id', 'number'], ['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']]

 -- Table: students 
columns : [['student id', 'number'], ['date of registration', 'time'], ['date of latest logon', 'time'], ['login name', 'text'], ['password', 'text'], ['personal name', 'text'], ['middle name', 'text'], ['family name', 'text']]

 -- Table: subjects 
columns : [['subject id', 'number'], ['subject name', 'text']]

 -- Table: courses 
columns : [['course id', 'number'], ['author id', 'number'], ['subject id', 'number'], ['course name', 'text'], ['course description', 'text']]

 -- Table: student course enrolment 
columns : [['registration id', 'number'], ['student id', 'number'], ['course id', 'number'], ['date of enrolment', 'time'], ['date of completion', 'time']]

 -- Table: student tests taken 
columns : [['registration id', 'number'], ['date test taken', 'time'], ['test result', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What is the name of each course and the corresponding number of student enrollment?
SQL: 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
-- Language PostgreSQL
        -- Tables: 
             -- Table: course authors and tutors 
columns : [['author id', 'number'], ['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']]

 -- Table: students 
columns : [['student id', 'number'], ['date of registration', 'time'], ['date of latest logon', 'time'], ['login name', 'text'], ['password', 'text'], ['personal name', 'text'], ['middle name', 'text'], ['family name', 'text']]

 -- Table: subjects 
columns : [['subject id', 'number'], ['subject name', 'text']]

 -- Table: courses 
columns : [['course id', 'number'], ['author id', 'number'], ['subject id', 'number'], ['course name', 'text'], ['course description', 'text']]

 -- Table: student course enrolment 
columns : [['registration id', 'number'], ['student id', 'number'], ['course id', 'number'], ['date of enrolment', 'time'], ['date of completion', 'time']]

 -- Table: student tests taken 
columns : [['registration id', 'number'], ['date test taken', 'time'], ['test result', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: List the name and the number of enrolled student for each course.
SQL: 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
-- Language PostgreSQL
        -- Tables: 
             -- Table: course authors and tutors 
columns : [['author id', 'number'], ['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']]

 -- Table: students 
columns : [['student id', 'number'], ['date of registration', 'time'], ['date of latest logon', 'time'], ['login name', 'text'], ['password', 'text'], ['personal name', 'text'], ['middle name', 'text'], ['family name', 'text']]

 -- Table: subjects 
columns : [['subject id', 'number'], ['subject name', 'text']]

 -- Table: courses 
columns : [['course id', 'number'], ['author id', 'number'], ['subject id', 'number'], ['course name', 'text'], ['course description', 'text']]

 -- Table: student course enrolment 
columns : [['registration id', 'number'], ['student id', 'number'], ['course id', 'number'], ['date of enrolment', 'time'], ['date of completion', 'time']]

 -- Table: student tests taken 
columns : [['registration id', 'number'], ['date test taken', 'time'], ['test result', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the enrollment dates of all the tests that have result "Pass"?
SQL: 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"
-- Language PostgreSQL
        -- Tables: 
             -- Table: course authors and tutors 
columns : [['author id', 'number'], ['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']]

 -- Table: students 
columns : [['student id', 'number'], ['date of registration', 'time'], ['date of latest logon', 'time'], ['login name', 'text'], ['password', 'text'], ['personal name', 'text'], ['middle name', 'text'], ['family name', 'text']]

 -- Table: subjects 
columns : [['subject id', 'number'], ['subject name', 'text']]

 -- Table: courses 
columns : [['course id', 'number'], ['author id', 'number'], ['subject id', 'number'], ['course name', 'text'], ['course description', 'text']]

 -- Table: student course enrolment 
columns : [['registration id', 'number'], ['student id', 'number'], ['course id', 'number'], ['date of enrolment', 'time'], ['date of completion', 'time']]

 -- Table: student tests taken 
columns : [['registration id', 'number'], ['date test taken', 'time'], ['test result', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Find the enrollment date for all the tests that have "Pass" result.
SQL: 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"
-- Language PostgreSQL
        -- Tables: 
             -- Table: course authors and tutors 
columns : [['author id', 'number'], ['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']]

 -- Table: students 
columns : [['student id', 'number'], ['date of registration', 'time'], ['date of latest logon', 'time'], ['login name', 'text'], ['password', 'text'], ['personal name', 'text'], ['middle name', 'text'], ['family name', 'text']]

 -- Table: subjects 
columns : [['subject id', 'number'], ['subject name', 'text']]

 -- Table: courses 
columns : [['course id', 'number'], ['author id', 'number'], ['subject id', 'number'], ['course name', 'text'], ['course description', 'text']]

 -- Table: student course enrolment 
columns : [['registration id', 'number'], ['student id', 'number'], ['course id', 'number'], ['date of enrolment', 'time'], ['date of completion', 'time']]

 -- Table: student tests taken 
columns : [['registration id', 'number'], ['date test taken', 'time'], ['test result', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the completion dates of all the tests that have result "Fail"?
SQL: SELECT T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id  =  T2.registration_id WHERE T2.test_result  =  "Fail"
-- Language PostgreSQL
        -- Tables: 
             -- Table: course authors and tutors 
columns : [['author id', 'number'], ['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']]

 -- Table: students 
columns : [['student id', 'number'], ['date of registration', 'time'], ['date of latest logon', 'time'], ['login name', 'text'], ['password', 'text'], ['personal name', 'text'], ['middle name', 'text'], ['family name', 'text']]

 -- Table: subjects 
columns : [['subject id', 'number'], ['subject name', 'text']]

 -- Table: courses 
columns : [['course id', 'number'], ['author id', 'number'], ['subject id', 'number'], ['course name', 'text'], ['course description', 'text']]

 -- Table: student course enrolment 
columns : [['registration id', 'number'], ['student id', 'number'], ['course id', 'number'], ['date of enrolment', 'time'], ['date of completion', 'time']]

 -- Table: student tests taken 
columns : [['registration id', 'number'], ['date test taken', 'time'], ['test result', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Return the completion date for all the tests that have "Fail" result.
SQL: SELECT T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id  =  T2.registration_id WHERE T2.test_result  =  "Fail"
-- Language PostgreSQL
        -- Tables: 
             -- Table: course authors and tutors 
columns : [['author id', 'number'], ['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']]

 -- Table: students 
columns : [['student id', 'number'], ['date of registration', 'time'], ['date of latest logon', 'time'], ['login name', 'text'], ['password', 'text'], ['personal name', 'text'], ['middle name', 'text'], ['family name', 'text']]

 -- Table: subjects 
columns : [['subject id', 'number'], ['subject name', 'text']]

 -- Table: courses 
columns : [['course id', 'number'], ['author id', 'number'], ['subject id', 'number'], ['course name', 'text'], ['course description', 'text']]

 -- Table: student course enrolment 
columns : [['registration id', 'number'], ['student id', 'number'], ['course id', 'number'], ['date of enrolment', 'time'], ['date of completion', 'time']]

 -- Table: student tests taken 
columns : [['registration id', 'number'], ['date test taken', 'time'], ['test result', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: List the dates of enrollment and completion of the student with personal name "Karson".
SQL: SELECT T1.date_of_enrolment ,  T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id  =  T2.student_id WHERE T2.personal_name  =  "Karson"
-- Language PostgreSQL
        -- Tables: 
             -- Table: course authors and tutors 
columns : [['author id', 'number'], ['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']]

 -- Table: students 
columns : [['student id', 'number'], ['date of registration', 'time'], ['date of latest logon', 'time'], ['login name', 'text'], ['password', 'text'], ['personal name', 'text'], ['middle name', 'text'], ['family name', 'text']]

 -- Table: subjects 
columns : [['subject id', 'number'], ['subject name', 'text']]

 -- Table: courses 
columns : [['course id', 'number'], ['author id', 'number'], ['subject id', 'number'], ['course name', 'text'], ['course description', 'text']]

 -- Table: student course enrolment 
columns : [['registration id', 'number'], ['student id', 'number'], ['course id', 'number'], ['date of enrolment', 'time'], ['date of completion', 'time']]

 -- Table: student tests taken 
columns : [['registration id', 'number'], ['date test taken', 'time'], ['test result', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: On what dates did the student whose personal name is "Karson" enroll in and complete the courses?
SQL: SELECT T1.date_of_enrolment ,  T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id  =  T2.student_id WHERE T2.personal_name  =  "Karson"
-- Language PostgreSQL
        -- Tables: 
             -- Table: course authors and tutors 
columns : [['author id', 'number'], ['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']]

 -- Table: students 
columns : [['student id', 'number'], ['date of registration', 'time'], ['date of latest logon', 'time'], ['login name', 'text'], ['password', 'text'], ['personal name', 'text'], ['middle name', 'text'], ['family name', 'text']]

 -- Table: subjects 
columns : [['subject id', 'number'], ['subject name', 'text']]

 -- Table: courses 
columns : [['course id', 'number'], ['author id', 'number'], ['subject id', 'number'], ['course name', 'text'], ['course description', 'text']]

 -- Table: student course enrolment 
columns : [['registration id', 'number'], ['student id', 'number'], ['course id', 'number'], ['date of enrolment', 'time'], ['date of completion', 'time']]

 -- Table: student tests taken 
columns : [['registration id', 'number'], ['date test taken', 'time'], ['test result', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: List the dates of enrollment and completion of the student with family name "Zieme" and personal name "Bernie".
SQL: SELECT T1.date_of_enrolment ,  T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id  =  T2.student_id WHERE T2.family_name  =  "Zieme" AND T2.personal_name  =  "Bernie"
-- Language PostgreSQL
        -- Tables: 
             -- Table: course authors and tutors 
columns : [['author id', 'number'], ['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']]

 -- Table: students 
columns : [['student id', 'number'], ['date of registration', 'time'], ['date of latest logon', 'time'], ['login name', 'text'], ['password', 'text'], ['personal name', 'text'], ['middle name', 'text'], ['family name', 'text']]

 -- Table: subjects 
columns : [['subject id', 'number'], ['subject name', 'text']]

 -- Table: courses 
columns : [['course id', 'number'], ['author id', 'number'], ['subject id', 'number'], ['course name', 'text'], ['course description', 'text']]

 -- Table: student course enrolment 
columns : [['registration id', 'number'], ['student id', 'number'], ['course id', 'number'], ['date of enrolment', 'time'], ['date of completion', 'time']]

 -- Table: student tests taken 
columns : [['registration id', 'number'], ['date test taken', 'time'], ['test result', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: On what dates did the student with family name "Zieme" and personal name "Bernie" enroll in and complete the courses?
SQL: SELECT T1.date_of_enrolment ,  T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id  =  T2.student_id WHERE T2.family_name  =  "Zieme" AND T2.personal_name  =  "Bernie"
-- Language PostgreSQL
        -- Tables: 
             -- Table: course authors and tutors 
columns : [['author id', 'number'], ['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']]

 -- Table: students 
columns : [['student id', 'number'], ['date of registration', 'time'], ['date of latest logon', 'time'], ['login name', 'text'], ['password', 'text'], ['personal name', 'text'], ['middle name', 'text'], ['family name', 'text']]

 -- Table: subjects 
columns : [['subject id', 'number'], ['subject name', 'text']]

 -- Table: courses 
columns : [['course id', 'number'], ['author id', 'number'], ['subject id', 'number'], ['course name', 'text'], ['course description', 'text']]

 -- Table: student course enrolment 
columns : [['registration id', 'number'], ['student id', 'number'], ['course id', 'number'], ['date of enrolment', 'time'], ['date of completion', 'time']]

 -- Table: student tests taken 
columns : [['registration id', 'number'], ['date test taken', 'time'], ['test result', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Find the student ID and login name of the student with the most course enrollments
SQL: SELECT T1.student_id ,  T2.login_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id  =  T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: course authors and tutors 
columns : [['author id', 'number'], ['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']]

 -- Table: students 
columns : [['student id', 'number'], ['date of registration', 'time'], ['date of latest logon', 'time'], ['login name', 'text'], ['password', 'text'], ['personal name', 'text'], ['middle name', 'text'], ['family name', 'text']]

 -- Table: subjects 
columns : [['subject id', 'number'], ['subject name', 'text']]

 -- Table: courses 
columns : [['course id', 'number'], ['author id', 'number'], ['subject id', 'number'], ['course name', 'text'], ['course description', 'text']]

 -- Table: student course enrolment 
columns : [['registration id', 'number'], ['student id', 'number'], ['course id', 'number'], ['date of enrolment', 'time'], ['date of completion', 'time']]

 -- Table: student tests taken 
columns : [['registration id', 'number'], ['date test taken', 'time'], ['test result', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the student ID and login name of the student who are enrolled in the most courses?
SQL: SELECT T1.student_id ,  T2.login_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id  =  T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: course authors and tutors 
columns : [['author id', 'number'], ['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']]

 -- Table: students 
columns : [['student id', 'number'], ['date of registration', 'time'], ['date of latest logon', 'time'], ['login name', 'text'], ['password', 'text'], ['personal name', 'text'], ['middle name', 'text'], ['family name', 'text']]

 -- Table: subjects 
columns : [['subject id', 'number'], ['subject name', 'text']]

 -- Table: courses 
columns : [['course id', 'number'], ['author id', 'number'], ['subject id', 'number'], ['course name', 'text'], ['course description', 'text']]

 -- Table: student course enrolment 
columns : [['registration id', 'number'], ['student id', 'number'], ['course id', 'number'], ['date of enrolment', 'time'], ['date of completion', 'time']]

 -- Table: student tests taken 
columns : [['registration id', 'number'], ['date test taken', 'time'], ['test result', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Find the student ID and personal name of the student with at least two enrollments.
SQL: SELECT T1.student_id ,  T2.personal_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id  =  T2.student_id GROUP BY T1.student_id HAVING COUNT(*)  >=  2
-- Language PostgreSQL
        -- Tables: 
             -- Table: course authors and tutors 
columns : [['author id', 'number'], ['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']]

 -- Table: students 
columns : [['student id', 'number'], ['date of registration', 'time'], ['date of latest logon', 'time'], ['login name', 'text'], ['password', 'text'], ['personal name', 'text'], ['middle name', 'text'], ['family name', 'text']]

 -- Table: subjects 
columns : [['subject id', 'number'], ['subject name', 'text']]

 -- Table: courses 
columns : [['course id', 'number'], ['author id', 'number'], ['subject id', 'number'], ['course name', 'text'], ['course description', 'text']]

 -- Table: student course enrolment 
columns : [['registration id', 'number'], ['student id', 'number'], ['course id', 'number'], ['date of enrolment', 'time'], ['date of completion', 'time']]

 -- Table: student tests taken 
columns : [['registration id', 'number'], ['date test taken', 'time'], ['test result', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Which student are enrolled in at least two courses? Give me the student ID and personal name.
SQL: SELECT T1.student_id ,  T2.personal_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id  =  T2.student_id GROUP BY T1.student_id HAVING COUNT(*)  >=  2