sert121/SpiderSQL huggingface dataset:
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

 -- Table: department 
columns : [['department number', 'number'], ['division', 'text'], ['department name', 'text'], ['room', 'text'], ['building', 'text'], ['department phone', 'number']]

 -- Table: member of 
columns : [['faculty id', 'number'], ['department number', 'number'], ['appt type', 'text']]

 -- Table: course 
columns : [['course id', 'text'], ['course name', 'text'], ['credits', 'number'], ['instructor', 'number'], ['days', 'text'], ['hours', 'text'], ['department number', 'number']]

 -- Table: minor in 
columns : [['student id', 'number'], ['department number', 'number']]

 -- Table: enrolled in 
columns : [['student id', 'number'], ['course id', 'text'], ['grade', 'text']]

 -- Table: grade conversion 
columns : [['letter grade', 'text'], ['grade point', '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 full names and gradepoints for all enrollments?
SQL: SELECT T3.Fname ,  T3.LName ,  T2.gradepoint FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade  =  T2.lettergrade AND T1.StuID  =  T3.StuID
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

 -- Table: department 
columns : [['department number', 'number'], ['division', 'text'], ['department name', 'text'], ['room', 'text'], ['building', 'text'], ['department phone', 'number']]

 -- Table: member of 
columns : [['faculty id', 'number'], ['department number', 'number'], ['appt type', 'text']]

 -- Table: course 
columns : [['course id', 'text'], ['course name', 'text'], ['credits', 'number'], ['instructor', 'number'], ['days', 'text'], ['hours', 'text'], ['department number', 'number']]

 -- Table: minor in 
columns : [['student id', 'number'], ['department number', 'number']]

 -- Table: enrolled in 
columns : [['student id', 'number'], ['course id', 'text'], ['grade', 'text']]

 -- Table: grade conversion 
columns : [['letter grade', 'text'], ['grade point', '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 distinct student first names of all students that have grade point at least 3.8 in one course.
SQL: SELECT DISTINCT T3.Fname FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade  =  T2.lettergrade AND T1.StuID  =  T3.StuID WHERE T2.gradepoint  >=  3.8
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

 -- Table: department 
columns : [['department number', 'number'], ['division', 'text'], ['department name', 'text'], ['room', 'text'], ['building', 'text'], ['department phone', 'number']]

 -- Table: member of 
columns : [['faculty id', 'number'], ['department number', 'number'], ['appt type', 'text']]

 -- Table: course 
columns : [['course id', 'text'], ['course name', 'text'], ['credits', 'number'], ['instructor', 'number'], ['days', 'text'], ['hours', 'text'], ['department number', 'number']]

 -- Table: minor in 
columns : [['student id', 'number'], ['department number', 'number']]

 -- Table: enrolled in 
columns : [['student id', 'number'], ['course id', 'text'], ['grade', 'text']]

 -- Table: grade conversion 
columns : [['letter grade', 'text'], ['grade point', '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 distinct first names for students with a grade point of 3.8 or above in at least one course?
SQL: SELECT DISTINCT T3.Fname FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade  =  T2.lettergrade AND T1.StuID  =  T3.StuID WHERE T2.gradepoint  >=  3.8
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

 -- Table: department 
columns : [['department number', 'number'], ['division', 'text'], ['department name', 'text'], ['room', 'text'], ['building', 'text'], ['department phone', 'number']]

 -- Table: member of 
columns : [['faculty id', 'number'], ['department number', 'number'], ['appt type', 'text']]

 -- Table: course 
columns : [['course id', 'text'], ['course name', 'text'], ['credits', 'number'], ['instructor', 'number'], ['days', 'text'], ['hours', 'text'], ['department number', 'number']]

 -- Table: minor in 
columns : [['student id', 'number'], ['department number', 'number']]

 -- Table: enrolled in 
columns : [['student id', 'number'], ['course id', 'text'], ['grade', 'text']]

 -- Table: grade conversion 
columns : [['letter grade', 'text'], ['grade point', '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 full names of faculties who are members of department with department number 520.
SQL: SELECT T1.Fname ,  T1.Lname FROM FACULTY AS T1 JOIN MEMBER_OF AS T2 ON T1.FacID  =  T2.FacID WHERE T2.DNO  =  520
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

 -- Table: department 
columns : [['department number', 'number'], ['division', 'text'], ['department name', 'text'], ['room', 'text'], ['building', 'text'], ['department phone', 'number']]

 -- Table: member of 
columns : [['faculty id', 'number'], ['department number', 'number'], ['appt type', 'text']]

 -- Table: course 
columns : [['course id', 'text'], ['course name', 'text'], ['credits', 'number'], ['instructor', 'number'], ['days', 'text'], ['hours', 'text'], ['department number', 'number']]

 -- Table: minor in 
columns : [['student id', 'number'], ['department number', 'number']]

 -- Table: enrolled in 
columns : [['student id', 'number'], ['course id', 'text'], ['grade', 'text']]

 -- Table: grade conversion 
columns : [['letter grade', 'text'], ['grade point', '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 full names of faculty members who are a part of department 520?
SQL: SELECT T1.Fname ,  T1.Lname FROM FACULTY AS T1 JOIN MEMBER_OF AS T2 ON T1.FacID  =  T2.FacID WHERE T2.DNO  =  520
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

 -- Table: department 
columns : [['department number', 'number'], ['division', 'text'], ['department name', 'text'], ['room', 'text'], ['building', 'text'], ['department phone', 'number']]

 -- Table: member of 
columns : [['faculty id', 'number'], ['department number', 'number'], ['appt type', 'text']]

 -- Table: course 
columns : [['course id', 'text'], ['course name', 'text'], ['credits', 'number'], ['instructor', 'number'], ['days', 'text'], ['hours', 'text'], ['department number', 'number']]

 -- Table: minor in 
columns : [['student id', 'number'], ['department number', 'number']]

 -- Table: enrolled in 
columns : [['student id', 'number'], ['course id', 'text'], ['grade', 'text']]

 -- Table: grade conversion 
columns : [['letter grade', 'text'], ['grade point', '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 first names and last names of the students that minor in the department with DNO 140.
SQL: SELECT T2.Fname ,  T2.Lname FROM MINOR_IN AS T1 JOIN STUDENT AS T2 ON T1.StuID  =  T2.StuID WHERE T1.DNO  =  140
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

 -- Table: department 
columns : [['department number', 'number'], ['division', 'text'], ['department name', 'text'], ['room', 'text'], ['building', 'text'], ['department phone', 'number']]

 -- Table: member of 
columns : [['faculty id', 'number'], ['department number', 'number'], ['appt type', 'text']]

 -- Table: course 
columns : [['course id', 'text'], ['course name', 'text'], ['credits', 'number'], ['instructor', 'number'], ['days', 'text'], ['hours', 'text'], ['department number', 'number']]

 -- Table: minor in 
columns : [['student id', 'number'], ['department number', 'number']]

 -- Table: enrolled in 
columns : [['student id', 'number'], ['course id', 'text'], ['grade', 'text']]

 -- Table: grade conversion 
columns : [['letter grade', 'text'], ['grade point', '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 full names of students minoring in department 140?
SQL: SELECT T2.Fname ,  T2.Lname FROM MINOR_IN AS T1 JOIN STUDENT AS T2 ON T1.StuID  =  T2.StuID WHERE T1.DNO  =  140
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

 -- Table: department 
columns : [['department number', 'number'], ['division', 'text'], ['department name', 'text'], ['room', 'text'], ['building', 'text'], ['department phone', 'number']]

 -- Table: member of 
columns : [['faculty id', 'number'], ['department number', 'number'], ['appt type', 'text']]

 -- Table: course 
columns : [['course id', 'text'], ['course name', 'text'], ['credits', 'number'], ['instructor', 'number'], ['days', 'text'], ['hours', 'text'], ['department number', 'number']]

 -- Table: minor in 
columns : [['student id', 'number'], ['department number', 'number']]

 -- Table: enrolled in 
columns : [['student id', 'number'], ['course id', 'text'], ['grade', 'text']]

 -- Table: grade conversion 
columns : [['letter grade', 'text'], ['grade point', '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 last names of faculties who are members of computer science department.
SQL: SELECT T2.Lname FROM DEPARTMENT AS T1 JOIN FACULTY AS T2 ON T1.DNO  =  T3.DNO JOIN MEMBER_OF AS T3 ON T2.FacID  =  T3.FacID WHERE T1.DName  =  "Computer Science"
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

 -- Table: department 
columns : [['department number', 'number'], ['division', 'text'], ['department name', 'text'], ['room', 'text'], ['building', 'text'], ['department phone', 'number']]

 -- Table: member of 
columns : [['faculty id', 'number'], ['department number', 'number'], ['appt type', 'text']]

 -- Table: course 
columns : [['course id', 'text'], ['course name', 'text'], ['credits', 'number'], ['instructor', 'number'], ['days', 'text'], ['hours', 'text'], ['department number', 'number']]

 -- Table: minor in 
columns : [['student id', 'number'], ['department number', 'number']]

 -- Table: enrolled in 
columns : [['student id', 'number'], ['course id', 'text'], ['grade', 'text']]

 -- Table: grade conversion 
columns : [['letter grade', 'text'], ['grade point', '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 last names of faculty who are part of the computer science department?
SQL: SELECT T2.Lname FROM DEPARTMENT AS T1 JOIN FACULTY AS T2 ON T1.DNO  =  T3.DNO JOIN MEMBER_OF AS T3 ON T2.FacID  =  T3.FacID WHERE T1.DName  =  "Computer Science"
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

 -- Table: department 
columns : [['department number', 'number'], ['division', 'text'], ['department name', 'text'], ['room', 'text'], ['building', 'text'], ['department phone', 'number']]

 -- Table: member of 
columns : [['faculty id', 'number'], ['department number', 'number'], ['appt type', 'text']]

 -- Table: course 
columns : [['course id', 'text'], ['course name', 'text'], ['credits', 'number'], ['instructor', 'number'], ['days', 'text'], ['hours', 'text'], ['department number', 'number']]

 -- Table: minor in 
columns : [['student id', 'number'], ['department number', 'number']]

 -- Table: enrolled in 
columns : [['student id', 'number'], ['course id', 'text'], ['grade', 'text']]

 -- Table: grade conversion 
columns : [['letter grade', 'text'], ['grade point', '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 average grade point of student whose last name is Smith.
SQL: SELECT avg(T2.gradepoint) FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade  =  T2.lettergrade AND T1.StuID  =  T3.StuID WHERE T3.LName  =  "Smith"
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

 -- Table: department 
columns : [['department number', 'number'], ['division', 'text'], ['department name', 'text'], ['room', 'text'], ['building', 'text'], ['department phone', 'number']]

 -- Table: member of 
columns : [['faculty id', 'number'], ['department number', 'number'], ['appt type', 'text']]

 -- Table: course 
columns : [['course id', 'text'], ['course name', 'text'], ['credits', 'number'], ['instructor', 'number'], ['days', 'text'], ['hours', 'text'], ['department number', 'number']]

 -- Table: minor in 
columns : [['student id', 'number'], ['department number', 'number']]

 -- Table: enrolled in 
columns : [['student id', 'number'], ['course id', 'text'], ['grade', 'text']]

 -- Table: grade conversion 
columns : [['letter grade', 'text'], ['grade point', '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 average gradepoint for students with the last name Smith?
SQL: SELECT avg(T2.gradepoint) FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade  =  T2.lettergrade AND T1.StuID  =  T3.StuID WHERE T3.LName  =  "Smith"
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

 -- Table: department 
columns : [['department number', 'number'], ['division', 'text'], ['department name', 'text'], ['room', 'text'], ['building', 'text'], ['department phone', 'number']]

 -- Table: member of 
columns : [['faculty id', 'number'], ['department number', 'number'], ['appt type', 'text']]

 -- Table: course 
columns : [['course id', 'text'], ['course name', 'text'], ['credits', 'number'], ['instructor', 'number'], ['days', 'text'], ['hours', 'text'], ['department number', 'number']]

 -- Table: minor in 
columns : [['student id', 'number'], ['department number', 'number']]

 -- Table: enrolled in 
columns : [['student id', 'number'], ['course id', 'text'], ['grade', 'text']]

 -- Table: grade conversion 
columns : [['letter grade', 'text'], ['grade point', '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 maximum and minimum grade point of students who live in NYC?
SQL: SELECT max(T2.gradepoint) ,  min(T2.gradepoint) FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade  =  T2.lettergrade AND T1.StuID  =  T3.StuID WHERE T3.city_code  =  "NYC"
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

 -- Table: department 
columns : [['department number', 'number'], ['division', 'text'], ['department name', 'text'], ['room', 'text'], ['building', 'text'], ['department phone', 'number']]

 -- Table: member of 
columns : [['faculty id', 'number'], ['department number', 'number'], ['appt type', 'text']]

 -- Table: course 
columns : [['course id', 'text'], ['course name', 'text'], ['credits', 'number'], ['instructor', 'number'], ['days', 'text'], ['hours', 'text'], ['department number', 'number']]

 -- Table: minor in 
columns : [['student id', 'number'], ['department number', 'number']]

 -- Table: enrolled in 
columns : [['student id', 'number'], ['course id', 'text'], ['grade', 'text']]

 -- Table: grade conversion 
columns : [['letter grade', 'text'], ['grade point', '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: Give the maximum and minimum gradepoints for students living in NYC?
SQL: SELECT max(T2.gradepoint) ,  min(T2.gradepoint) FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade  =  T2.lettergrade AND T1.StuID  =  T3.StuID WHERE T3.city_code  =  "NYC"
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

 -- Table: department 
columns : [['department number', 'number'], ['division', 'text'], ['department name', 'text'], ['room', 'text'], ['building', 'text'], ['department phone', 'number']]

 -- Table: member of 
columns : [['faculty id', 'number'], ['department number', 'number'], ['appt type', 'text']]

 -- Table: course 
columns : [['course id', 'text'], ['course name', 'text'], ['credits', 'number'], ['instructor', 'number'], ['days', 'text'], ['hours', 'text'], ['department number', 'number']]

 -- Table: minor in 
columns : [['student id', 'number'], ['department number', 'number']]

 -- Table: enrolled in 
columns : [['student id', 'number'], ['course id', 'text'], ['grade', 'text']]

 -- Table: grade conversion 
columns : [['letter grade', 'text'], ['grade point', '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 courses that have either 3 credits or 1 credit but 4 hours.
SQL: SELECT CName FROM COURSE WHERE Credits  =  3 UNION SELECT CName FROM COURSE WHERE Credits  =  1 AND Hours  =  4
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

 -- Table: department 
columns : [['department number', 'number'], ['division', 'text'], ['department name', 'text'], ['room', 'text'], ['building', 'text'], ['department phone', 'number']]

 -- Table: member of 
columns : [['faculty id', 'number'], ['department number', 'number'], ['appt type', 'text']]

 -- Table: course 
columns : [['course id', 'text'], ['course name', 'text'], ['credits', 'number'], ['instructor', 'number'], ['days', 'text'], ['hours', 'text'], ['department number', 'number']]

 -- Table: minor in 
columns : [['student id', 'number'], ['department number', 'number']]

 -- Table: enrolled in 
columns : [['student id', 'number'], ['course id', 'text'], ['grade', 'text']]

 -- Table: grade conversion 
columns : [['letter grade', 'text'], ['grade point', '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 courses that give either 3 credits, or 1 credit and 4 hours?
SQL: SELECT CName FROM COURSE WHERE Credits  =  3 UNION SELECT CName FROM COURSE WHERE Credits  =  1 AND Hours  =  4
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

 -- Table: department 
columns : [['department number', 'number'], ['division', 'text'], ['department name', 'text'], ['room', 'text'], ['building', 'text'], ['department phone', 'number']]

 -- Table: member of 
columns : [['faculty id', 'number'], ['department number', 'number'], ['appt type', 'text']]

 -- Table: course 
columns : [['course id', 'text'], ['course name', 'text'], ['credits', 'number'], ['instructor', 'number'], ['days', 'text'], ['hours', 'text'], ['department number', 'number']]

 -- Table: minor in 
columns : [['student id', 'number'], ['department number', 'number']]

 -- Table: enrolled in 
columns : [['student id', 'number'], ['course id', 'text'], ['grade', 'text']]

 -- Table: grade conversion 
columns : [['letter grade', 'text'], ['grade point', '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 departments that are either in division AS or in division EN and in Building NEB.
SQL: SELECT DName FROM DEPARTMENT WHERE Division  =  "AS" UNION SELECT DName FROM DEPARTMENT WHERE Division  =  "EN" AND Building  =  "NEB"
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

 -- Table: department 
columns : [['department number', 'number'], ['division', 'text'], ['department name', 'text'], ['room', 'text'], ['building', 'text'], ['department phone', 'number']]

 -- Table: member of 
columns : [['faculty id', 'number'], ['department number', 'number'], ['appt type', 'text']]

 -- Table: course 
columns : [['course id', 'text'], ['course name', 'text'], ['credits', 'number'], ['instructor', 'number'], ['days', 'text'], ['hours', 'text'], ['department number', 'number']]

 -- Table: minor in 
columns : [['student id', 'number'], ['department number', 'number']]

 -- Table: enrolled in 
columns : [['student id', 'number'], ['course id', 'text'], ['grade', 'text']]

 -- Table: grade conversion 
columns : [['letter grade', 'text'], ['grade point', '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 departments either in division AS, or in division EN and in building NEB?
SQL: SELECT DName FROM DEPARTMENT WHERE Division  =  "AS" UNION SELECT DName FROM DEPARTMENT WHERE Division  =  "EN" AND Building  =  "NEB"
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

 -- Table: department 
columns : [['department number', 'number'], ['division', 'text'], ['department name', 'text'], ['room', 'text'], ['building', 'text'], ['department phone', 'number']]

 -- Table: member of 
columns : [['faculty id', 'number'], ['department number', 'number'], ['appt type', 'text']]

 -- Table: course 
columns : [['course id', 'text'], ['course name', 'text'], ['credits', 'number'], ['instructor', 'number'], ['days', 'text'], ['hours', 'text'], ['department number', 'number']]

 -- Table: minor in 
columns : [['student id', 'number'], ['department number', 'number']]

 -- Table: enrolled in 
columns : [['student id', 'number'], ['course id', 'text'], ['grade', 'text']]

 -- Table: grade conversion 
columns : [['letter grade', 'text'], ['grade point', '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 first name of students not enrolled in any course.
SQL: SELECT Fname FROM STUDENT WHERE StuID NOT IN (SELECT StuID FROM ENROLLED_IN)
-- Language PostgreSQL
        -- Tables: 
             -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

 -- Table: department 
columns : [['department number', 'number'], ['division', 'text'], ['department name', 'text'], ['room', 'text'], ['building', 'text'], ['department phone', 'number']]

 -- Table: member of 
columns : [['faculty id', 'number'], ['department number', 'number'], ['appt type', 'text']]

 -- Table: course 
columns : [['course id', 'text'], ['course name', 'text'], ['credits', 'number'], ['instructor', 'number'], ['days', 'text'], ['hours', 'text'], ['department number', 'number']]

 -- Table: minor in 
columns : [['student id', 'number'], ['department number', 'number']]

 -- Table: enrolled in 
columns : [['student id', 'number'], ['course id', 'text'], ['grade', 'text']]

 -- Table: grade conversion 
columns : [['letter grade', 'text'], ['grade point', '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 first names of all students that are not enrolled in courses?
SQL: SELECT Fname FROM STUDENT WHERE StuID NOT IN (SELECT StuID FROM ENROLLED_IN)
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['address details', 'text']]

 -- Table: staff 
columns : [['staff id', 'number'], ['staff gender', 'text'], ['staff name', 'text']]

 -- Table: suppliers 
columns : [['supplier id', 'number'], ['supplier name', 'text'], ['supplier phone', 'text']]

 -- Table: department store chain 
columns : [['department store chain id', 'number'], ['department store chain name', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['payment method code', 'text'], ['customer code', 'text'], ['customer name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text']]

 -- Table: products 
columns : [['product id', 'number'], ['product type code', 'text'], ['product name', 'text'], ['product price', 'number']]

 -- Table: supplier addresses 
columns : [['supplier id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

 -- Table: customer addresses 
columns : [['customer id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

 -- Table: customer orders 
columns : [['order id', 'number'], ['customer id', 'number'], ['order status code', 'text'], ['order date', 'time']]

 -- Table: department stores 
columns : [['department store id', 'number'], ['department store chain id', 'number'], ['store name', 'text'], ['store address', 'text'], ['store phone', 'text'], ['store email', 'text']]

 -- Table: departments 
columns : [['department id', 'number'], ['department store id', 'number'], ['department name', 'text']]

 -- Table: order items 
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number']]

 -- Table: product suppliers 
columns : [['product id', 'number'], ['supplier id', 'number'], ['date supplied from', 'time'], ['date supplied to', 'time'], ['total amount purchased', 'text'], ['total value purchased', 'number']]

 -- Table: staff department assignments 
columns : [['staff id', 'number'], ['department id', 'number'], ['date assigned from', 'time'], ['job title code', 'text'], ['date assigned to', 'time']]

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 ids of the top three products that were purchased in the largest amount?
SQL: SELECT product_id FROM product_suppliers ORDER BY total_amount_purchased DESC LIMIT 3
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['address details', 'text']]

 -- Table: staff 
columns : [['staff id', 'number'], ['staff gender', 'text'], ['staff name', 'text']]

 -- Table: suppliers 
columns : [['supplier id', 'number'], ['supplier name', 'text'], ['supplier phone', 'text']]

 -- Table: department store chain 
columns : [['department store chain id', 'number'], ['department store chain name', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['payment method code', 'text'], ['customer code', 'text'], ['customer name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text']]

 -- Table: products 
columns : [['product id', 'number'], ['product type code', 'text'], ['product name', 'text'], ['product price', 'number']]

 -- Table: supplier addresses 
columns : [['supplier id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

 -- Table: customer addresses 
columns : [['customer id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

 -- Table: customer orders 
columns : [['order id', 'number'], ['customer id', 'number'], ['order status code', 'text'], ['order date', 'time']]

 -- Table: department stores 
columns : [['department store id', 'number'], ['department store chain id', 'number'], ['store name', 'text'], ['store address', 'text'], ['store phone', 'text'], ['store email', 'text']]

 -- Table: departments 
columns : [['department id', 'number'], ['department store id', 'number'], ['department name', 'text']]

 -- Table: order items 
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number']]

 -- Table: product suppliers 
columns : [['product id', 'number'], ['supplier id', 'number'], ['date supplied from', 'time'], ['date supplied to', 'time'], ['total amount purchased', 'text'], ['total value purchased', 'number']]

 -- Table: staff department assignments 
columns : [['staff id', 'number'], ['department id', 'number'], ['date assigned from', 'time'], ['job title code', 'text'], ['date assigned to', 'time']]

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: Give the ids of the three products purchased in the largest amounts.
SQL: SELECT product_id FROM product_suppliers ORDER BY total_amount_purchased DESC LIMIT 3
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['address details', 'text']]

 -- Table: staff 
columns : [['staff id', 'number'], ['staff gender', 'text'], ['staff name', 'text']]

 -- Table: suppliers 
columns : [['supplier id', 'number'], ['supplier name', 'text'], ['supplier phone', 'text']]

 -- Table: department store chain 
columns : [['department store chain id', 'number'], ['department store chain name', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['payment method code', 'text'], ['customer code', 'text'], ['customer name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text']]

 -- Table: products 
columns : [['product id', 'number'], ['product type code', 'text'], ['product name', 'text'], ['product price', 'number']]

 -- Table: supplier addresses 
columns : [['supplier id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

 -- Table: customer addresses 
columns : [['customer id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

 -- Table: customer orders 
columns : [['order id', 'number'], ['customer id', 'number'], ['order status code', 'text'], ['order date', 'time']]

 -- Table: department stores 
columns : [['department store id', 'number'], ['department store chain id', 'number'], ['store name', 'text'], ['store address', 'text'], ['store phone', 'text'], ['store email', 'text']]

 -- Table: departments 
columns : [['department id', 'number'], ['department store id', 'number'], ['department name', 'text']]

 -- Table: order items 
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number']]

 -- Table: product suppliers 
columns : [['product id', 'number'], ['supplier id', 'number'], ['date supplied from', 'time'], ['date supplied to', 'time'], ['total amount purchased', 'text'], ['total value purchased', 'number']]

 -- Table: staff department assignments 
columns : [['staff id', 'number'], ['department id', 'number'], ['date assigned from', 'time'], ['job title code', 'text'], ['date assigned to', 'time']]

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 product id and product type of the cheapest product?
SQL: SELECT product_id ,  product_type_code FROM products ORDER BY product_price LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['address details', 'text']]

 -- Table: staff 
columns : [['staff id', 'number'], ['staff gender', 'text'], ['staff name', 'text']]

 -- Table: suppliers 
columns : [['supplier id', 'number'], ['supplier name', 'text'], ['supplier phone', 'text']]

 -- Table: department store chain 
columns : [['department store chain id', 'number'], ['department store chain name', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['payment method code', 'text'], ['customer code', 'text'], ['customer name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text']]

 -- Table: products 
columns : [['product id', 'number'], ['product type code', 'text'], ['product name', 'text'], ['product price', 'number']]

 -- Table: supplier addresses 
columns : [['supplier id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

 -- Table: customer addresses 
columns : [['customer id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

 -- Table: customer orders 
columns : [['order id', 'number'], ['customer id', 'number'], ['order status code', 'text'], ['order date', 'time']]

 -- Table: department stores 
columns : [['department store id', 'number'], ['department store chain id', 'number'], ['store name', 'text'], ['store address', 'text'], ['store phone', 'text'], ['store email', 'text']]

 -- Table: departments 
columns : [['department id', 'number'], ['department store id', 'number'], ['department name', 'text']]

 -- Table: order items 
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number']]

 -- Table: product suppliers 
columns : [['product id', 'number'], ['supplier id', 'number'], ['date supplied from', 'time'], ['date supplied to', 'time'], ['total amount purchased', 'text'], ['total value purchased', 'number']]

 -- Table: staff department assignments 
columns : [['staff id', 'number'], ['department id', 'number'], ['date assigned from', 'time'], ['job title code', 'text'], ['date assigned to', 'time']]

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: Give the id and product type of the product with the lowest price.
SQL: SELECT product_id ,  product_type_code FROM products ORDER BY product_price LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['address details', 'text']]

 -- Table: staff 
columns : [['staff id', 'number'], ['staff gender', 'text'], ['staff name', 'text']]

 -- Table: suppliers 
columns : [['supplier id', 'number'], ['supplier name', 'text'], ['supplier phone', 'text']]

 -- Table: department store chain 
columns : [['department store chain id', 'number'], ['department store chain name', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['payment method code', 'text'], ['customer code', 'text'], ['customer name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text']]

 -- Table: products 
columns : [['product id', 'number'], ['product type code', 'text'], ['product name', 'text'], ['product price', 'number']]

 -- Table: supplier addresses 
columns : [['supplier id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

 -- Table: customer addresses 
columns : [['customer id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

 -- Table: customer orders 
columns : [['order id', 'number'], ['customer id', 'number'], ['order status code', 'text'], ['order date', 'time']]

 -- Table: department stores 
columns : [['department store id', 'number'], ['department store chain id', 'number'], ['store name', 'text'], ['store address', 'text'], ['store phone', 'text'], ['store email', 'text']]

 -- Table: departments 
columns : [['department id', 'number'], ['department store id', 'number'], ['department name', 'text']]

 -- Table: order items 
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number']]

 -- Table: product suppliers 
columns : [['product id', 'number'], ['supplier id', 'number'], ['date supplied from', 'time'], ['date supplied to', 'time'], ['total amount purchased', 'text'], ['total value purchased', 'number']]

 -- Table: staff department assignments 
columns : [['staff id', 'number'], ['department id', 'number'], ['date assigned from', 'time'], ['job title code', 'text'], ['date assigned to', 'time']]

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 product types.
SQL: SELECT count(DISTINCT product_type_code) FROM products