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: What are the names of students who have taken Statistics courses?
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'
-- 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 building, room number, semester and year of all courses offered by Psychology department sorted by course titles.
SQL: SELECT T2.building ,  T2.room_number ,  T2.semester ,  T2.year FROM course AS T1 JOIN SECTION AS T2 ON T1.course_id  =  T2.course_id WHERE T1.dept_name  =  'Psychology' ORDER BY T1.title
-- 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 building, room number, semester and year of courses in the Psychology department, sorted using course title?
SQL: SELECT T2.building ,  T2.room_number ,  T2.semester ,  T2.year FROM course AS T1 JOIN SECTION AS T2 ON T1.course_id  =  T2.course_id WHERE T1.dept_name  =  'Psychology' ORDER BY T1.title
-- 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 all instructors in computer science department
SQL: SELECT name FROM instructor WHERE dept_name  =  'Comp. Sci.'
-- 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 all instructors in the Comp. Sci. department?
SQL: SELECT name FROM instructor WHERE dept_name  =  'Comp. Sci.'
-- 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 all instructors in Comp. Sci. department with salary > 80000.
SQL: SELECT name FROM instructor WHERE dept_name  =  'Comp. Sci.'  AND salary  >  80000
-- 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 the instructors in the Comp. Sci. department who earn more than 80000?
SQL: SELECT name FROM instructor WHERE dept_name  =  'Comp. Sci.'  AND salary  >  80000
-- 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 all instructors who have taught some course and the course_id.
SQL: SELECT name ,  course_id FROM instructor AS T1 JOIN teaches AS T2 ON T1.ID  =  T2.ID
-- 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 all instructors who have taught a course, as well as the corresponding course id?
SQL: SELECT name ,  course_id FROM instructor AS T1 JOIN teaches AS T2 ON T1.ID  =  T2.ID
-- 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 all instructors in the Art department who have taught some course and the course_id.
SQL: SELECT name ,  course_id FROM instructor AS T1 JOIN teaches AS T2 ON T1.ID  =  T2.ID WHERE T1.dept_name  =  'Art'
-- 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 Art instructors who have taught a course, and the corresponding course id?
SQL: SELECT name ,  course_id FROM instructor AS T1 JOIN teaches AS T2 ON T1.ID  =  T2.ID WHERE T1.dept_name  =  'Art'
-- 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 all instructors whose name includes the substring “dar”.
SQL: SELECT name FROM instructor WHERE name LIKE '%dar%'
-- 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 all instructors with names that include "dar"?
SQL: SELECT name FROM instructor WHERE name LIKE '%dar%'
-- 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: List in alphabetic order the names of all distinct instructors.
SQL: SELECT DISTINCT name FROM  instructor ORDER BY 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: List the distinct names of the instructors, ordered by name.
SQL: SELECT DISTINCT name FROM  instructor ORDER BY 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 courses that ran in Fall 2009 or in Spring 2010.
SQL: SELECT course_id FROM SECTION WHERE semester  =  'Fall' AND YEAR  =  2009 UNION SELECT course_id FROM SECTION WHERE semester  =  'Spring' AND YEAR  =  2010
-- 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 for courses in the Fall of 2009 or the Spring of 2010?
SQL: SELECT course_id FROM SECTION WHERE semester  =  'Fall' AND YEAR  =  2009 UNION SELECT course_id FROM SECTION WHERE semester  =  'Spring' AND YEAR  =  2010
-- 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 courses that ran in Fall 2009 and in Spring 2010.
SQL: SELECT course_id FROM SECTION WHERE semester  =  'Fall' AND YEAR  =  2009 INTERSECT SELECT course_id FROM SECTION WHERE semester  =  'Spring' AND YEAR  =  2010
-- 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 for courses that were offered in both Fall of 2009 and Spring of 2010?
SQL: SELECT course_id FROM SECTION WHERE semester  =  'Fall' AND YEAR  =  2009 INTERSECT SELECT course_id FROM SECTION WHERE semester  =  'Spring' AND YEAR  =  2010
-- 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 courses that ran in Fall 2009 but not in Spring 2010.
SQL: SELECT course_id FROM SECTION WHERE semester  =  'Fall' AND YEAR  =  2009 EXCEPT SELECT course_id FROM SECTION WHERE semester  =  'Spring' AND YEAR  =  2010
-- 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 courses offered in Fall of 2009 but not in Spring of 2010?
SQL: SELECT course_id FROM SECTION WHERE semester  =  'Fall' AND YEAR  =  2009 EXCEPT SELECT course_id FROM SECTION WHERE semester  =  'Spring' AND YEAR  =  2010
-- 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 salaries of all distinct instructors that are less than the largest salary.
SQL: SELECT DISTINCT salary FROM instructor WHERE salary  <  (SELECT max(salary) FROM instructor)
-- 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 distinct salaries of all instructors who earned less than the maximum salary?
SQL: SELECT DISTINCT salary FROM instructor WHERE salary  <  (SELECT max(salary) FROM instructor)
-- 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 instructors who teach a course in the Spring 2010 semester.
SQL: SELECT COUNT (DISTINCT ID) FROM teaches WHERE semester  =  'Spring' AND YEAR  =  2010