sert121/SpiderSQL huggingface dataset:
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', '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 different scientists assigned to any project.
SQL: SELECT count(DISTINCT scientist) FROM assignedto
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', 'text']]

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



Question: Find the number of distinct projects.
SQL: SELECT count(DISTINCT name) FROM projects
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', '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 projects are there?
SQL: SELECT count(DISTINCT name) FROM projects
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', '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 average hours of all projects.
SQL: SELECT avg(hours) FROM projects
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', '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 average hours across all projects?
SQL: SELECT avg(hours) FROM projects
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', '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 project that continues for the longest time.
SQL: SELECT name FROM projects ORDER BY hours DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', '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 project with the most hours?
SQL: SELECT name FROM projects ORDER BY hours DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', '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 name of all projects that are operated longer than the average working hours of all projects.
SQL: SELECT name FROM projects WHERE hours  >  (SELECT avg(hours) FROM projects)
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', '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 projects that have taken longer than the average number of hours for all projects?
SQL: SELECT name FROM projects WHERE hours  >  (SELECT avg(hours) FROM projects)
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', '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 hours of project that has the most number of scientists.
SQL: SELECT T1.name ,  T1.hours FROM projects AS T1 JOIN assignedto AS T2 ON T1.code  =  T2.project GROUP BY T2.project ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', '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 and hours for the project which has the most scientists assigned to it?
SQL: SELECT T1.name ,  T1.hours FROM projects AS T1 JOIN assignedto AS T2 ON T1.code  =  T2.project GROUP BY T2.project ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', '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 project for which a scientist whose name contains ‘Smith’ is assigned to.
SQL: SELECT T2.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project  =  T2.code JOIN scientists AS T3 ON T1.scientist  =  T3.SSN WHERE T3.name LIKE '%Smith%'
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', '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 project that has a scientist assigned to it whose name contains 'Smith'?
SQL: SELECT T2.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project  =  T2.code JOIN scientists AS T3 ON T1.scientist  =  T3.SSN WHERE T3.name LIKE '%Smith%'
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', '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 hours of the projects that scientists named Michael Rogers or Carol Smith are assigned to.
SQL: SELECT sum(T2.hours) FROM assignedto AS T1 JOIN projects AS T2 ON T1.project  =  T2.code JOIN scientists AS T3 ON T1.scientist  =  T3.SSN WHERE T3.name  =  'Michael Rogers' OR T3.name  =  'Carol Smith'
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', '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 hours for projects that scientists with the name Michael Rogers or Carol Smith are assigned to?
SQL: SELECT sum(T2.hours) FROM assignedto AS T1 JOIN projects AS T2 ON T1.project  =  T2.code JOIN scientists AS T3 ON T1.scientist  =  T3.SSN WHERE T3.name  =  'Michael Rogers' OR T3.name  =  'Carol Smith'
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', '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 projects that require between 100 and 300 hours of work.
SQL: SELECT name FROM projects WHERE hours BETWEEN 100 AND 300
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', '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 projects that require between 100 and 300 hours?
SQL: SELECT name FROM projects WHERE hours BETWEEN 100 AND 300
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', '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 scientist who worked on both a project named 'Matter of Time' and a project named 'A Puzzling Parallax'.
SQL: SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project  =  T2.code JOIN scientists AS T3 ON T1.scientist  =  T3.SSN WHERE T2.name  =  'Matter of Time' INTERSECT SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project  =  T2.code JOIN scientists AS T3 ON T1.scientist  =  T3.SSN WHERE T2.name  =  'A Puzzling Parallax'
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', '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 any scientists who worked on projects named 'Matter of Time' and 'A Puzzling Pattern'?
SQL: SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project  =  T2.code JOIN scientists AS T3 ON T1.scientist  =  T3.SSN WHERE T2.name  =  'Matter of Time' INTERSECT SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project  =  T2.code JOIN scientists AS T3 ON T1.scientist  =  T3.SSN WHERE T2.name  =  'A Puzzling Parallax'
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', '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 names of all scientists sorted in alphabetical order.
SQL: SELECT name FROM scientists ORDER BY name
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', '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 the scientists in alphabetical order?
SQL: SELECT name FROM scientists ORDER BY name
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', 'text']]

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



Question: Find the number of scientists involved for each project name.
SQL: SELECT count(*) ,  T1.name FROM projects AS T1 JOIN assignedto AS T2 ON T1.code  =  T2.project GROUP BY T1.name
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', '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 naems of all the projects, and how many scientists were assigned to each of them?
SQL: SELECT count(*) ,  T1.name FROM projects AS T1 JOIN assignedto AS T2 ON T1.code  =  T2.project GROUP BY T1.name
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', 'text']]

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



Question: Find the number of scientists involved for the projects that require more than 300 hours.
SQL: SELECT count(*) ,  T1.name FROM projects AS T1 JOIN assignedto AS T2 ON T1.code  =  T2.project WHERE T1.hours  >  300 GROUP BY T1.name
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', '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 projects that require more than 300 hours, and how many scientists are assigned to each?
SQL: SELECT count(*) ,  T1.name FROM projects AS T1 JOIN assignedto AS T2 ON T1.code  =  T2.project WHERE T1.hours  >  300 GROUP BY T1.name
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', 'text']]

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



Question: Find the number of projects which each scientist is working on and scientist's name.
SQL: SELECT count(*) ,  T1.name FROM scientists AS T1 JOIN assignedto AS T2 ON T1.ssn  =  T2.scientist GROUP BY T1.name
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', '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 scientists, and how many projects are each of them working on?
SQL: SELECT count(*) ,  T1.name FROM scientists AS T1 JOIN assignedto AS T2 ON T1.ssn  =  T2.scientist GROUP BY T1.name
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', '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 SSN and name of scientists who are assigned to the project with the longest hours.
SQL: SELECT T3.ssn ,  T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project  =  T2.code JOIN scientists AS T3 ON T1.scientist  =  T3.SSN WHERE T2.hours  =  (SELECT max(hours) FROM projects)
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', '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 SSN and names of scientists working on the project with the most hours?
SQL: SELECT T3.ssn ,  T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project  =  T2.code JOIN scientists AS T3 ON T1.scientist  =  T3.SSN WHERE T2.hours  =  (SELECT max(hours) FROM projects)
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', '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 scientists who are assigned to some project.
SQL: SELECT T2.name FROM assignedto AS T1 JOIN scientists AS T2 ON T1.scientist  =  T2.ssn
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', '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 scientists who are assigned to any project?
SQL: SELECT T2.name FROM assignedto AS T1 JOIN scientists AS T2 ON T1.scientist  =  T2.ssn
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', '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: Select the project names which are not assigned yet.
SQL: SELECT Name FROM Projects WHERE Code NOT IN (SELECT Project FROM AssignedTo)
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', '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 projects that have not been assigned?
SQL: SELECT Name FROM Projects WHERE Code NOT IN (SELECT Project FROM AssignedTo)
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', '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 scientists who are not assigned to any project.
SQL: SELECT Name FROM scientists WHERE ssn NOT IN (SELECT scientist FROM AssignedTo)
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', '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 scientists who have not been assigned a project?
SQL: SELECT Name FROM scientists WHERE ssn NOT IN (SELECT scientist FROM AssignedTo)
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', 'text']]

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



Question: Find the number of scientists who are not assigned to any project.
SQL: SELECT count(*) FROM scientists WHERE ssn NOT IN (SELECT scientist FROM AssignedTo)
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', '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 scientists do not have any projects assigned to them?
SQL: SELECT count(*) FROM scientists WHERE ssn NOT IN (SELECT scientist FROM AssignedTo)
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', '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 scientists who are not working on the project with the highest hours.
SQL: SELECT name FROM scientists EXCEPT SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project  =  T2.code JOIN scientists AS T3 ON T1.scientist  =  T3.SSN WHERE T2.hours  =  (SELECT max(hours) FROM projects)
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', '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 scientists who are not working on the project with the most hours?
SQL: SELECT name FROM scientists EXCEPT SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project  =  T2.code JOIN scientists AS T3 ON T1.scientist  =  T3.SSN WHERE T2.hours  =  (SELECT max(hours) FROM projects)
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', '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 all the scientists' names, their projects' names, and the hours worked by that scientist on each project, in alphabetical order of project name, and then scientist name.
SQL: SELECT T1.Name ,  T3.Name ,  T3.Hours FROM Scientists AS T1 JOIN AssignedTo AS T2 ON T1.SSN = T2.Scientist JOIN Projects AS T3 ON T2.Project = T3.Code ORDER BY T3.Name ,  T1.Name
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', '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 each scientist, the names of the projects that they work on, and the hours for each of those projects, listed in alphabetical order by project name, then scientist name.
SQL: SELECT T1.Name ,  T3.Name ,  T3.Hours FROM Scientists AS T1 JOIN AssignedTo AS T2 ON T1.SSN = T2.Scientist JOIN Projects AS T3 ON T2.Project = T3.Code ORDER BY T3.Name ,  T1.Name
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', '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 name of the project that needs the least amount of time to finish and the name of scientists who worked on it.
SQL: SELECT T2.name ,  T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project  =  T2.code JOIN scientists AS T3 ON T1.scientist  =  T3.SSN WHERE T2.hours  =  (SELECT min(hours) FROM projects)
-- Language PostgreSQL
        -- Tables: 
             -- Table: scientists 
columns : [['ssn', 'number'], ['name', 'text']]

 -- Table: projects 
columns : [['code', 'text'], ['name', 'text'], ['hours', 'number']]

 -- Table: assigned to 
columns : [['scientist', 'number'], ['project', '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 project that requires the fewest number of hours, and the names of the scientists assigned to it?
SQL: SELECT T2.name ,  T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project  =  T2.code JOIN scientists AS T3 ON T1.scientist  =  T3.SSN WHERE T2.hours  =  (SELECT min(hours) FROM projects)
-- Language PostgreSQL
        -- Tables: 
             -- Table: grapes 
columns : [['id', 'number'], ['grape', 'text'], ['color', 'text']]

 -- Table: appellations 
columns : [['no', 'number'], ['appelation', 'text'], ['county', 'text'], ['state', 'text'], ['area', 'text'], ['isava', 'text']]

 -- Table: wine 
columns : [['no', 'number'], ['grape', 'text'], ['winery', 'text'], ['appelation', 'text'], ['state', 'text'], ['name', 'text'], ['year', 'number'], ['price', 'number'], ['score', 'number'], ['cases', 'number'], ['drink', '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 highest rated wine?
SQL: SELECT Name FROM WINE ORDER BY Score LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: grapes 
columns : [['id', 'number'], ['grape', 'text'], ['color', 'text']]

 -- Table: appellations 
columns : [['no', 'number'], ['appelation', 'text'], ['county', 'text'], ['state', 'text'], ['area', 'text'], ['isava', 'text']]

 -- Table: wine 
columns : [['no', 'number'], ['grape', 'text'], ['winery', 'text'], ['appelation', 'text'], ['state', 'text'], ['name', 'text'], ['year', 'number'], ['price', 'number'], ['score', 'number'], ['cases', 'number'], ['drink', '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 wine with the highest score.
SQL: SELECT Name FROM WINE ORDER BY Score LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: grapes 
columns : [['id', 'number'], ['grape', 'text'], ['color', 'text']]

 -- Table: appellations 
columns : [['no', 'number'], ['appelation', 'text'], ['county', 'text'], ['state', 'text'], ['area', 'text'], ['isava', 'text']]

 -- Table: wine 
columns : [['no', 'number'], ['grape', 'text'], ['winery', 'text'], ['appelation', 'text'], ['state', 'text'], ['name', 'text'], ['year', 'number'], ['price', 'number'], ['score', 'number'], ['cases', 'number'], ['drink', 'text']]

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



Question: Which winery is the wine that has the highest score from?
SQL: SELECT Winery FROM WINE ORDER BY SCORE LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: grapes 
columns : [['id', 'number'], ['grape', 'text'], ['color', 'text']]

 -- Table: appellations 
columns : [['no', 'number'], ['appelation', 'text'], ['county', 'text'], ['state', 'text'], ['area', 'text'], ['isava', 'text']]

 -- Table: wine 
columns : [['no', 'number'], ['grape', 'text'], ['winery', 'text'], ['appelation', 'text'], ['state', 'text'], ['name', 'text'], ['year', 'number'], ['price', 'number'], ['score', 'number'], ['cases', 'number'], ['drink', '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 winery at which the wine with the highest score was made?
SQL: SELECT Winery FROM WINE ORDER BY SCORE LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: grapes 
columns : [['id', 'number'], ['grape', 'text'], ['color', 'text']]

 -- Table: appellations 
columns : [['no', 'number'], ['appelation', 'text'], ['county', 'text'], ['state', 'text'], ['area', 'text'], ['isava', 'text']]

 -- Table: wine 
columns : [['no', 'number'], ['grape', 'text'], ['winery', 'text'], ['appelation', 'text'], ['state', 'text'], ['name', 'text'], ['year', 'number'], ['price', 'number'], ['score', 'number'], ['cases', 'number'], ['drink', '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 wines produced in 2008.
SQL: SELECT Name FROM WINE WHERE YEAR  =  "2008"
-- Language PostgreSQL
        -- Tables: 
             -- Table: grapes 
columns : [['id', 'number'], ['grape', 'text'], ['color', 'text']]

 -- Table: appellations 
columns : [['no', 'number'], ['appelation', 'text'], ['county', 'text'], ['state', 'text'], ['area', 'text'], ['isava', 'text']]

 -- Table: wine 
columns : [['no', 'number'], ['grape', 'text'], ['winery', 'text'], ['appelation', 'text'], ['state', 'text'], ['name', 'text'], ['year', 'number'], ['price', 'number'], ['score', 'number'], ['cases', 'number'], ['drink', '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 wines produced in 2008?
SQL: SELECT Name FROM WINE WHERE YEAR  =  "2008"
-- Language PostgreSQL
        -- Tables: 
             -- Table: grapes 
columns : [['id', 'number'], ['grape', 'text'], ['color', 'text']]

 -- Table: appellations 
columns : [['no', 'number'], ['appelation', 'text'], ['county', 'text'], ['state', 'text'], ['area', 'text'], ['isava', 'text']]

 -- Table: wine 
columns : [['no', 'number'], ['grape', 'text'], ['winery', 'text'], ['appelation', 'text'], ['state', 'text'], ['name', 'text'], ['year', 'number'], ['price', 'number'], ['score', 'number'], ['cases', 'number'], ['drink', '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 grapes and appelations of all wines.
SQL: SELECT Grape ,  Appelation FROM WINE
-- Language PostgreSQL
        -- Tables: 
             -- Table: grapes 
columns : [['id', 'number'], ['grape', 'text'], ['color', 'text']]

 -- Table: appellations 
columns : [['no', 'number'], ['appelation', 'text'], ['county', 'text'], ['state', 'text'], ['area', 'text'], ['isava', 'text']]

 -- Table: wine 
columns : [['no', 'number'], ['grape', 'text'], ['winery', 'text'], ['appelation', 'text'], ['state', 'text'], ['name', 'text'], ['year', 'number'], ['price', 'number'], ['score', 'number'], ['cases', 'number'], ['drink', '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 grapes and appelations of each wine?
SQL: SELECT Grape ,  Appelation FROM WINE
-- Language PostgreSQL
        -- Tables: 
             -- Table: grapes 
columns : [['id', 'number'], ['grape', 'text'], ['color', 'text']]

 -- Table: appellations 
columns : [['no', 'number'], ['appelation', 'text'], ['county', 'text'], ['state', 'text'], ['area', 'text'], ['isava', 'text']]

 -- Table: wine 
columns : [['no', 'number'], ['grape', 'text'], ['winery', 'text'], ['appelation', 'text'], ['state', 'text'], ['name', 'text'], ['year', 'number'], ['price', 'number'], ['score', 'number'], ['cases', 'number'], ['drink', '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 names and scores of all wines.
SQL: SELECT Name ,  Score FROM WINE
-- Language PostgreSQL
        -- Tables: 
             -- Table: grapes 
columns : [['id', 'number'], ['grape', 'text'], ['color', 'text']]

 -- Table: appellations 
columns : [['no', 'number'], ['appelation', 'text'], ['county', 'text'], ['state', 'text'], ['area', 'text'], ['isava', 'text']]

 -- Table: wine 
columns : [['no', 'number'], ['grape', 'text'], ['winery', 'text'], ['appelation', 'text'], ['state', 'text'], ['name', 'text'], ['year', 'number'], ['price', 'number'], ['score', 'number'], ['cases', 'number'], ['drink', '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 scores of all wines?
SQL: SELECT Name ,  Score FROM WINE
-- Language PostgreSQL
        -- Tables: 
             -- Table: grapes 
columns : [['id', 'number'], ['grape', 'text'], ['color', 'text']]

 -- Table: appellations 
columns : [['no', 'number'], ['appelation', 'text'], ['county', 'text'], ['state', 'text'], ['area', 'text'], ['isava', 'text']]

 -- Table: wine 
columns : [['no', 'number'], ['grape', 'text'], ['winery', 'text'], ['appelation', 'text'], ['state', 'text'], ['name', 'text'], ['year', 'number'], ['price', 'number'], ['score', 'number'], ['cases', 'number'], ['drink', '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 area and county of all appelations.
SQL: SELECT Area ,  County FROM APPELLATIONS
-- Language PostgreSQL
        -- Tables: 
             -- Table: grapes 
columns : [['id', 'number'], ['grape', 'text'], ['color', 'text']]

 -- Table: appellations 
columns : [['no', 'number'], ['appelation', 'text'], ['county', 'text'], ['state', 'text'], ['area', 'text'], ['isava', 'text']]

 -- Table: wine 
columns : [['no', 'number'], ['grape', 'text'], ['winery', 'text'], ['appelation', 'text'], ['state', 'text'], ['name', 'text'], ['year', 'number'], ['price', 'number'], ['score', 'number'], ['cases', 'number'], ['drink', '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 areas and counties for all appelations?
SQL: SELECT Area ,  County FROM APPELLATIONS
-- Language PostgreSQL
        -- Tables: 
             -- Table: grapes 
columns : [['id', 'number'], ['grape', 'text'], ['color', 'text']]

 -- Table: appellations 
columns : [['no', 'number'], ['appelation', 'text'], ['county', 'text'], ['state', 'text'], ['area', 'text'], ['isava', 'text']]

 -- Table: wine 
columns : [['no', 'number'], ['grape', 'text'], ['winery', 'text'], ['appelation', 'text'], ['state', 'text'], ['name', 'text'], ['year', 'number'], ['price', 'number'], ['score', 'number'], ['cases', 'number'], ['drink', '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 prices of wines produced before the year of 2010?
SQL: SELECT Price FROM WINE WHERE YEAR  <  2010