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: Count the number of courses in the Physics department.
SQL: SELECT count(DISTINCT course_id) FROM course 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 title of courses that have two prerequisites?
SQL: SELECT T1.title FROM course AS T1 JOIN prereq AS T2 ON T1.course_id  =  T2.course_id GROUP BY T2.course_id HAVING count(*)  =  2
-- 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 titles for courses with two prerequisites?
SQL: SELECT T1.title FROM course AS T1 JOIN prereq AS T2 ON T1.course_id  =  T2.course_id GROUP BY T2.course_id HAVING count(*)  =  2
-- 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 title, credit, and department name of courses that have more than one prerequisites?
SQL: SELECT T1.title ,  T1.credits , T1.dept_name FROM course AS T1 JOIN prereq AS T2 ON T1.course_id  =  T2.course_id GROUP BY T2.course_id HAVING count(*)  >  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, credit value, and department name for courses with more than one prerequisite?
SQL: SELECT T1.title ,  T1.credits , T1.dept_name FROM course AS T1 JOIN prereq AS T2 ON T1.course_id  =  T2.course_id GROUP BY T2.course_id HAVING count(*)  >  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 courses that do not have prerequisite?
SQL: SELECT count(*) FROM course WHERE course_id NOT IN (SELECT course_id FROM prereq)
-- 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: Count the number of courses without prerequisites.
SQL: SELECT count(*) FROM course WHERE course_id NOT IN (SELECT course_id FROM prereq)
-- 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 courses that do not have any prerequisite?
SQL: SELECT title FROM course WHERE course_id NOT IN (SELECT course_id FROM prereq)
-- 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 titles of courses without prerequisites?
SQL: SELECT title FROM course WHERE course_id NOT IN (SELECT course_id FROM prereq)
-- 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 different instructors have taught some course?
SQL: SELECT COUNT (DISTINCT 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: Count the number of distinct instructors who have taught a course.
SQL: SELECT COUNT (DISTINCT 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 total budgets of the Marketing or Finance department.
SQL: SELECT sum(budget) FROM department WHERE dept_name  =  'Marketing' OR dept_name  =  '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 is the sum of budgets of the Marketing and Finance departments?
SQL: SELECT sum(budget) FROM department WHERE dept_name  =  'Marketing' OR dept_name  =  '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 department name of the instructor whose name contains 'Soisalon'.
SQL: SELECT dept_name FROM instructor WHERE name LIKE '%Soisalon%'
-- 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 department with an instructure who has a name like 'Soisalon'?
SQL: SELECT dept_name FROM instructor WHERE name LIKE '%Soisalon%'
-- 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 rooms whose capacity is less than 50 does the Lamberton building have?
SQL: SELECT count(*) FROM classroom WHERE building  =  'Lamberton' AND capacity  <  50
-- 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: Count the number of rooms in Lamberton with capacity lower than 50.
SQL: SELECT count(*) FROM classroom WHERE building  =  'Lamberton' AND capacity  <  50
-- 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 budget of departments whose budgets are more than the average budget.
SQL: SELECT dept_name ,  budget FROM department WHERE budget  >  (SELECT avg(budget) FROM department)
-- 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 budgets of departments with budgets greater than the average?
SQL: SELECT dept_name ,  budget FROM department WHERE budget  >  (SELECT avg(budget) FROM department)
-- 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 is in Statistics department and earns the lowest salary?
SQL: SELECT name FROM instructor WHERE dept_name  =  'Statistics' ORDER BY salary 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: Give the name of the lowest earning instructor in the Statistics department.
SQL: SELECT name FROM instructor WHERE dept_name  =  'Statistics' ORDER BY salary 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 title of course that is provided by both Statistics and Psychology departments.
SQL: SELECT title FROM course WHERE dept_name  =  'Statistics' INTERSECT SELECT title FROM course WHERE dept_name  =  'Psychology'
-- 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 of a course that is listed in both the Statistics and Psychology departments?
SQL: SELECT title FROM course WHERE dept_name  =  'Statistics' INTERSECT SELECT title FROM course WHERE dept_name  =  'Psychology'
-- 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 title of course that is provided by Statistics but not Psychology departments.
SQL: SELECT title FROM course WHERE dept_name  =  'Statistics' EXCEPT SELECT title FROM course WHERE dept_name  =  'Psychology'