sert121/SpiderSQL huggingface dataset:
-- Language PostgreSQL
        -- Tables: 
             -- Table: classroom 
columns : [['building', 'text'], ['room number', 'text'], ['capacity', 'number']]

 -- Table: department 
columns : [['department name', 'text'], ['building', 'text'], ['budget', 'number']]

 -- Table: course 
columns : [['course id', 'text'], ['title', 'text'], ['department name', 'text'], ['credits', 'number']]

 -- Table: instructor 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['salary', 'number']]

 -- Table: section 
columns : [['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['building', 'text'], ['room number', 'text'], ['time slot id', 'text']]

 -- Table: teaches 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number']]

 -- Table: student 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['total credits', 'number']]

 -- Table: takes classes 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['grade', 'text']]

 -- Table: advisor 
columns : [['student id', 'text'], ['instructor id', 'text']]

 -- Table: time slot 
columns : [['time slot id', 'text'], ['day', 'text'], ['start hour', 'number'], ['start minute', 'number'], ['end hour', 'number'], ['end minute', 'number']]

 -- Table: prerequisite 
columns : [['course id', 'text'], ['prerequisite id', 'text']]

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



Question: Find the name of instructor who is the advisor of the student who has the highest number of total credits.
SQL: SELECT T2.name FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id  =  T2.id JOIN student AS T3 ON T1.s_id  =  T3.id ORDER BY T3.tot_cred DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: classroom 
columns : [['building', 'text'], ['room number', 'text'], ['capacity', 'number']]

 -- Table: department 
columns : [['department name', 'text'], ['building', 'text'], ['budget', 'number']]

 -- Table: course 
columns : [['course id', 'text'], ['title', 'text'], ['department name', 'text'], ['credits', 'number']]

 -- Table: instructor 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['salary', 'number']]

 -- Table: section 
columns : [['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['building', 'text'], ['room number', 'text'], ['time slot id', 'text']]

 -- Table: teaches 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number']]

 -- Table: student 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['total credits', 'number']]

 -- Table: takes classes 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['grade', 'text']]

 -- Table: advisor 
columns : [['student id', 'text'], ['instructor id', 'text']]

 -- Table: time slot 
columns : [['time slot id', 'text'], ['day', 'text'], ['start hour', 'number'], ['start minute', 'number'], ['end hour', 'number'], ['end minute', 'number']]

 -- Table: prerequisite 
columns : [['course id', 'text'], ['prerequisite id', 'text']]

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



Question: What is the name of the instructor who advises the student with the greatest number of total credits?
SQL: SELECT T2.name FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id  =  T2.id JOIN student AS T3 ON T1.s_id  =  T3.id ORDER BY T3.tot_cred DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: classroom 
columns : [['building', 'text'], ['room number', 'text'], ['capacity', 'number']]

 -- Table: department 
columns : [['department name', 'text'], ['building', 'text'], ['budget', 'number']]

 -- Table: course 
columns : [['course id', 'text'], ['title', 'text'], ['department name', 'text'], ['credits', 'number']]

 -- Table: instructor 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['salary', 'number']]

 -- Table: section 
columns : [['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['building', 'text'], ['room number', 'text'], ['time slot id', 'text']]

 -- Table: teaches 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number']]

 -- Table: student 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['total credits', 'number']]

 -- Table: takes classes 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['grade', 'text']]

 -- Table: advisor 
columns : [['student id', 'text'], ['instructor id', 'text']]

 -- Table: time slot 
columns : [['time slot id', 'text'], ['day', 'text'], ['start hour', 'number'], ['start minute', 'number'], ['end hour', 'number'], ['end minute', 'number']]

 -- Table: prerequisite 
columns : [['course id', 'text'], ['prerequisite id', 'text']]

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



Question: Find the name of instructors who didn't teach any courses?
SQL: SELECT name FROM instructor WHERE id NOT IN (SELECT id FROM teaches)
-- Language PostgreSQL
        -- Tables: 
             -- Table: classroom 
columns : [['building', 'text'], ['room number', 'text'], ['capacity', 'number']]

 -- Table: department 
columns : [['department name', 'text'], ['building', 'text'], ['budget', 'number']]

 -- Table: course 
columns : [['course id', 'text'], ['title', 'text'], ['department name', 'text'], ['credits', 'number']]

 -- Table: instructor 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['salary', 'number']]

 -- Table: section 
columns : [['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['building', 'text'], ['room number', 'text'], ['time slot id', 'text']]

 -- Table: teaches 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number']]

 -- Table: student 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['total credits', 'number']]

 -- Table: takes classes 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['grade', 'text']]

 -- Table: advisor 
columns : [['student id', 'text'], ['instructor id', 'text']]

 -- Table: time slot 
columns : [['time slot id', 'text'], ['day', 'text'], ['start hour', 'number'], ['start minute', 'number'], ['end hour', 'number'], ['end minute', 'number']]

 -- Table: prerequisite 
columns : [['course id', 'text'], ['prerequisite id', 'text']]

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



Question: What are the names of instructors who didn't teach?
SQL: SELECT name FROM instructor WHERE id NOT IN (SELECT id FROM teaches)
-- Language PostgreSQL
        -- Tables: 
             -- Table: classroom 
columns : [['building', 'text'], ['room number', 'text'], ['capacity', 'number']]

 -- Table: department 
columns : [['department name', 'text'], ['building', 'text'], ['budget', 'number']]

 -- Table: course 
columns : [['course id', 'text'], ['title', 'text'], ['department name', 'text'], ['credits', 'number']]

 -- Table: instructor 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['salary', 'number']]

 -- Table: section 
columns : [['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['building', 'text'], ['room number', 'text'], ['time slot id', 'text']]

 -- Table: teaches 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number']]

 -- Table: student 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['total credits', 'number']]

 -- Table: takes classes 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['grade', 'text']]

 -- Table: advisor 
columns : [['student id', 'text'], ['instructor id', 'text']]

 -- Table: time slot 
columns : [['time slot id', 'text'], ['day', 'text'], ['start hour', 'number'], ['start minute', 'number'], ['end hour', 'number'], ['end minute', 'number']]

 -- Table: prerequisite 
columns : [['course id', 'text'], ['prerequisite id', 'text']]

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



Question: Find the id of instructors who didn't teach any courses?
SQL: SELECT id FROM instructor EXCEPT SELECT id FROM teaches
-- Language PostgreSQL
        -- Tables: 
             -- Table: classroom 
columns : [['building', 'text'], ['room number', 'text'], ['capacity', 'number']]

 -- Table: department 
columns : [['department name', 'text'], ['building', 'text'], ['budget', 'number']]

 -- Table: course 
columns : [['course id', 'text'], ['title', 'text'], ['department name', 'text'], ['credits', 'number']]

 -- Table: instructor 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['salary', 'number']]

 -- Table: section 
columns : [['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['building', 'text'], ['room number', 'text'], ['time slot id', 'text']]

 -- Table: teaches 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number']]

 -- Table: student 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['total credits', 'number']]

 -- Table: takes classes 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['grade', 'text']]

 -- Table: advisor 
columns : [['student id', 'text'], ['instructor id', 'text']]

 -- Table: time slot 
columns : [['time slot id', 'text'], ['day', 'text'], ['start hour', 'number'], ['start minute', 'number'], ['end hour', 'number'], ['end minute', 'number']]

 -- Table: prerequisite 
columns : [['course id', 'text'], ['prerequisite id', 'text']]

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



Question: What are the ids of instructors who didnt' teach?
SQL: SELECT id FROM instructor EXCEPT SELECT id FROM teaches
-- Language PostgreSQL
        -- Tables: 
             -- Table: classroom 
columns : [['building', 'text'], ['room number', 'text'], ['capacity', 'number']]

 -- Table: department 
columns : [['department name', 'text'], ['building', 'text'], ['budget', 'number']]

 -- Table: course 
columns : [['course id', 'text'], ['title', 'text'], ['department name', 'text'], ['credits', 'number']]

 -- Table: instructor 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['salary', 'number']]

 -- Table: section 
columns : [['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['building', 'text'], ['room number', 'text'], ['time slot id', 'text']]

 -- Table: teaches 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number']]

 -- Table: student 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['total credits', 'number']]

 -- Table: takes classes 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['grade', 'text']]

 -- Table: advisor 
columns : [['student id', 'text'], ['instructor id', 'text']]

 -- Table: time slot 
columns : [['time slot id', 'text'], ['day', 'text'], ['start hour', 'number'], ['start minute', 'number'], ['end hour', 'number'], ['end minute', 'number']]

 -- Table: prerequisite 
columns : [['course id', 'text'], ['prerequisite id', 'text']]

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



Question: Find the names of instructors who didn't each any courses in any Spring semester.
SQL: SELECT name FROM instructor WHERE id NOT IN (SELECT id FROM teaches WHERE semester  =  'Spring')
-- Language PostgreSQL
        -- Tables: 
             -- Table: classroom 
columns : [['building', 'text'], ['room number', 'text'], ['capacity', 'number']]

 -- Table: department 
columns : [['department name', 'text'], ['building', 'text'], ['budget', 'number']]

 -- Table: course 
columns : [['course id', 'text'], ['title', 'text'], ['department name', 'text'], ['credits', 'number']]

 -- Table: instructor 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['salary', 'number']]

 -- Table: section 
columns : [['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['building', 'text'], ['room number', 'text'], ['time slot id', 'text']]

 -- Table: teaches 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number']]

 -- Table: student 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['total credits', 'number']]

 -- Table: takes classes 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['grade', 'text']]

 -- Table: advisor 
columns : [['student id', 'text'], ['instructor id', 'text']]

 -- Table: time slot 
columns : [['time slot id', 'text'], ['day', 'text'], ['start hour', 'number'], ['start minute', 'number'], ['end hour', 'number'], ['end minute', 'number']]

 -- Table: prerequisite 
columns : [['course id', 'text'], ['prerequisite id', 'text']]

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



Question: What are the names of instructors who didn't teach courses in the Spring?
SQL: SELECT name FROM instructor WHERE id NOT IN (SELECT id FROM teaches WHERE semester  =  'Spring')
-- Language PostgreSQL
        -- Tables: 
             -- Table: classroom 
columns : [['building', 'text'], ['room number', 'text'], ['capacity', 'number']]

 -- Table: department 
columns : [['department name', 'text'], ['building', 'text'], ['budget', 'number']]

 -- Table: course 
columns : [['course id', 'text'], ['title', 'text'], ['department name', 'text'], ['credits', 'number']]

 -- Table: instructor 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['salary', 'number']]

 -- Table: section 
columns : [['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['building', 'text'], ['room number', 'text'], ['time slot id', 'text']]

 -- Table: teaches 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number']]

 -- Table: student 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['total credits', 'number']]

 -- Table: takes classes 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['grade', 'text']]

 -- Table: advisor 
columns : [['student id', 'text'], ['instructor id', 'text']]

 -- Table: time slot 
columns : [['time slot id', 'text'], ['day', 'text'], ['start hour', 'number'], ['start minute', 'number'], ['end hour', 'number'], ['end minute', 'number']]

 -- Table: prerequisite 
columns : [['course id', 'text'], ['prerequisite id', 'text']]

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



Question: Find the name of the department which has the highest average salary of professors.
SQL: SELECT dept_name FROM instructor GROUP BY dept_name ORDER BY avg(salary) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: classroom 
columns : [['building', 'text'], ['room number', 'text'], ['capacity', 'number']]

 -- Table: department 
columns : [['department name', 'text'], ['building', 'text'], ['budget', 'number']]

 -- Table: course 
columns : [['course id', 'text'], ['title', 'text'], ['department name', 'text'], ['credits', 'number']]

 -- Table: instructor 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['salary', 'number']]

 -- Table: section 
columns : [['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['building', 'text'], ['room number', 'text'], ['time slot id', 'text']]

 -- Table: teaches 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number']]

 -- Table: student 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['total credits', 'number']]

 -- Table: takes classes 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['grade', 'text']]

 -- Table: advisor 
columns : [['student id', 'text'], ['instructor id', 'text']]

 -- Table: time slot 
columns : [['time slot id', 'text'], ['day', 'text'], ['start hour', 'number'], ['start minute', 'number'], ['end hour', 'number'], ['end minute', 'number']]

 -- Table: prerequisite 
columns : [['course id', 'text'], ['prerequisite id', 'text']]

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



Question: Which department has the highest average instructor salary?
SQL: SELECT dept_name FROM instructor GROUP BY dept_name ORDER BY avg(salary) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: classroom 
columns : [['building', 'text'], ['room number', 'text'], ['capacity', 'number']]

 -- Table: department 
columns : [['department name', 'text'], ['building', 'text'], ['budget', 'number']]

 -- Table: course 
columns : [['course id', 'text'], ['title', 'text'], ['department name', 'text'], ['credits', 'number']]

 -- Table: instructor 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['salary', 'number']]

 -- Table: section 
columns : [['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['building', 'text'], ['room number', 'text'], ['time slot id', 'text']]

 -- Table: teaches 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number']]

 -- Table: student 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['total credits', 'number']]

 -- Table: takes classes 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['grade', 'text']]

 -- Table: advisor 
columns : [['student id', 'text'], ['instructor id', 'text']]

 -- Table: time slot 
columns : [['time slot id', 'text'], ['day', 'text'], ['start hour', 'number'], ['start minute', 'number'], ['end hour', 'number'], ['end minute', 'number']]

 -- Table: prerequisite 
columns : [['course id', 'text'], ['prerequisite id', 'text']]

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



Question: Find the number and averaged salary of all instructors who are in the department with the highest budget.
SQL: SELECT avg(T1.salary) ,  count(*) FROM instructor AS T1 JOIN department AS T2 ON T1.dept_name  =  T2.dept_name ORDER BY T2.budget DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: classroom 
columns : [['building', 'text'], ['room number', 'text'], ['capacity', 'number']]

 -- Table: department 
columns : [['department name', 'text'], ['building', 'text'], ['budget', 'number']]

 -- Table: course 
columns : [['course id', 'text'], ['title', 'text'], ['department name', 'text'], ['credits', 'number']]

 -- Table: instructor 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['salary', 'number']]

 -- Table: section 
columns : [['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['building', 'text'], ['room number', 'text'], ['time slot id', 'text']]

 -- Table: teaches 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number']]

 -- Table: student 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['total credits', 'number']]

 -- Table: takes classes 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['grade', 'text']]

 -- Table: advisor 
columns : [['student id', 'text'], ['instructor id', 'text']]

 -- Table: time slot 
columns : [['time slot id', 'text'], ['day', 'text'], ['start hour', 'number'], ['start minute', 'number'], ['end hour', 'number'], ['end minute', 'number']]

 -- Table: prerequisite 
columns : [['course id', 'text'], ['prerequisite id', 'text']]

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



Question: How many instructors are in the department with the highest budget, and what is their average salary?
SQL: SELECT avg(T1.salary) ,  count(*) FROM instructor AS T1 JOIN department AS T2 ON T1.dept_name  =  T2.dept_name ORDER BY T2.budget DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: classroom 
columns : [['building', 'text'], ['room number', 'text'], ['capacity', 'number']]

 -- Table: department 
columns : [['department name', 'text'], ['building', 'text'], ['budget', 'number']]

 -- Table: course 
columns : [['course id', 'text'], ['title', 'text'], ['department name', 'text'], ['credits', 'number']]

 -- Table: instructor 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['salary', 'number']]

 -- Table: section 
columns : [['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['building', 'text'], ['room number', 'text'], ['time slot id', 'text']]

 -- Table: teaches 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number']]

 -- Table: student 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['total credits', 'number']]

 -- Table: takes classes 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['grade', 'text']]

 -- Table: advisor 
columns : [['student id', 'text'], ['instructor id', 'text']]

 -- Table: time slot 
columns : [['time slot id', 'text'], ['day', 'text'], ['start hour', 'number'], ['start minute', 'number'], ['end hour', 'number'], ['end minute', 'number']]

 -- Table: prerequisite 
columns : [['course id', 'text'], ['prerequisite id', 'text']]

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



Question: What is the title and credits of the course that is taught in the largest classroom (with the highest capacity)?
SQL: SELECT T3.title ,  T3.credits FROM classroom AS T1 JOIN SECTION AS T2 ON T1.building  =  T2.building AND T1.room_number  =  T2.room_number JOIN course AS T3 ON T2.course_id  =  T3.course_id WHERE T1.capacity  =  (SELECT max(capacity) FROM classroom)
-- Language PostgreSQL
        -- Tables: 
             -- Table: classroom 
columns : [['building', 'text'], ['room number', 'text'], ['capacity', 'number']]

 -- Table: department 
columns : [['department name', 'text'], ['building', 'text'], ['budget', 'number']]

 -- Table: course 
columns : [['course id', 'text'], ['title', 'text'], ['department name', 'text'], ['credits', 'number']]

 -- Table: instructor 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['salary', 'number']]

 -- Table: section 
columns : [['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['building', 'text'], ['room number', 'text'], ['time slot id', 'text']]

 -- Table: teaches 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number']]

 -- Table: student 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['total credits', 'number']]

 -- Table: takes classes 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['grade', 'text']]

 -- Table: advisor 
columns : [['student id', 'text'], ['instructor id', 'text']]

 -- Table: time slot 
columns : [['time slot id', 'text'], ['day', 'text'], ['start hour', 'number'], ['start minute', 'number'], ['end hour', 'number'], ['end minute', 'number']]

 -- Table: prerequisite 
columns : [['course id', 'text'], ['prerequisite id', 'text']]

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



Question: Give the title and credits for the course that is taught in the classroom with the greatest capacity.
SQL: SELECT T3.title ,  T3.credits FROM classroom AS T1 JOIN SECTION AS T2 ON T1.building  =  T2.building AND T1.room_number  =  T2.room_number JOIN course AS T3 ON T2.course_id  =  T3.course_id WHERE T1.capacity  =  (SELECT max(capacity) FROM classroom)
-- Language PostgreSQL
        -- Tables: 
             -- Table: classroom 
columns : [['building', 'text'], ['room number', 'text'], ['capacity', 'number']]

 -- Table: department 
columns : [['department name', 'text'], ['building', 'text'], ['budget', 'number']]

 -- Table: course 
columns : [['course id', 'text'], ['title', 'text'], ['department name', 'text'], ['credits', 'number']]

 -- Table: instructor 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['salary', 'number']]

 -- Table: section 
columns : [['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['building', 'text'], ['room number', 'text'], ['time slot id', 'text']]

 -- Table: teaches 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number']]

 -- Table: student 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['total credits', 'number']]

 -- Table: takes classes 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['grade', 'text']]

 -- Table: advisor 
columns : [['student id', 'text'], ['instructor id', 'text']]

 -- Table: time slot 
columns : [['time slot id', 'text'], ['day', 'text'], ['start hour', 'number'], ['start minute', 'number'], ['end hour', 'number'], ['end minute', 'number']]

 -- Table: prerequisite 
columns : [['course id', 'text'], ['prerequisite id', 'text']]

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



Question: Find the name of students who didn't take any course from Biology department.
SQL: SELECT name FROM student WHERE id NOT IN (SELECT T1.id FROM takes AS T1 JOIN course AS T2 ON T1.course_id  =  T2.course_id WHERE T2.dept_name  =  'Biology')
-- Language PostgreSQL
        -- Tables: 
             -- Table: classroom 
columns : [['building', 'text'], ['room number', 'text'], ['capacity', 'number']]

 -- Table: department 
columns : [['department name', 'text'], ['building', 'text'], ['budget', 'number']]

 -- Table: course 
columns : [['course id', 'text'], ['title', 'text'], ['department name', 'text'], ['credits', 'number']]

 -- Table: instructor 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['salary', 'number']]

 -- Table: section 
columns : [['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['building', 'text'], ['room number', 'text'], ['time slot id', 'text']]

 -- Table: teaches 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number']]

 -- Table: student 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['total credits', 'number']]

 -- Table: takes classes 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['grade', 'text']]

 -- Table: advisor 
columns : [['student id', 'text'], ['instructor id', 'text']]

 -- Table: time slot 
columns : [['time slot id', 'text'], ['day', 'text'], ['start hour', 'number'], ['start minute', 'number'], ['end hour', 'number'], ['end minute', 'number']]

 -- Table: prerequisite 
columns : [['course id', 'text'], ['prerequisite id', 'text']]

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



Question: What are the names of students who haven't taken any Biology courses?
SQL: SELECT name FROM student WHERE id NOT IN (SELECT T1.id FROM takes AS T1 JOIN course AS T2 ON T1.course_id  =  T2.course_id WHERE T2.dept_name  =  'Biology')
-- Language PostgreSQL
        -- Tables: 
             -- Table: classroom 
columns : [['building', 'text'], ['room number', 'text'], ['capacity', 'number']]

 -- Table: department 
columns : [['department name', 'text'], ['building', 'text'], ['budget', 'number']]

 -- Table: course 
columns : [['course id', 'text'], ['title', 'text'], ['department name', 'text'], ['credits', 'number']]

 -- Table: instructor 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['salary', 'number']]

 -- Table: section 
columns : [['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['building', 'text'], ['room number', 'text'], ['time slot id', 'text']]

 -- Table: teaches 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number']]

 -- Table: student 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['total credits', 'number']]

 -- Table: takes classes 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['grade', 'text']]

 -- Table: advisor 
columns : [['student id', 'text'], ['instructor id', 'text']]

 -- Table: time slot 
columns : [['time slot id', 'text'], ['day', 'text'], ['start hour', 'number'], ['start minute', 'number'], ['end hour', 'number'], ['end minute', 'number']]

 -- Table: prerequisite 
columns : [['course id', 'text'], ['prerequisite id', 'text']]

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



Question: Find the total number of students and total number of instructors for each department.
SQL: SELECT count(DISTINCT T2.id) ,  count(DISTINCT T3.id) ,  T3.dept_name FROM department AS T1 JOIN student AS T2 ON T1.dept_name  =  T2.dept_name JOIN instructor AS T3 ON T1.dept_name  =  T3.dept_name GROUP BY T3.dept_name
-- Language PostgreSQL
        -- Tables: 
             -- Table: classroom 
columns : [['building', 'text'], ['room number', 'text'], ['capacity', 'number']]

 -- Table: department 
columns : [['department name', 'text'], ['building', 'text'], ['budget', 'number']]

 -- Table: course 
columns : [['course id', 'text'], ['title', 'text'], ['department name', 'text'], ['credits', 'number']]

 -- Table: instructor 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['salary', 'number']]

 -- Table: section 
columns : [['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['building', 'text'], ['room number', 'text'], ['time slot id', 'text']]

 -- Table: teaches 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number']]

 -- Table: student 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['total credits', 'number']]

 -- Table: takes classes 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['grade', 'text']]

 -- Table: advisor 
columns : [['student id', 'text'], ['instructor id', 'text']]

 -- Table: time slot 
columns : [['time slot id', 'text'], ['day', 'text'], ['start hour', 'number'], ['start minute', 'number'], ['end hour', 'number'], ['end minute', 'number']]

 -- Table: prerequisite 
columns : [['course id', 'text'], ['prerequisite id', 'text']]

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



Question: How many students and instructors are in each department?
SQL: SELECT count(DISTINCT T2.id) ,  count(DISTINCT T3.id) ,  T3.dept_name FROM department AS T1 JOIN student AS T2 ON T1.dept_name  =  T2.dept_name JOIN instructor AS T3 ON T1.dept_name  =  T3.dept_name GROUP BY T3.dept_name
-- Language PostgreSQL
        -- Tables: 
             -- Table: classroom 
columns : [['building', 'text'], ['room number', 'text'], ['capacity', 'number']]

 -- Table: department 
columns : [['department name', 'text'], ['building', 'text'], ['budget', 'number']]

 -- Table: course 
columns : [['course id', 'text'], ['title', 'text'], ['department name', 'text'], ['credits', 'number']]

 -- Table: instructor 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['salary', 'number']]

 -- Table: section 
columns : [['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['building', 'text'], ['room number', 'text'], ['time slot id', 'text']]

 -- Table: teaches 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number']]

 -- Table: student 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['total credits', 'number']]

 -- Table: takes classes 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['grade', 'text']]

 -- Table: advisor 
columns : [['student id', 'text'], ['instructor id', 'text']]

 -- Table: time slot 
columns : [['time slot id', 'text'], ['day', 'text'], ['start hour', 'number'], ['start minute', 'number'], ['end hour', 'number'], ['end minute', 'number']]

 -- Table: prerequisite 
columns : [['course id', 'text'], ['prerequisite id', 'text']]

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



Question: Find the name of students who have taken the prerequisite course of the course with title International Finance.
SQL: SELECT T1.name FROM student AS T1 JOIN takes AS T2 ON T1.id  =  T2.id WHERE T2.course_id IN (SELECT T4.prereq_id FROM course AS T3 JOIN prereq AS T4 ON T3.course_id  =  T4.course_id WHERE T3.title  =  'International Finance')
-- Language PostgreSQL
        -- Tables: 
             -- Table: classroom 
columns : [['building', 'text'], ['room number', 'text'], ['capacity', 'number']]

 -- Table: department 
columns : [['department name', 'text'], ['building', 'text'], ['budget', 'number']]

 -- Table: course 
columns : [['course id', 'text'], ['title', 'text'], ['department name', 'text'], ['credits', 'number']]

 -- Table: instructor 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['salary', 'number']]

 -- Table: section 
columns : [['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['building', 'text'], ['room number', 'text'], ['time slot id', 'text']]

 -- Table: teaches 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number']]

 -- Table: student 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['total credits', 'number']]

 -- Table: takes classes 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['grade', 'text']]

 -- Table: advisor 
columns : [['student id', 'text'], ['instructor id', 'text']]

 -- Table: time slot 
columns : [['time slot id', 'text'], ['day', 'text'], ['start hour', 'number'], ['start minute', 'number'], ['end hour', 'number'], ['end minute', 'number']]

 -- Table: prerequisite 
columns : [['course id', 'text'], ['prerequisite id', 'text']]

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



Question: What are the names of students who have taken the prerequisite for the course International Finance?
SQL: SELECT T1.name FROM student AS T1 JOIN takes AS T2 ON T1.id  =  T2.id WHERE T2.course_id IN (SELECT T4.prereq_id FROM course AS T3 JOIN prereq AS T4 ON T3.course_id  =  T4.course_id WHERE T3.title  =  'International Finance')
-- Language PostgreSQL
        -- Tables: 
             -- Table: classroom 
columns : [['building', 'text'], ['room number', 'text'], ['capacity', 'number']]

 -- Table: department 
columns : [['department name', 'text'], ['building', 'text'], ['budget', 'number']]

 -- Table: course 
columns : [['course id', 'text'], ['title', 'text'], ['department name', 'text'], ['credits', 'number']]

 -- Table: instructor 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['salary', 'number']]

 -- Table: section 
columns : [['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['building', 'text'], ['room number', 'text'], ['time slot id', 'text']]

 -- Table: teaches 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number']]

 -- Table: student 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['total credits', 'number']]

 -- Table: takes classes 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['grade', 'text']]

 -- Table: advisor 
columns : [['student id', 'text'], ['instructor id', 'text']]

 -- Table: time slot 
columns : [['time slot id', 'text'], ['day', 'text'], ['start hour', 'number'], ['start minute', 'number'], ['end hour', 'number'], ['end minute', 'number']]

 -- Table: prerequisite 
columns : [['course id', 'text'], ['prerequisite id', 'text']]

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



Question: Find the name and salary of instructors whose salary is below the average salary of the instructors in the Physics department.
SQL: SELECT name ,  salary FROM instructor WHERE salary  <  (SELECT avg(salary) FROM instructor WHERE dept_name  =  'Physics')
-- Language PostgreSQL
        -- Tables: 
             -- Table: classroom 
columns : [['building', 'text'], ['room number', 'text'], ['capacity', 'number']]

 -- Table: department 
columns : [['department name', 'text'], ['building', 'text'], ['budget', 'number']]

 -- Table: course 
columns : [['course id', 'text'], ['title', 'text'], ['department name', 'text'], ['credits', 'number']]

 -- Table: instructor 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['salary', 'number']]

 -- Table: section 
columns : [['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['building', 'text'], ['room number', 'text'], ['time slot id', 'text']]

 -- Table: teaches 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number']]

 -- Table: student 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['total credits', 'number']]

 -- Table: takes classes 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['grade', 'text']]

 -- Table: advisor 
columns : [['student id', 'text'], ['instructor id', 'text']]

 -- Table: time slot 
columns : [['time slot id', 'text'], ['day', 'text'], ['start hour', 'number'], ['start minute', 'number'], ['end hour', 'number'], ['end minute', 'number']]

 -- Table: prerequisite 
columns : [['course id', 'text'], ['prerequisite id', 'text']]

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



Question: What are the names and salaries for instructors who earn less than the average salary of instructors in the Physics department?
SQL: SELECT name ,  salary FROM instructor WHERE salary  <  (SELECT avg(salary) FROM instructor WHERE dept_name  =  'Physics')
-- Language PostgreSQL
        -- Tables: 
             -- Table: classroom 
columns : [['building', 'text'], ['room number', 'text'], ['capacity', 'number']]

 -- Table: department 
columns : [['department name', 'text'], ['building', 'text'], ['budget', 'number']]

 -- Table: course 
columns : [['course id', 'text'], ['title', 'text'], ['department name', 'text'], ['credits', 'number']]

 -- Table: instructor 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['salary', 'number']]

 -- Table: section 
columns : [['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['building', 'text'], ['room number', 'text'], ['time slot id', 'text']]

 -- Table: teaches 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number']]

 -- Table: student 
columns : [['id', 'text'], ['name', 'text'], ['department name', 'text'], ['total credits', 'number']]

 -- Table: takes classes 
columns : [['id', 'text'], ['course id', 'text'], ['section id', 'text'], ['semester', 'text'], ['year', 'number'], ['grade', 'text']]

 -- Table: advisor 
columns : [['student id', 'text'], ['instructor id', 'text']]

 -- Table: time slot 
columns : [['time slot id', 'text'], ['day', 'text'], ['start hour', 'number'], ['start minute', 'number'], ['end hour', 'number'], ['end minute', 'number']]

 -- Table: prerequisite 
columns : [['course id', 'text'], ['prerequisite id', 'text']]

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



Question: Find the name of students who took some course offered by Statistics department.
SQL: SELECT T3.name FROM course AS T1 JOIN takes AS T2 ON T1.course_id  =  T2.course_id JOIN student AS T3 ON T2.id  =  T3.id WHERE T1.dept_name  =  'Statistics'