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 number of distinct courses that have enrolled students.
SQL: SELECT count(course_id) FROM Student_Course_Enrolment
-- 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 dates of the tests taken with result "Pass".
SQL: SELECT date_test_taken FROM Student_Tests_Taken WHERE 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: Which tests have "Pass" results? Return the dates when the tests were taken.
SQL: SELECT date_test_taken FROM Student_Tests_Taken WHERE 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: How many tests have result "Fail"?
SQL: SELECT count(*) FROM Student_Tests_Taken WHERE 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: Count the number of tests with "Fail" result.
SQL: SELECT count(*) FROM Student_Tests_Taken WHERE 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: What are the login names of the students with family name "Ward"?
SQL: SELECT login_name FROM Students WHERE family_name  =  "Ward"
-- 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 login names of the students whose family name is "Ward".
SQL: SELECT login_name FROM Students WHERE family_name  =  "Ward"
-- 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 dates of the latest logon of the students with family name "Jaskolski" or "Langosh"?
SQL: SELECT date_of_latest_logon FROM Students WHERE family_name  =  "Jaskolski" OR family_name  =  "Langosh"
-- 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 latest logon date of the students whose family name is "Jaskolski" or "Langosh".
SQL: SELECT date_of_latest_logon FROM Students WHERE family_name  =  "Jaskolski" OR family_name  =  "Langosh"
-- 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: How many students have personal names that contain the word "son"?
SQL: SELECT COUNT(*) FROM Students WHERE personal_name LIKE "%son%"
-- 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 number of students who have the word "son" in their personal names.
SQL: SELECT COUNT(*) FROM Students WHERE personal_name LIKE "%son%"
-- 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 all the subject names.
SQL: SELECT subject_name FROM SUBJECTS
-- 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 all the subjects.
SQL: SELECT subject_name FROM SUBJECTS
-- 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 all the information about course authors and tutors in alphabetical order of the personal name.
SQL: SELECT * FROM Course_Authors_and_Tutors ORDER BY personal_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: Sort the information about course authors and tutors in alphabetical order of the personal name.
SQL: SELECT * FROM Course_Authors_and_Tutors ORDER BY personal_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 personal names and family names of all the students in alphabetical order of family name.
SQL: SELECT personal_name ,  family_name FROM Students ORDER BY family_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 personal names and family names of the students? Sort the result in alphabetical order of the family name.
SQL: SELECT personal_name ,  family_name FROM Students ORDER BY family_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 each test result and its count in descending order of count.
SQL: SELECT test_result ,  COUNT(*) FROM Student_Tests_Taken GROUP BY test_result ORDER BY COUNT(*) DESC
-- 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: For each distinct test result, find the number of students who got the result.
SQL: SELECT test_result ,  COUNT(*) FROM Student_Tests_Taken GROUP BY test_result ORDER BY COUNT(*) DESC
-- 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 login name of the course author that teaches the course with name "advanced database".
SQL: 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"
-- 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 author teaches the "advanced database" course? Give me his or her login name.
SQL: 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"
-- 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 addresses of the course authors who teach the course with name "operating system" or "data structure".
SQL: 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"
-- 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 addresses of the course authors who teach either "operating system" or "data structure" course.
SQL: 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"
-- 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 personal name, family name, and author ID of the course author that teaches the most courses.
SQL: 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
-- 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 personal name, family name, and author ID of the course author who teaches the most courses?
SQL: 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
-- 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 addresses and author IDs of the course authors that teach at least two courses.
SQL: 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
-- 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 authors teach two or more courses? Give me their addresses and author IDs.
SQL: 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
-- 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 courses taught by the tutor who has personal name "Julio".
SQL: 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"
-- 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 taught by the tutor whose personal name is "Julio"?
SQL: 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"