sert121/SpiderSQL huggingface dataset:
-- Language PostgreSQL
        -- Tables: 
             -- Table: class 
columns : [['class code', 'text'], ['course code', 'text'], ['class section', 'text'], ['class time', 'text'], ['class room', 'text'], ['professor employee number', 'number']]

 -- Table: course 
columns : [['course code', 'text'], ['department code', 'text'], ['course description', 'text'], ['course credit', 'number']]

 -- Table: department 
columns : [['department code', 'text'], ['department name', 'text'], ['school code', 'text'], ['employee number', 'number'], ['department address', 'text'], ['department extension', 'text']]

 -- Table: employee 
columns : [['employee number', 'number'], ['employee last name', 'text'], ['employee first name', 'text'], ['employee initial', 'text'], ['employee job code', 'text'], ['employee hire date', 'time'], ['employee date of birth', 'time']]

 -- Table: enroll 
columns : [['class code', 'text'], ['student number', 'number'], ['enroll grade', 'text']]

 -- Table: professor 
columns : [['employee number', 'number'], ['department code', 'text'], ['professor office', 'text'], ['professor extension', 'text'], ['professor high degree', 'text']]

 -- Table: student 
columns : [['student num', 'number'], ['student last name', 'text'], ['student first name', 'text'], ['student init', 'text'], ['student date of birth', 'time'], ['student class hours took', 'number'], ['student class', 'text'], ['student gpa', 'number'], ['student transfer', 'number'], ['department code', 'text'], ['student phone', 'text'], ['professor number', '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 classes in each school.
SQL: SELECT count(*) ,  T3.school_code FROM CLASS AS T1 JOIN course AS T2 ON T1.crs_code  =  T2.crs_code JOIN department AS T3 ON T2.dept_code  =  T3.dept_code GROUP BY T3.school_code
-- Language PostgreSQL
        -- Tables: 
             -- Table: class 
columns : [['class code', 'text'], ['course code', 'text'], ['class section', 'text'], ['class time', 'text'], ['class room', 'text'], ['professor employee number', 'number']]

 -- Table: course 
columns : [['course code', 'text'], ['department code', 'text'], ['course description', 'text'], ['course credit', 'number']]

 -- Table: department 
columns : [['department code', 'text'], ['department name', 'text'], ['school code', 'text'], ['employee number', 'number'], ['department address', 'text'], ['department extension', 'text']]

 -- Table: employee 
columns : [['employee number', 'number'], ['employee last name', 'text'], ['employee first name', 'text'], ['employee initial', 'text'], ['employee job code', 'text'], ['employee hire date', 'time'], ['employee date of birth', 'time']]

 -- Table: enroll 
columns : [['class code', 'text'], ['student number', 'number'], ['enroll grade', 'text']]

 -- Table: professor 
columns : [['employee number', 'number'], ['department code', 'text'], ['professor office', 'text'], ['professor extension', 'text'], ['professor high degree', 'text']]

 -- Table: student 
columns : [['student num', 'number'], ['student last name', 'text'], ['student first name', 'text'], ['student init', 'text'], ['student date of birth', 'time'], ['student class hours took', 'number'], ['student class', 'text'], ['student gpa', 'number'], ['student transfer', 'number'], ['department code', 'text'], ['student phone', 'text'], ['professor number', '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 classes exist for each school?
SQL: SELECT count(*) ,  T3.school_code FROM CLASS AS T1 JOIN course AS T2 ON T1.crs_code  =  T2.crs_code JOIN department AS T3 ON T2.dept_code  =  T3.dept_code GROUP BY T3.school_code
-- Language PostgreSQL
        -- Tables: 
             -- Table: class 
columns : [['class code', 'text'], ['course code', 'text'], ['class section', 'text'], ['class time', 'text'], ['class room', 'text'], ['professor employee number', 'number']]

 -- Table: course 
columns : [['course code', 'text'], ['department code', 'text'], ['course description', 'text'], ['course credit', 'number']]

 -- Table: department 
columns : [['department code', 'text'], ['department name', 'text'], ['school code', 'text'], ['employee number', 'number'], ['department address', 'text'], ['department extension', 'text']]

 -- Table: employee 
columns : [['employee number', 'number'], ['employee last name', 'text'], ['employee first name', 'text'], ['employee initial', 'text'], ['employee job code', 'text'], ['employee hire date', 'time'], ['employee date of birth', 'time']]

 -- Table: enroll 
columns : [['class code', 'text'], ['student number', 'number'], ['enroll grade', 'text']]

 -- Table: professor 
columns : [['employee number', 'number'], ['department code', 'text'], ['professor office', 'text'], ['professor extension', 'text'], ['professor high degree', 'text']]

 -- Table: student 
columns : [['student num', 'number'], ['student last name', 'text'], ['student first name', 'text'], ['student init', 'text'], ['student date of birth', 'time'], ['student class hours took', 'number'], ['student class', 'text'], ['student gpa', 'number'], ['student transfer', 'number'], ['department code', 'text'], ['student phone', 'text'], ['professor number', '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 professors for different school?
SQL: SELECT count(*) ,  T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code  =  T2.dept_code GROUP BY T1.school_code
-- Language PostgreSQL
        -- Tables: 
             -- Table: class 
columns : [['class code', 'text'], ['course code', 'text'], ['class section', 'text'], ['class time', 'text'], ['class room', 'text'], ['professor employee number', 'number']]

 -- Table: course 
columns : [['course code', 'text'], ['department code', 'text'], ['course description', 'text'], ['course credit', 'number']]

 -- Table: department 
columns : [['department code', 'text'], ['department name', 'text'], ['school code', 'text'], ['employee number', 'number'], ['department address', 'text'], ['department extension', 'text']]

 -- Table: employee 
columns : [['employee number', 'number'], ['employee last name', 'text'], ['employee first name', 'text'], ['employee initial', 'text'], ['employee job code', 'text'], ['employee hire date', 'time'], ['employee date of birth', 'time']]

 -- Table: enroll 
columns : [['class code', 'text'], ['student number', 'number'], ['enroll grade', 'text']]

 -- Table: professor 
columns : [['employee number', 'number'], ['department code', 'text'], ['professor office', 'text'], ['professor extension', 'text'], ['professor high degree', 'text']]

 -- Table: student 
columns : [['student num', 'number'], ['student last name', 'text'], ['student first name', 'text'], ['student init', 'text'], ['student date of birth', 'time'], ['student class hours took', 'number'], ['student class', 'text'], ['student gpa', 'number'], ['student transfer', 'number'], ['department code', 'text'], ['student phone', 'text'], ['professor number', '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 different professors are there for the different schools?
SQL: SELECT count(*) ,  T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code  =  T2.dept_code GROUP BY T1.school_code
-- Language PostgreSQL
        -- Tables: 
             -- Table: class 
columns : [['class code', 'text'], ['course code', 'text'], ['class section', 'text'], ['class time', 'text'], ['class room', 'text'], ['professor employee number', 'number']]

 -- Table: course 
columns : [['course code', 'text'], ['department code', 'text'], ['course description', 'text'], ['course credit', 'number']]

 -- Table: department 
columns : [['department code', 'text'], ['department name', 'text'], ['school code', 'text'], ['employee number', 'number'], ['department address', 'text'], ['department extension', 'text']]

 -- Table: employee 
columns : [['employee number', 'number'], ['employee last name', 'text'], ['employee first name', 'text'], ['employee initial', 'text'], ['employee job code', 'text'], ['employee hire date', 'time'], ['employee date of birth', 'time']]

 -- Table: enroll 
columns : [['class code', 'text'], ['student number', 'number'], ['enroll grade', 'text']]

 -- Table: professor 
columns : [['employee number', 'number'], ['department code', 'text'], ['professor office', 'text'], ['professor extension', 'text'], ['professor high degree', 'text']]

 -- Table: student 
columns : [['student num', 'number'], ['student last name', 'text'], ['student first name', 'text'], ['student init', 'text'], ['student date of birth', 'time'], ['student class hours took', 'number'], ['student class', 'text'], ['student gpa', 'number'], ['student transfer', 'number'], ['department code', 'text'], ['student phone', 'text'], ['professor number', '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 count and code of the job has most employees.
SQL: SELECT emp_jobcode ,  count(*) FROM employee GROUP BY emp_jobcode ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: class 
columns : [['class code', 'text'], ['course code', 'text'], ['class section', 'text'], ['class time', 'text'], ['class room', 'text'], ['professor employee number', 'number']]

 -- Table: course 
columns : [['course code', 'text'], ['department code', 'text'], ['course description', 'text'], ['course credit', 'number']]

 -- Table: department 
columns : [['department code', 'text'], ['department name', 'text'], ['school code', 'text'], ['employee number', 'number'], ['department address', 'text'], ['department extension', 'text']]

 -- Table: employee 
columns : [['employee number', 'number'], ['employee last name', 'text'], ['employee first name', 'text'], ['employee initial', 'text'], ['employee job code', 'text'], ['employee hire date', 'time'], ['employee date of birth', 'time']]

 -- Table: enroll 
columns : [['class code', 'text'], ['student number', 'number'], ['enroll grade', 'text']]

 -- Table: professor 
columns : [['employee number', 'number'], ['department code', 'text'], ['professor office', 'text'], ['professor extension', 'text'], ['professor high degree', 'text']]

 -- Table: student 
columns : [['student num', 'number'], ['student last name', 'text'], ['student first name', 'text'], ['student init', 'text'], ['student date of birth', 'time'], ['student class hours took', 'number'], ['student class', 'text'], ['student gpa', 'number'], ['student transfer', 'number'], ['department code', 'text'], ['student phone', 'text'], ['professor number', '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 count and code of the job with the most employee?
SQL: SELECT emp_jobcode ,  count(*) FROM employee GROUP BY emp_jobcode ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: class 
columns : [['class code', 'text'], ['course code', 'text'], ['class section', 'text'], ['class time', 'text'], ['class room', 'text'], ['professor employee number', 'number']]

 -- Table: course 
columns : [['course code', 'text'], ['department code', 'text'], ['course description', 'text'], ['course credit', 'number']]

 -- Table: department 
columns : [['department code', 'text'], ['department name', 'text'], ['school code', 'text'], ['employee number', 'number'], ['department address', 'text'], ['department extension', 'text']]

 -- Table: employee 
columns : [['employee number', 'number'], ['employee last name', 'text'], ['employee first name', 'text'], ['employee initial', 'text'], ['employee job code', 'text'], ['employee hire date', 'time'], ['employee date of birth', 'time']]

 -- Table: enroll 
columns : [['class code', 'text'], ['student number', 'number'], ['enroll grade', 'text']]

 -- Table: professor 
columns : [['employee number', 'number'], ['department code', 'text'], ['professor office', 'text'], ['professor extension', 'text'], ['professor high degree', 'text']]

 -- Table: student 
columns : [['student num', 'number'], ['student last name', 'text'], ['student first name', 'text'], ['student init', 'text'], ['student date of birth', 'time'], ['student class hours took', 'number'], ['student class', 'text'], ['student gpa', 'number'], ['student transfer', 'number'], ['department code', 'text'], ['student phone', 'text'], ['professor number', '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 school has the smallest amount of professors?
SQL: SELECT T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code  =  T2.dept_code GROUP BY T1.school_code ORDER BY count(*) LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: class 
columns : [['class code', 'text'], ['course code', 'text'], ['class section', 'text'], ['class time', 'text'], ['class room', 'text'], ['professor employee number', 'number']]

 -- Table: course 
columns : [['course code', 'text'], ['department code', 'text'], ['course description', 'text'], ['course credit', 'number']]

 -- Table: department 
columns : [['department code', 'text'], ['department name', 'text'], ['school code', 'text'], ['employee number', 'number'], ['department address', 'text'], ['department extension', 'text']]

 -- Table: employee 
columns : [['employee number', 'number'], ['employee last name', 'text'], ['employee first name', 'text'], ['employee initial', 'text'], ['employee job code', 'text'], ['employee hire date', 'time'], ['employee date of birth', 'time']]

 -- Table: enroll 
columns : [['class code', 'text'], ['student number', 'number'], ['enroll grade', 'text']]

 -- Table: professor 
columns : [['employee number', 'number'], ['department code', 'text'], ['professor office', 'text'], ['professor extension', 'text'], ['professor high degree', 'text']]

 -- Table: student 
columns : [['student num', 'number'], ['student last name', 'text'], ['student first name', 'text'], ['student init', 'text'], ['student date of birth', 'time'], ['student class hours took', 'number'], ['student class', 'text'], ['student gpa', 'number'], ['student transfer', 'number'], ['department code', 'text'], ['student phone', 'text'], ['professor number', '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 school has the fewest professors?
SQL: SELECT T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code  =  T2.dept_code GROUP BY T1.school_code ORDER BY count(*) LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: class 
columns : [['class code', 'text'], ['course code', 'text'], ['class section', 'text'], ['class time', 'text'], ['class room', 'text'], ['professor employee number', 'number']]

 -- Table: course 
columns : [['course code', 'text'], ['department code', 'text'], ['course description', 'text'], ['course credit', 'number']]

 -- Table: department 
columns : [['department code', 'text'], ['department name', 'text'], ['school code', 'text'], ['employee number', 'number'], ['department address', 'text'], ['department extension', 'text']]

 -- Table: employee 
columns : [['employee number', 'number'], ['employee last name', 'text'], ['employee first name', 'text'], ['employee initial', 'text'], ['employee job code', 'text'], ['employee hire date', 'time'], ['employee date of birth', 'time']]

 -- Table: enroll 
columns : [['class code', 'text'], ['student number', 'number'], ['enroll grade', 'text']]

 -- Table: professor 
columns : [['employee number', 'number'], ['department code', 'text'], ['professor office', 'text'], ['professor extension', 'text'], ['professor high degree', 'text']]

 -- Table: student 
columns : [['student num', 'number'], ['student last name', 'text'], ['student first name', 'text'], ['student init', 'text'], ['student date of birth', 'time'], ['student class hours took', 'number'], ['student class', 'text'], ['student gpa', 'number'], ['student transfer', 'number'], ['department code', 'text'], ['student phone', 'text'], ['professor number', '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 professors with a Ph.D. degree in each department.
SQL: SELECT count(*) ,  dept_code FROM professor WHERE prof_high_degree  =  'Ph.D.' GROUP BY dept_code
-- Language PostgreSQL
        -- Tables: 
             -- Table: class 
columns : [['class code', 'text'], ['course code', 'text'], ['class section', 'text'], ['class time', 'text'], ['class room', 'text'], ['professor employee number', 'number']]

 -- Table: course 
columns : [['course code', 'text'], ['department code', 'text'], ['course description', 'text'], ['course credit', 'number']]

 -- Table: department 
columns : [['department code', 'text'], ['department name', 'text'], ['school code', 'text'], ['employee number', 'number'], ['department address', 'text'], ['department extension', 'text']]

 -- Table: employee 
columns : [['employee number', 'number'], ['employee last name', 'text'], ['employee first name', 'text'], ['employee initial', 'text'], ['employee job code', 'text'], ['employee hire date', 'time'], ['employee date of birth', 'time']]

 -- Table: enroll 
columns : [['class code', 'text'], ['student number', 'number'], ['enroll grade', 'text']]

 -- Table: professor 
columns : [['employee number', 'number'], ['department code', 'text'], ['professor office', 'text'], ['professor extension', 'text'], ['professor high degree', 'text']]

 -- Table: student 
columns : [['student num', 'number'], ['student last name', 'text'], ['student first name', 'text'], ['student init', 'text'], ['student date of birth', 'time'], ['student class hours took', 'number'], ['student class', 'text'], ['student gpa', 'number'], ['student transfer', 'number'], ['department code', 'text'], ['student phone', 'text'], ['professor number', '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 professors have a Ph.D. in each department?
SQL: SELECT count(*) ,  dept_code FROM professor WHERE prof_high_degree  =  'Ph.D.' GROUP BY dept_code
-- Language PostgreSQL
        -- Tables: 
             -- Table: class 
columns : [['class code', 'text'], ['course code', 'text'], ['class section', 'text'], ['class time', 'text'], ['class room', 'text'], ['professor employee number', 'number']]

 -- Table: course 
columns : [['course code', 'text'], ['department code', 'text'], ['course description', 'text'], ['course credit', 'number']]

 -- Table: department 
columns : [['department code', 'text'], ['department name', 'text'], ['school code', 'text'], ['employee number', 'number'], ['department address', 'text'], ['department extension', 'text']]

 -- Table: employee 
columns : [['employee number', 'number'], ['employee last name', 'text'], ['employee first name', 'text'], ['employee initial', 'text'], ['employee job code', 'text'], ['employee hire date', 'time'], ['employee date of birth', 'time']]

 -- Table: enroll 
columns : [['class code', 'text'], ['student number', 'number'], ['enroll grade', 'text']]

 -- Table: professor 
columns : [['employee number', 'number'], ['department code', 'text'], ['professor office', 'text'], ['professor extension', 'text'], ['professor high degree', 'text']]

 -- Table: student 
columns : [['student num', 'number'], ['student last name', 'text'], ['student first name', 'text'], ['student init', 'text'], ['student date of birth', 'time'], ['student class hours took', 'number'], ['student class', 'text'], ['student gpa', 'number'], ['student transfer', 'number'], ['department code', 'text'], ['student phone', 'text'], ['professor number', '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 students for each department.
SQL: SELECT count(*) ,  dept_code FROM student GROUP BY dept_code
-- Language PostgreSQL
        -- Tables: 
             -- Table: class 
columns : [['class code', 'text'], ['course code', 'text'], ['class section', 'text'], ['class time', 'text'], ['class room', 'text'], ['professor employee number', 'number']]

 -- Table: course 
columns : [['course code', 'text'], ['department code', 'text'], ['course description', 'text'], ['course credit', 'number']]

 -- Table: department 
columns : [['department code', 'text'], ['department name', 'text'], ['school code', 'text'], ['employee number', 'number'], ['department address', 'text'], ['department extension', 'text']]

 -- Table: employee 
columns : [['employee number', 'number'], ['employee last name', 'text'], ['employee first name', 'text'], ['employee initial', 'text'], ['employee job code', 'text'], ['employee hire date', 'time'], ['employee date of birth', 'time']]

 -- Table: enroll 
columns : [['class code', 'text'], ['student number', 'number'], ['enroll grade', 'text']]

 -- Table: professor 
columns : [['employee number', 'number'], ['department code', 'text'], ['professor office', 'text'], ['professor extension', 'text'], ['professor high degree', 'text']]

 -- Table: student 
columns : [['student num', 'number'], ['student last name', 'text'], ['student first name', 'text'], ['student init', 'text'], ['student date of birth', 'time'], ['student class hours took', 'number'], ['student class', 'text'], ['student gpa', 'number'], ['student transfer', 'number'], ['department code', 'text'], ['student phone', 'text'], ['professor number', '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 students are in each department?
SQL: SELECT count(*) ,  dept_code FROM student GROUP BY dept_code
-- Language PostgreSQL
        -- Tables: 
             -- Table: class 
columns : [['class code', 'text'], ['course code', 'text'], ['class section', 'text'], ['class time', 'text'], ['class room', 'text'], ['professor employee number', 'number']]

 -- Table: course 
columns : [['course code', 'text'], ['department code', 'text'], ['course description', 'text'], ['course credit', 'number']]

 -- Table: department 
columns : [['department code', 'text'], ['department name', 'text'], ['school code', 'text'], ['employee number', 'number'], ['department address', 'text'], ['department extension', 'text']]

 -- Table: employee 
columns : [['employee number', 'number'], ['employee last name', 'text'], ['employee first name', 'text'], ['employee initial', 'text'], ['employee job code', 'text'], ['employee hire date', 'time'], ['employee date of birth', 'time']]

 -- Table: enroll 
columns : [['class code', 'text'], ['student number', 'number'], ['enroll grade', 'text']]

 -- Table: professor 
columns : [['employee number', 'number'], ['department code', 'text'], ['professor office', 'text'], ['professor extension', 'text'], ['professor high degree', 'text']]

 -- Table: student 
columns : [['student num', 'number'], ['student last name', 'text'], ['student first name', 'text'], ['student init', 'text'], ['student date of birth', 'time'], ['student class hours took', 'number'], ['student class', 'text'], ['student gpa', 'number'], ['student transfer', 'number'], ['department code', 'text'], ['student phone', 'text'], ['professor number', '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 number of hours have done for all students in each department.
SQL: SELECT sum(stu_hrs) ,  dept_code FROM student GROUP BY dept_code
-- Language PostgreSQL
        -- Tables: 
             -- Table: class 
columns : [['class code', 'text'], ['course code', 'text'], ['class section', 'text'], ['class time', 'text'], ['class room', 'text'], ['professor employee number', 'number']]

 -- Table: course 
columns : [['course code', 'text'], ['department code', 'text'], ['course description', 'text'], ['course credit', 'number']]

 -- Table: department 
columns : [['department code', 'text'], ['department name', 'text'], ['school code', 'text'], ['employee number', 'number'], ['department address', 'text'], ['department extension', 'text']]

 -- Table: employee 
columns : [['employee number', 'number'], ['employee last name', 'text'], ['employee first name', 'text'], ['employee initial', 'text'], ['employee job code', 'text'], ['employee hire date', 'time'], ['employee date of birth', 'time']]

 -- Table: enroll 
columns : [['class code', 'text'], ['student number', 'number'], ['enroll grade', 'text']]

 -- Table: professor 
columns : [['employee number', 'number'], ['department code', 'text'], ['professor office', 'text'], ['professor extension', 'text'], ['professor high degree', 'text']]

 -- Table: student 
columns : [['student num', 'number'], ['student last name', 'text'], ['student first name', 'text'], ['student init', 'text'], ['student date of birth', 'time'], ['student class hours took', 'number'], ['student class', 'text'], ['student gpa', 'number'], ['student transfer', 'number'], ['department code', 'text'], ['student phone', 'text'], ['professor number', '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 hours do the students spend studying in each department?
SQL: SELECT sum(stu_hrs) ,  dept_code FROM student GROUP BY dept_code
-- Language PostgreSQL
        -- Tables: 
             -- Table: class 
columns : [['class code', 'text'], ['course code', 'text'], ['class section', 'text'], ['class time', 'text'], ['class room', 'text'], ['professor employee number', 'number']]

 -- Table: course 
columns : [['course code', 'text'], ['department code', 'text'], ['course description', 'text'], ['course credit', 'number']]

 -- Table: department 
columns : [['department code', 'text'], ['department name', 'text'], ['school code', 'text'], ['employee number', 'number'], ['department address', 'text'], ['department extension', 'text']]

 -- Table: employee 
columns : [['employee number', 'number'], ['employee last name', 'text'], ['employee first name', 'text'], ['employee initial', 'text'], ['employee job code', 'text'], ['employee hire date', 'time'], ['employee date of birth', 'time']]

 -- Table: enroll 
columns : [['class code', 'text'], ['student number', 'number'], ['enroll grade', 'text']]

 -- Table: professor 
columns : [['employee number', 'number'], ['department code', 'text'], ['professor office', 'text'], ['professor extension', 'text'], ['professor high degree', 'text']]

 -- Table: student 
columns : [['student num', 'number'], ['student last name', 'text'], ['student first name', 'text'], ['student init', 'text'], ['student date of birth', 'time'], ['student class hours took', 'number'], ['student class', 'text'], ['student gpa', 'number'], ['student transfer', 'number'], ['department code', 'text'], ['student phone', 'text'], ['professor number', '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 max, average, and minimum gpa of all students in each department.
SQL: SELECT max(stu_gpa) ,  avg(stu_gpa) ,  min(stu_gpa) ,  dept_code FROM student GROUP BY dept_code
-- Language PostgreSQL
        -- Tables: 
             -- Table: class 
columns : [['class code', 'text'], ['course code', 'text'], ['class section', 'text'], ['class time', 'text'], ['class room', 'text'], ['professor employee number', 'number']]

 -- Table: course 
columns : [['course code', 'text'], ['department code', 'text'], ['course description', 'text'], ['course credit', 'number']]

 -- Table: department 
columns : [['department code', 'text'], ['department name', 'text'], ['school code', 'text'], ['employee number', 'number'], ['department address', 'text'], ['department extension', 'text']]

 -- Table: employee 
columns : [['employee number', 'number'], ['employee last name', 'text'], ['employee first name', 'text'], ['employee initial', 'text'], ['employee job code', 'text'], ['employee hire date', 'time'], ['employee date of birth', 'time']]

 -- Table: enroll 
columns : [['class code', 'text'], ['student number', 'number'], ['enroll grade', 'text']]

 -- Table: professor 
columns : [['employee number', 'number'], ['department code', 'text'], ['professor office', 'text'], ['professor extension', 'text'], ['professor high degree', 'text']]

 -- Table: student 
columns : [['student num', 'number'], ['student last name', 'text'], ['student first name', 'text'], ['student init', 'text'], ['student date of birth', 'time'], ['student class hours took', 'number'], ['student class', 'text'], ['student gpa', 'number'], ['student transfer', 'number'], ['department code', 'text'], ['student phone', 'text'], ['professor number', '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 highest, lowest, and average student GPA for every department?
SQL: SELECT max(stu_gpa) ,  avg(stu_gpa) ,  min(stu_gpa) ,  dept_code FROM student GROUP BY dept_code
-- Language PostgreSQL
        -- Tables: 
             -- Table: class 
columns : [['class code', 'text'], ['course code', 'text'], ['class section', 'text'], ['class time', 'text'], ['class room', 'text'], ['professor employee number', 'number']]

 -- Table: course 
columns : [['course code', 'text'], ['department code', 'text'], ['course description', 'text'], ['course credit', 'number']]

 -- Table: department 
columns : [['department code', 'text'], ['department name', 'text'], ['school code', 'text'], ['employee number', 'number'], ['department address', 'text'], ['department extension', 'text']]

 -- Table: employee 
columns : [['employee number', 'number'], ['employee last name', 'text'], ['employee first name', 'text'], ['employee initial', 'text'], ['employee job code', 'text'], ['employee hire date', 'time'], ['employee date of birth', 'time']]

 -- Table: enroll 
columns : [['class code', 'text'], ['student number', 'number'], ['enroll grade', 'text']]

 -- Table: professor 
columns : [['employee number', 'number'], ['department code', 'text'], ['professor office', 'text'], ['professor extension', 'text'], ['professor high degree', 'text']]

 -- Table: student 
columns : [['student num', 'number'], ['student last name', 'text'], ['student first name', 'text'], ['student init', 'text'], ['student date of birth', 'time'], ['student class hours took', 'number'], ['student class', 'text'], ['student gpa', 'number'], ['student transfer', 'number'], ['department code', 'text'], ['student phone', 'text'], ['professor number', '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 name and the average gpa of department whose students have the highest average gpa?
SQL: SELECT T2.dept_name ,  avg(T1.stu_gpa) FROM student AS T1 JOIN department AS T2 ON T1.dept_code  =  T2.dept_code GROUP BY T1.dept_code ORDER BY avg(T1.stu_gpa) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: class 
columns : [['class code', 'text'], ['course code', 'text'], ['class section', 'text'], ['class time', 'text'], ['class room', 'text'], ['professor employee number', 'number']]

 -- Table: course 
columns : [['course code', 'text'], ['department code', 'text'], ['course description', 'text'], ['course credit', 'number']]

 -- Table: department 
columns : [['department code', 'text'], ['department name', 'text'], ['school code', 'text'], ['employee number', 'number'], ['department address', 'text'], ['department extension', 'text']]

 -- Table: employee 
columns : [['employee number', 'number'], ['employee last name', 'text'], ['employee first name', 'text'], ['employee initial', 'text'], ['employee job code', 'text'], ['employee hire date', 'time'], ['employee date of birth', 'time']]

 -- Table: enroll 
columns : [['class code', 'text'], ['student number', 'number'], ['enroll grade', 'text']]

 -- Table: professor 
columns : [['employee number', 'number'], ['department code', 'text'], ['professor office', 'text'], ['professor extension', 'text'], ['professor high degree', 'text']]

 -- Table: student 
columns : [['student num', 'number'], ['student last name', 'text'], ['student first name', 'text'], ['student init', 'text'], ['student date of birth', 'time'], ['student class hours took', 'number'], ['student class', 'text'], ['student gpa', 'number'], ['student transfer', 'number'], ['department code', 'text'], ['student phone', 'text'], ['professor number', '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 department has the highest average student GPA, and what is the average gpa?
SQL: SELECT T2.dept_name ,  avg(T1.stu_gpa) FROM student AS T1 JOIN department AS T2 ON T1.dept_code  =  T2.dept_code GROUP BY T1.dept_code ORDER BY avg(T1.stu_gpa) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: class 
columns : [['class code', 'text'], ['course code', 'text'], ['class section', 'text'], ['class time', 'text'], ['class room', 'text'], ['professor employee number', 'number']]

 -- Table: course 
columns : [['course code', 'text'], ['department code', 'text'], ['course description', 'text'], ['course credit', 'number']]

 -- Table: department 
columns : [['department code', 'text'], ['department name', 'text'], ['school code', 'text'], ['employee number', 'number'], ['department address', 'text'], ['department extension', 'text']]

 -- Table: employee 
columns : [['employee number', 'number'], ['employee last name', 'text'], ['employee first name', 'text'], ['employee initial', 'text'], ['employee job code', 'text'], ['employee hire date', 'time'], ['employee date of birth', 'time']]

 -- Table: enroll 
columns : [['class code', 'text'], ['student number', 'number'], ['enroll grade', 'text']]

 -- Table: professor 
columns : [['employee number', 'number'], ['department code', 'text'], ['professor office', 'text'], ['professor extension', 'text'], ['professor high degree', 'text']]

 -- Table: student 
columns : [['student num', 'number'], ['student last name', 'text'], ['student first name', 'text'], ['student init', 'text'], ['student date of birth', 'time'], ['student class hours took', 'number'], ['student class', 'text'], ['student gpa', 'number'], ['student transfer', 'number'], ['department code', 'text'], ['student phone', 'text'], ['professor number', '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 schools exist in total?
SQL: SELECT count(DISTINCT school_code) FROM department
-- Language PostgreSQL
        -- Tables: 
             -- Table: class 
columns : [['class code', 'text'], ['course code', 'text'], ['class section', 'text'], ['class time', 'text'], ['class room', 'text'], ['professor employee number', 'number']]

 -- Table: course 
columns : [['course code', 'text'], ['department code', 'text'], ['course description', 'text'], ['course credit', 'number']]

 -- Table: department 
columns : [['department code', 'text'], ['department name', 'text'], ['school code', 'text'], ['employee number', 'number'], ['department address', 'text'], ['department extension', 'text']]

 -- Table: employee 
columns : [['employee number', 'number'], ['employee last name', 'text'], ['employee first name', 'text'], ['employee initial', 'text'], ['employee job code', 'text'], ['employee hire date', 'time'], ['employee date of birth', 'time']]

 -- Table: enroll 
columns : [['class code', 'text'], ['student number', 'number'], ['enroll grade', 'text']]

 -- Table: professor 
columns : [['employee number', 'number'], ['department code', 'text'], ['professor office', 'text'], ['professor extension', 'text'], ['professor high degree', 'text']]

 -- Table: student 
columns : [['student num', 'number'], ['student last name', 'text'], ['student first name', 'text'], ['student init', 'text'], ['student date of birth', 'time'], ['student class hours took', 'number'], ['student class', 'text'], ['student gpa', 'number'], ['student transfer', 'number'], ['department code', 'text'], ['student phone', 'text'], ['professor number', '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 schools are there in the department?
SQL: SELECT count(DISTINCT school_code) FROM department
-- Language PostgreSQL
        -- Tables: 
             -- Table: class 
columns : [['class code', 'text'], ['course code', 'text'], ['class section', 'text'], ['class time', 'text'], ['class room', 'text'], ['professor employee number', 'number']]

 -- Table: course 
columns : [['course code', 'text'], ['department code', 'text'], ['course description', 'text'], ['course credit', 'number']]

 -- Table: department 
columns : [['department code', 'text'], ['department name', 'text'], ['school code', 'text'], ['employee number', 'number'], ['department address', 'text'], ['department extension', 'text']]

 -- Table: employee 
columns : [['employee number', 'number'], ['employee last name', 'text'], ['employee first name', 'text'], ['employee initial', 'text'], ['employee job code', 'text'], ['employee hire date', 'time'], ['employee date of birth', 'time']]

 -- Table: enroll 
columns : [['class code', 'text'], ['student number', 'number'], ['enroll grade', 'text']]

 -- Table: professor 
columns : [['employee number', 'number'], ['department code', 'text'], ['professor office', 'text'], ['professor extension', 'text'], ['professor high degree', 'text']]

 -- Table: student 
columns : [['student num', 'number'], ['student last name', 'text'], ['student first name', 'text'], ['student init', 'text'], ['student date of birth', 'time'], ['student class hours took', 'number'], ['student class', 'text'], ['student gpa', 'number'], ['student transfer', 'number'], ['department code', 'text'], ['student phone', 'text'], ['professor number', '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 different classes are there?
SQL: SELECT count(DISTINCT class_code) FROM CLASS
-- Language PostgreSQL
        -- Tables: 
             -- Table: class 
columns : [['class code', 'text'], ['course code', 'text'], ['class section', 'text'], ['class time', 'text'], ['class room', 'text'], ['professor employee number', 'number']]

 -- Table: course 
columns : [['course code', 'text'], ['department code', 'text'], ['course description', 'text'], ['course credit', 'number']]

 -- Table: department 
columns : [['department code', 'text'], ['department name', 'text'], ['school code', 'text'], ['employee number', 'number'], ['department address', 'text'], ['department extension', 'text']]

 -- Table: employee 
columns : [['employee number', 'number'], ['employee last name', 'text'], ['employee first name', 'text'], ['employee initial', 'text'], ['employee job code', 'text'], ['employee hire date', 'time'], ['employee date of birth', 'time']]

 -- Table: enroll 
columns : [['class code', 'text'], ['student number', 'number'], ['enroll grade', 'text']]

 -- Table: professor 
columns : [['employee number', 'number'], ['department code', 'text'], ['professor office', 'text'], ['professor extension', 'text'], ['professor high degree', 'text']]

 -- Table: student 
columns : [['student num', 'number'], ['student last name', 'text'], ['student first name', 'text'], ['student init', 'text'], ['student date of birth', 'time'], ['student class hours took', 'number'], ['student class', 'text'], ['student gpa', 'number'], ['student transfer', 'number'], ['department code', 'text'], ['student phone', 'text'], ['professor number', '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 unique classes are offered?
SQL: SELECT count(DISTINCT class_code) FROM CLASS
-- Language PostgreSQL
        -- Tables: 
             -- Table: class 
columns : [['class code', 'text'], ['course code', 'text'], ['class section', 'text'], ['class time', 'text'], ['class room', 'text'], ['professor employee number', 'number']]

 -- Table: course 
columns : [['course code', 'text'], ['department code', 'text'], ['course description', 'text'], ['course credit', 'number']]

 -- Table: department 
columns : [['department code', 'text'], ['department name', 'text'], ['school code', 'text'], ['employee number', 'number'], ['department address', 'text'], ['department extension', 'text']]

 -- Table: employee 
columns : [['employee number', 'number'], ['employee last name', 'text'], ['employee first name', 'text'], ['employee initial', 'text'], ['employee job code', 'text'], ['employee hire date', 'time'], ['employee date of birth', 'time']]

 -- Table: enroll 
columns : [['class code', 'text'], ['student number', 'number'], ['enroll grade', 'text']]

 -- Table: professor 
columns : [['employee number', 'number'], ['department code', 'text'], ['professor office', 'text'], ['professor extension', 'text'], ['professor high degree', 'text']]

 -- Table: student 
columns : [['student num', 'number'], ['student last name', 'text'], ['student first name', 'text'], ['student init', 'text'], ['student date of birth', 'time'], ['student class hours took', 'number'], ['student class', 'text'], ['student gpa', 'number'], ['student transfer', 'number'], ['department code', 'text'], ['student phone', 'text'], ['professor number', '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 courses are offered?
SQL: SELECT count(DISTINCT crs_code) FROM CLASS