sert121/SpiderSQL huggingface dataset:
-- Language PostgreSQL
        -- Tables: 
             -- Table: program 
columns : [['program id', 'number'], ['name', 'text'], ['origin', 'text'], ['launch', 'number'], ['owner', 'text']]

 -- Table: channel 
columns : [['channel id', 'number'], ['name', 'text'], ['owner', 'text'], ['share in percent', 'number'], ['rating in percent', 'number']]

 -- Table: broadcast 
columns : [['channel id', 'number'], ['program id', 'number'], ['time of day', 'text']]

 -- Table: broadcast share 
columns : [['channel id', 'number'], ['program id', 'number'], ['date', 'text'], ['share in percent', 'number']]

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 channels that broadcast in both morning and night?
SQL: SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id  =  t2.channel_id WHERE t2.time_of_day  =  'Morning' INTERSECT SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id  =  t2.channel_id WHERE t2.time_of_day  =  'Night'
-- Language PostgreSQL
        -- Tables: 
             -- Table: program 
columns : [['program id', 'number'], ['name', 'text'], ['origin', 'text'], ['launch', 'number'], ['owner', 'text']]

 -- Table: channel 
columns : [['channel id', 'number'], ['name', 'text'], ['owner', 'text'], ['share in percent', 'number'], ['rating in percent', 'number']]

 -- Table: broadcast 
columns : [['channel id', 'number'], ['program id', 'number'], ['time of day', 'text']]

 -- Table: broadcast share 
columns : [['channel id', 'number'], ['program id', 'number'], ['date', 'text'], ['share in percent', 'number']]

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 channels broadcast both in the morning and at night? Give me the channel names.
SQL: SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id  =  t2.channel_id WHERE t2.time_of_day  =  'Morning' INTERSECT SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id  =  t2.channel_id WHERE t2.time_of_day  =  'Night'
-- Language PostgreSQL
        -- Tables: 
             -- Table: program 
columns : [['program id', 'number'], ['name', 'text'], ['origin', 'text'], ['launch', 'number'], ['owner', 'text']]

 -- Table: channel 
columns : [['channel id', 'number'], ['name', 'text'], ['owner', 'text'], ['share in percent', 'number'], ['rating in percent', 'number']]

 -- Table: broadcast 
columns : [['channel id', 'number'], ['program id', 'number'], ['time of day', 'text']]

 -- Table: broadcast share 
columns : [['channel id', 'number'], ['program id', 'number'], ['date', 'text'], ['share in percent', 'number']]

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 programs are broadcast in each time section of the day?
SQL: SELECT count(*) ,  time_of_day FROM broadcast GROUP BY time_of_day
-- Language PostgreSQL
        -- Tables: 
             -- Table: program 
columns : [['program id', 'number'], ['name', 'text'], ['origin', 'text'], ['launch', 'number'], ['owner', 'text']]

 -- Table: channel 
columns : [['channel id', 'number'], ['name', 'text'], ['owner', 'text'], ['share in percent', 'number'], ['rating in percent', 'number']]

 -- Table: broadcast 
columns : [['channel id', 'number'], ['program id', 'number'], ['time of day', 'text']]

 -- Table: broadcast share 
columns : [['channel id', 'number'], ['program id', 'number'], ['date', 'text'], ['share in percent', 'number']]

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 programs broadcast for each time section of a day.
SQL: SELECT count(*) ,  time_of_day FROM broadcast GROUP BY time_of_day
-- Language PostgreSQL
        -- Tables: 
             -- Table: program 
columns : [['program id', 'number'], ['name', 'text'], ['origin', 'text'], ['launch', 'number'], ['owner', 'text']]

 -- Table: channel 
columns : [['channel id', 'number'], ['name', 'text'], ['owner', 'text'], ['share in percent', 'number'], ['rating in percent', 'number']]

 -- Table: broadcast 
columns : [['channel id', 'number'], ['program id', 'number'], ['time of day', 'text']]

 -- Table: broadcast share 
columns : [['channel id', 'number'], ['program id', 'number'], ['date', 'text'], ['share in percent', 'number']]

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 different programs that are broadcast during night time.
SQL: SELECT count(DISTINCT program_id) FROM broadcast WHERE time_of_day  =  'Night'
-- Language PostgreSQL
        -- Tables: 
             -- Table: program 
columns : [['program id', 'number'], ['name', 'text'], ['origin', 'text'], ['launch', 'number'], ['owner', 'text']]

 -- Table: channel 
columns : [['channel id', 'number'], ['name', 'text'], ['owner', 'text'], ['share in percent', 'number'], ['rating in percent', 'number']]

 -- Table: broadcast 
columns : [['channel id', 'number'], ['program id', 'number'], ['time of day', 'text']]

 -- Table: broadcast share 
columns : [['channel id', 'number'], ['program id', 'number'], ['date', 'text'], ['share in percent', 'number']]

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 distinct programs are broadcast at "Night" time?
SQL: SELECT count(DISTINCT program_id) FROM broadcast WHERE time_of_day  =  'Night'
-- Language PostgreSQL
        -- Tables: 
             -- Table: program 
columns : [['program id', 'number'], ['name', 'text'], ['origin', 'text'], ['launch', 'number'], ['owner', 'text']]

 -- Table: channel 
columns : [['channel id', 'number'], ['name', 'text'], ['owner', 'text'], ['share in percent', 'number'], ['rating in percent', 'number']]

 -- Table: broadcast 
columns : [['channel id', 'number'], ['program id', 'number'], ['time of day', 'text']]

 -- Table: broadcast share 
columns : [['channel id', 'number'], ['program id', 'number'], ['date', 'text'], ['share in percent', 'number']]

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 programs that are never broadcasted in the morning.
SQL: SELECT name FROM program EXCEPT SELECT t1.name FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id  =  t2.program_id WHERE t2.Time_of_day  =  "Morning"
-- Language PostgreSQL
        -- Tables: 
             -- Table: program 
columns : [['program id', 'number'], ['name', 'text'], ['origin', 'text'], ['launch', 'number'], ['owner', 'text']]

 -- Table: channel 
columns : [['channel id', 'number'], ['name', 'text'], ['owner', 'text'], ['share in percent', 'number'], ['rating in percent', 'number']]

 -- Table: broadcast 
columns : [['channel id', 'number'], ['program id', 'number'], ['time of day', 'text']]

 -- Table: broadcast share 
columns : [['channel id', 'number'], ['program id', 'number'], ['date', 'text'], ['share in percent', 'number']]

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 programs are never broadcasted in the morning? Give me the names of the programs.
SQL: SELECT name FROM program EXCEPT SELECT t1.name FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id  =  t2.program_id WHERE t2.Time_of_day  =  "Morning"
-- Language PostgreSQL
        -- Tables: 
             -- Table: program 
columns : [['program id', 'number'], ['name', 'text'], ['origin', 'text'], ['launch', 'number'], ['owner', 'text']]

 -- Table: channel 
columns : [['channel id', 'number'], ['name', 'text'], ['owner', 'text'], ['share in percent', 'number'], ['rating in percent', 'number']]

 -- Table: broadcast 
columns : [['channel id', 'number'], ['program id', 'number'], ['time of day', 'text']]

 -- Table: broadcast share 
columns : [['channel id', 'number'], ['program id', 'number'], ['date', 'text'], ['share in percent', 'number']]

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 program owners that have some programs in both morning and night time.
SQL: SELECT t1.owner FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id  =  t2.program_id WHERE t2.Time_of_day  =  "Morning" INTERSECT SELECT t1.owner FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id  =  t2.program_id WHERE t2.Time_of_day  =  "Night"
-- Language PostgreSQL
        -- Tables: 
             -- Table: program 
columns : [['program id', 'number'], ['name', 'text'], ['origin', 'text'], ['launch', 'number'], ['owner', 'text']]

 -- Table: channel 
columns : [['channel id', 'number'], ['name', 'text'], ['owner', 'text'], ['share in percent', 'number'], ['rating in percent', 'number']]

 -- Table: broadcast 
columns : [['channel id', 'number'], ['program id', 'number'], ['time of day', 'text']]

 -- Table: broadcast share 
columns : [['channel id', 'number'], ['program id', 'number'], ['date', 'text'], ['share in percent', 'number']]

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: Who are the owners of the programs that broadcast both in the morning and at night?
SQL: SELECT t1.owner FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id  =  t2.program_id WHERE t2.Time_of_day  =  "Morning" INTERSECT SELECT t1.owner FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id  =  t2.program_id WHERE t2.Time_of_day  =  "Night"
-- Language PostgreSQL
        -- Tables: 
             -- Table: program 
columns : [['program id', 'number'], ['name', 'text'], ['origin', 'text'], ['launch', 'number'], ['owner', 'text']]

 -- Table: channel 
columns : [['channel id', 'number'], ['name', 'text'], ['owner', 'text'], ['share in percent', 'number'], ['rating in percent', 'number']]

 -- Table: broadcast 
columns : [['channel id', 'number'], ['program id', 'number'], ['time of day', 'text']]

 -- Table: broadcast share 
columns : [['channel id', 'number'], ['program id', 'number'], ['date', 'text'], ['share in percent', 'number']]

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 program origins in the alphabetical order.
SQL: SELECT origin FROM program ORDER BY origin
-- Language PostgreSQL
        -- Tables: 
             -- Table: program 
columns : [['program id', 'number'], ['name', 'text'], ['origin', 'text'], ['launch', 'number'], ['owner', 'text']]

 -- Table: channel 
columns : [['channel id', 'number'], ['name', 'text'], ['owner', 'text'], ['share in percent', 'number'], ['rating in percent', 'number']]

 -- Table: broadcast 
columns : [['channel id', 'number'], ['program id', 'number'], ['time of day', 'text']]

 -- Table: broadcast share 
columns : [['channel id', 'number'], ['program id', 'number'], ['date', 'text'], ['share in percent', 'number']]

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 list of program origins ordered alphabetically?
SQL: SELECT origin FROM program ORDER BY origin
-- Language PostgreSQL
        -- Tables: 
             -- Table: program 
columns : [['program id', 'number'], ['name', 'text'], ['origin', 'text'], ['launch', 'number'], ['owner', 'text']]

 -- Table: channel 
columns : [['channel id', 'number'], ['name', 'text'], ['owner', 'text'], ['share in percent', 'number'], ['rating in percent', 'number']]

 -- Table: broadcast 
columns : [['channel id', 'number'], ['program id', 'number'], ['time of day', 'text']]

 -- Table: broadcast share 
columns : [['channel id', 'number'], ['program id', 'number'], ['date', 'text'], ['share in percent', 'number']]

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 number of different channel owners?
SQL: SELECT count(DISTINCT OWNER) FROM channel
-- Language PostgreSQL
        -- Tables: 
             -- Table: program 
columns : [['program id', 'number'], ['name', 'text'], ['origin', 'text'], ['launch', 'number'], ['owner', 'text']]

 -- Table: channel 
columns : [['channel id', 'number'], ['name', 'text'], ['owner', 'text'], ['share in percent', 'number'], ['rating in percent', 'number']]

 -- Table: broadcast 
columns : [['channel id', 'number'], ['program id', 'number'], ['time of day', 'text']]

 -- Table: broadcast share 
columns : [['channel id', 'number'], ['program id', 'number'], ['date', 'text'], ['share in percent', 'number']]

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 distinct channel owners.
SQL: SELECT count(DISTINCT OWNER) FROM channel
-- Language PostgreSQL
        -- Tables: 
             -- Table: program 
columns : [['program id', 'number'], ['name', 'text'], ['origin', 'text'], ['launch', 'number'], ['owner', 'text']]

 -- Table: channel 
columns : [['channel id', 'number'], ['name', 'text'], ['owner', 'text'], ['share in percent', 'number'], ['rating in percent', 'number']]

 -- Table: broadcast 
columns : [['channel id', 'number'], ['program id', 'number'], ['time of day', 'text']]

 -- Table: broadcast share 
columns : [['channel id', 'number'], ['program id', 'number'], ['date', 'text'], ['share in percent', 'number']]

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 programs whose origin is not in Beijing.
SQL: SELECT name FROM program WHERE origin != 'Beijing'
-- Language PostgreSQL
        -- Tables: 
             -- Table: program 
columns : [['program id', 'number'], ['name', 'text'], ['origin', 'text'], ['launch', 'number'], ['owner', 'text']]

 -- Table: channel 
columns : [['channel id', 'number'], ['name', 'text'], ['owner', 'text'], ['share in percent', 'number'], ['rating in percent', 'number']]

 -- Table: broadcast 
columns : [['channel id', 'number'], ['program id', 'number'], ['time of day', 'text']]

 -- Table: broadcast share 
columns : [['channel id', 'number'], ['program id', 'number'], ['date', 'text'], ['share in percent', 'number']]

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 programs' origins are not "Beijing"? Give me the program names.
SQL: SELECT name FROM program WHERE origin != 'Beijing'
-- Language PostgreSQL
        -- Tables: 
             -- Table: program 
columns : [['program id', 'number'], ['name', 'text'], ['origin', 'text'], ['launch', 'number'], ['owner', 'text']]

 -- Table: channel 
columns : [['channel id', 'number'], ['name', 'text'], ['owner', 'text'], ['share in percent', 'number'], ['rating in percent', 'number']]

 -- Table: broadcast 
columns : [['channel id', 'number'], ['program id', 'number'], ['time of day', 'text']]

 -- Table: broadcast share 
columns : [['channel id', 'number'], ['program id', 'number'], ['date', 'text'], ['share in percent', 'number']]

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 channels owned by CCTV or HBS?
SQL: SELECT name FROM channel WHERE OWNER  =  'CCTV' OR OWNER  =  'HBS'
-- Language PostgreSQL
        -- Tables: 
             -- Table: program 
columns : [['program id', 'number'], ['name', 'text'], ['origin', 'text'], ['launch', 'number'], ['owner', 'text']]

 -- Table: channel 
columns : [['channel id', 'number'], ['name', 'text'], ['owner', 'text'], ['share in percent', 'number'], ['rating in percent', 'number']]

 -- Table: broadcast 
columns : [['channel id', 'number'], ['program id', 'number'], ['time of day', 'text']]

 -- Table: broadcast share 
columns : [['channel id', 'number'], ['program id', 'number'], ['date', 'text'], ['share in percent', 'number']]

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 names of all the channels owned by either CCTV or HBS
SQL: SELECT name FROM channel WHERE OWNER  =  'CCTV' OR OWNER  =  'HBS'
-- Language PostgreSQL
        -- Tables: 
             -- Table: program 
columns : [['program id', 'number'], ['name', 'text'], ['origin', 'text'], ['launch', 'number'], ['owner', 'text']]

 -- Table: channel 
columns : [['channel id', 'number'], ['name', 'text'], ['owner', 'text'], ['share in percent', 'number'], ['rating in percent', 'number']]

 -- Table: broadcast 
columns : [['channel id', 'number'], ['program id', 'number'], ['time of day', 'text']]

 -- Table: broadcast share 
columns : [['channel id', 'number'], ['program id', 'number'], ['date', 'text'], ['share in percent', 'number']]

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 total rating ratio for each channel owner.
SQL: SELECT sum(Rating_in_percent) ,  OWNER FROM channel GROUP BY OWNER
-- Language PostgreSQL
        -- Tables: 
             -- Table: program 
columns : [['program id', 'number'], ['name', 'text'], ['origin', 'text'], ['launch', 'number'], ['owner', 'text']]

 -- Table: channel 
columns : [['channel id', 'number'], ['name', 'text'], ['owner', 'text'], ['share in percent', 'number'], ['rating in percent', 'number']]

 -- Table: broadcast 
columns : [['channel id', 'number'], ['program id', 'number'], ['time of day', 'text']]

 -- Table: broadcast share 
columns : [['channel id', 'number'], ['program id', 'number'], ['date', 'text'], ['share in percent', 'number']]

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 total rating of channel for each channel owner?
SQL: SELECT sum(Rating_in_percent) ,  OWNER FROM channel GROUP BY OWNER
-- Language PostgreSQL
        -- Tables: 
             -- Table: program 
columns : [['program id', 'number'], ['name', 'text'], ['origin', 'text'], ['launch', 'number'], ['owner', 'text']]

 -- Table: channel 
columns : [['channel id', 'number'], ['name', 'text'], ['owner', 'text'], ['share in percent', 'number'], ['rating in percent', 'number']]

 -- Table: broadcast 
columns : [['channel id', 'number'], ['program id', 'number'], ['time of day', 'text']]

 -- Table: broadcast share 
columns : [['channel id', 'number'], ['program id', 'number'], ['date', 'text'], ['share in percent', 'number']]

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 name of the program that is broadcast most frequently.
SQL: SELECT t1.name FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id  =  t2.program_id GROUP BY t2.program_id ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: program 
columns : [['program id', 'number'], ['name', 'text'], ['origin', 'text'], ['launch', 'number'], ['owner', 'text']]

 -- Table: channel 
columns : [['channel id', 'number'], ['name', 'text'], ['owner', 'text'], ['share in percent', 'number'], ['rating in percent', 'number']]

 -- Table: broadcast 
columns : [['channel id', 'number'], ['program id', 'number'], ['time of day', 'text']]

 -- Table: broadcast share 
columns : [['channel id', 'number'], ['program id', 'number'], ['date', 'text'], ['share in percent', 'number']]

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 program is broadcast most frequently? Give me the program name.
SQL: SELECT t1.name FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id  =  t2.program_id GROUP BY t2.program_id ORDER BY count(*) DESC LIMIT 1
-- 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 courses are there in total?
SQL: SELECT count(*) FROM COURSES
-- 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 total number of courses offered.
SQL: SELECT count(*) FROM COURSES
-- 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 of the courses with name "database"?
SQL: SELECT course_description FROM COURSES WHERE course_name  =  "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: Return the description for the courses named "database".
SQL: SELECT course_description FROM COURSES WHERE course_name  =  "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: What are the addresses of the course authors or tutors with personal name "Cathrine"
SQL: SELECT address_line_1 FROM Course_Authors_and_Tutors WHERE personal_name	 =  "Cathrine"
-- 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 addresses of the course authors or tutors whose personal name is "Cathrine".
SQL: SELECT address_line_1 FROM Course_Authors_and_Tutors WHERE personal_name	 =  "Cathrine"
-- 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 addresses of all the course authors or tutors.
SQL: SELECT address_line_1 FROM Course_Authors_and_Tutors
-- 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 address of each course author or tutor?
SQL: SELECT address_line_1 FROM Course_Authors_and_Tutors
-- 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 login names and family names of course author and tutors.
SQL: SELECT login_name ,  family_name FROM Course_Authors_and_Tutors
-- 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 and family names of course author and tutors?
SQL: SELECT login_name ,  family_name FROM Course_Authors_and_Tutors
-- 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 dates of enrollment and completion of students.
SQL: SELECT date_of_enrolment ,  date_of_completion 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: What are all the dates of enrollment and completion in record?
SQL: SELECT date_of_enrolment ,  date_of_completion 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: How many distinct students are enrolled in courses?
SQL: SELECT count(DISTINCT student_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 number of distinct students enrolled in courses.
SQL: SELECT count(DISTINCT student_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: How many distinct courses are enrolled in by students?
SQL: SELECT count(course_id) FROM Student_Course_Enrolment