brief_instruction
stringlengths
16
224
instruction
stringlengths
687
8.77k
output
stringlengths
18
577
What are the names of the scientists, and how many projects are each of them working on?
-- 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. Translate `What are the names of the scientists, and how many projects are each of them working on?` to a syntactically-correct PostgreSQL query.
SELECT count(*) , T1.name FROM scientists AS T1 JOIN assignedto AS T2 ON T1.ssn = T2.scientist GROUP BY T1.name
Find the SSN and name of scientists who are assigned to the project with the longest hours.
-- 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. Translate `Find the SSN and name of scientists who are assigned to the project with the longest hours.` to a syntactically-correct PostgreSQL query.
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)
What are the SSN and names of scientists working on the project with the most hours?
-- 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. Translate `What are the SSN and names of scientists working on the project with the most hours?` to a syntactically-correct PostgreSQL query.
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)
Find the name of scientists who are assigned to some project.
-- 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. Translate `Find the name of scientists who are assigned to some project.` to a syntactically-correct PostgreSQL query.
SELECT T2.name FROM assignedto AS T1 JOIN scientists AS T2 ON T1.scientist = T2.ssn
What are the names of scientists who are assigned to any project?
-- 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. Translate `What are the names of scientists who are assigned to any project?` to a syntactically-correct PostgreSQL query.
SELECT T2.name FROM assignedto AS T1 JOIN scientists AS T2 ON T1.scientist = T2.ssn
Select the project names which are not assigned yet.
-- 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. Translate `Select the project names which are not assigned yet.` to a syntactically-correct PostgreSQL query.
SELECT Name FROM Projects WHERE Code NOT IN (SELECT Project FROM AssignedTo)
What are the names of projects that have not been assigned?
-- 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. Translate `What are the names of projects that have not been assigned?` to a syntactically-correct PostgreSQL query.
SELECT Name FROM Projects WHERE Code NOT IN (SELECT Project FROM AssignedTo)
Find the name of scientists who are not assigned to any project.
-- 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. Translate `Find the name of scientists who are not assigned to any project.` to a syntactically-correct PostgreSQL query.
SELECT Name FROM scientists WHERE ssn NOT IN (SELECT scientist FROM AssignedTo)
What are the names of scientists who have not been assigned a project?
-- 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. Translate `What are the names of scientists who have not been assigned a project?` to a syntactically-correct PostgreSQL query.
SELECT Name FROM scientists WHERE ssn NOT IN (SELECT scientist FROM AssignedTo)
Find the number of scientists who are not assigned to any project.
-- 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. Translate `Find the number of scientists who are not assigned to any project.` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM scientists WHERE ssn NOT IN (SELECT scientist FROM AssignedTo)
How many scientists do not have any projects assigned to them?
-- 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. Translate `How many scientists do not have any projects assigned to them?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM scientists WHERE ssn NOT IN (SELECT scientist FROM AssignedTo)
Find the names of scientists who are not working on the project with the highest hours.
-- 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. Translate `Find the names of scientists who are not working on the project with the highest hours.` to a syntactically-correct PostgreSQL query.
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)
What are the names of scientists who are not working on the project with the most hours?
-- 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. Translate `What are the names of scientists who are not working on the project with the most hours?` to a syntactically-correct PostgreSQL query.
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)
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.
-- 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. Translate `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.` to a syntactically-correct PostgreSQL query.
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
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.
-- 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. Translate `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.` to a syntactically-correct PostgreSQL query.
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
Find name of the project that needs the least amount of time to finish and the name of scientists who worked on it.
-- 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. Translate `Find name of the project that needs the least amount of time to finish and the name of scientists who worked on it.` to a syntactically-correct PostgreSQL query.
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)
What is the name of the project that requires the fewest number of hours, and the names of the scientists assigned to it?
-- 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. Translate `What is the name of the project that requires the fewest number of hours, and the names of the scientists assigned to it?` to a syntactically-correct PostgreSQL query.
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)
What is the name of the highest rated 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. Translate `What is the name of the highest rated wine?` to a syntactically-correct PostgreSQL query.
SELECT Name FROM WINE ORDER BY Score LIMIT 1
Give the name of the wine with the highest score.
-- 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. Translate `Give the name of the wine with the highest score.` to a syntactically-correct PostgreSQL query.
SELECT Name FROM WINE ORDER BY Score LIMIT 1
Which winery is the wine that has the highest score from?
-- 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. Translate `Which winery is the wine that has the highest score from?` to a syntactically-correct PostgreSQL query.
SELECT Winery FROM WINE ORDER BY SCORE LIMIT 1
What is the winery at which the wine with the highest score was made?
-- 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. Translate `What is the winery at which the wine with the highest score was made?` to a syntactically-correct PostgreSQL query.
SELECT Winery FROM WINE ORDER BY SCORE LIMIT 1
Find the names of all wines produced in 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. Translate `Find the names of all wines produced in 2008.` to a syntactically-correct PostgreSQL query.
SELECT Name FROM WINE WHERE YEAR = "2008"
What are the names of all wines produced in 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. Translate `What are the names of all wines produced in 2008?` to a syntactically-correct PostgreSQL query.
SELECT Name FROM WINE WHERE YEAR = "2008"
List the grapes and appelations of all wines.
-- 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. Translate `List the grapes and appelations of all wines.` to a syntactically-correct PostgreSQL query.
SELECT Grape , Appelation FROM WINE
What are the grapes and appelations of each 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. Translate `What are the grapes and appelations of each wine?` to a syntactically-correct PostgreSQL query.
SELECT Grape , Appelation FROM WINE
List the names and scores of all wines.
-- 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. Translate `List the names and scores of all wines.` to a syntactically-correct PostgreSQL query.
SELECT Name , Score FROM WINE
What are the names and scores of all wines?
-- 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. Translate `What are the names and scores of all wines?` to a syntactically-correct PostgreSQL query.
SELECT Name , Score FROM WINE
List the area and county of all appelations.
-- 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. Translate `List the area and county of all appelations.` to a syntactically-correct PostgreSQL query.
SELECT Area , County FROM APPELLATIONS
What are the areas and counties for all appelations?
-- 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. Translate `What are the areas and counties for all appelations?` to a syntactically-correct PostgreSQL query.
SELECT Area , County FROM APPELLATIONS
What are the prices of wines produced before the year of 2010?
-- 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. Translate `What are the prices of wines produced before the year of 2010?` to a syntactically-correct PostgreSQL query.
SELECT Price FROM WINE WHERE YEAR < 2010
Return the prices of wines produced before 2010.
-- 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. Translate `Return the prices of wines produced before 2010.` to a syntactically-correct PostgreSQL query.
SELECT Price FROM WINE WHERE YEAR < 2010
List the names of all distinct wines that have scores higher than 90.
-- 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. Translate `List the names of all distinct wines that have scores higher than 90.` to a syntactically-correct PostgreSQL query.
SELECT Name FROM WINE WHERE score > 90
What are the names of wines with scores higher than 90?
-- 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. Translate `What are the names of wines with scores higher than 90?` to a syntactically-correct PostgreSQL query.
SELECT Name FROM WINE WHERE score > 90
List the names of all distinct wines that are made of red color grape.
-- 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. Translate `List the names of all distinct wines that are made of red color grape.` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT T2.Name FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = "Red"
What are the names of wines made from red grapes?
-- 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. Translate `What are the names of wines made from red grapes?` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT T2.Name FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = "Red"
Find the names of all distinct wines that have appellations in North Coast area.
-- 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. Translate `Find the names of all distinct wines that have appellations in North Coast area.` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT T2.Name FROM APPELLATIONs AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.Area = "North Coast"
What are the distinct names of wines that have appellations in the North Coast area?
-- 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. Translate `What are the distinct names of wines that have appellations in the North Coast area?` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT T2.Name FROM APPELLATIONs AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.Area = "North Coast"
How many wines are produced at Robert Biale winery?
-- 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. Translate `How many wines are produced at Robert Biale winery?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM WINE WHERE Winery = "Robert Biale"
Count the number of wines produced at Robert Biale winery.
-- 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. Translate `Count the number of wines produced at Robert Biale winery.` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM WINE WHERE Winery = "Robert Biale"
How many appelations are in Napa Country?
-- 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. Translate `How many appelations are in Napa Country?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM APPELLATIONS WHERE County = "Napa"
Count the number of appelations in Napa County.
-- 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. Translate `Count the number of appelations in Napa County.` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM APPELLATIONS WHERE County = "Napa"
Give me the average prices of wines that are produced by appelations in Sonoma County.
-- 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. Translate `Give me the average prices of wines that are produced by appelations in Sonoma County.` to a syntactically-correct PostgreSQL query.
SELECT AVG(T2.Price) FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = "Sonoma"
What is the average price of wines produced in appelations in Sonoma County?
-- 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. Translate `What is the average price of wines produced in appelations in Sonoma County?` to a syntactically-correct PostgreSQL query.
SELECT AVG(T2.Price) FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = "Sonoma"
What are the names and scores of wines that are made of white color grapes?
-- 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. Translate `What are the names and scores of wines that are made of white color grapes?` to a syntactically-correct PostgreSQL query.
SELECT T2.Name , T2.Score FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = "White"
Give the names and scores of wines made from white grapes.
-- 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. Translate `Give the names and scores of wines made from white grapes.` to a syntactically-correct PostgreSQL query.
SELECT T2.Name , T2.Score FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = "White"
Find the maximum price of wins from the appelations in Central Coast area and produced before the year of 2005.
-- 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. Translate `Find the maximum price of wins from the appelations in Central Coast area and produced before the year of 2005.` to a syntactically-correct PostgreSQL query.
SELECT max(T2.Price) FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.Area = "Central Coast" AND T2.year < 2005
What is the maximum price of wines from the appelation in the Central Coast area, which was produced before 2005?
-- 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. Translate `What is the maximum price of wines from the appelation in the Central Coast area, which was produced before 2005?` to a syntactically-correct PostgreSQL query.
SELECT max(T2.Price) FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.Area = "Central Coast" AND T2.year < 2005
Find the the grape whose white color grapes are used to produce wines with scores higher than 90.
-- 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. Translate `Find the the grape whose white color grapes are used to produce wines with scores higher than 90.` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT T1.Grape FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = "White" AND T2.score > 90
Find the white grape used to produce wines with scores above 90.
-- 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. Translate `Find the white grape used to produce wines with scores above 90.` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT T1.Grape FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = "White" AND T2.score > 90
What are the wines that have prices higher than 50 and made of Red color grapes?
-- 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. Translate `What are the wines that have prices higher than 50 and made of Red color grapes?` to a syntactically-correct PostgreSQL query.
SELECT T2.Name FROM Grapes AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = "Red" AND T2.price > 50
What are the names of wines made from red grapes and with prices above 50?
-- 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. Translate `What are the names of wines made from red grapes and with prices above 50?` to a syntactically-correct PostgreSQL query.
SELECT T2.Name FROM Grapes AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = "Red" AND T2.price > 50
What are the wines that have prices lower than 50 and have appelations in Monterey county?
-- 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. Translate `What are the wines that have prices lower than 50 and have appelations in Monterey county?` to a syntactically-correct PostgreSQL query.
SELECT T2.Name FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = "Monterey" AND T2.price < 50
Give the neames of wines with prices below 50 and with appelations in Monterey county.
-- 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. Translate `Give the neames of wines with prices below 50 and with appelations in Monterey county.` to a syntactically-correct PostgreSQL query.
SELECT T2.Name FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = "Monterey" AND T2.price < 50
What are the numbers of wines for different grapes?
-- 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. Translate `What are the numbers of wines for different grapes?` to a syntactically-correct PostgreSQL query.
SELECT count(*) , Grape FROM WINE GROUP BY Grape
How many wines are there for each grape?
-- 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. Translate `How many wines are there for each grape?` to a syntactically-correct PostgreSQL query.
SELECT count(*) , Grape FROM WINE GROUP BY Grape
What are the average prices of wines for different years?
-- 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. Translate `What are the average prices of wines for different years?` to a syntactically-correct PostgreSQL query.
SELECT avg(Price) , YEAR FROM WINE GROUP BY YEAR
What is the average prices of wines for each each?
-- 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. Translate `What is the average prices of wines for each each?` to a syntactically-correct PostgreSQL query.
SELECT avg(Price) , YEAR FROM WINE GROUP BY YEAR
Find the distinct names of all wines that have prices higher than some wines from John Anthony winery.
-- 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. Translate `Find the distinct names of all wines that have prices higher than some wines from John Anthony winery.` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT Name FROM WINE WHERE Price > (SELECT min(Price) FROM wine WHERE Winery = "John Anthony")
What are the distinct names of wines with prices higher than any wine from John Anthony winery.
-- 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. Translate `What are the distinct names of wines with prices higher than any wine from John Anthony winery.` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT Name FROM WINE WHERE Price > (SELECT min(Price) FROM wine WHERE Winery = "John Anthony")
List the names of all distinct wines in alphabetical order.
-- 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. Translate `List the names of all distinct wines in alphabetical order.` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT Name FROM WINE ORDER BY Name
What are the names of wines, sorted in alphabetical order?
-- 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. Translate `What are the names of wines, sorted in alphabetical order?` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT Name FROM WINE ORDER BY Name
List the names of all distinct wines ordered by price.
-- 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. Translate `List the names of all distinct wines ordered by price.` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT Name FROM WINE ORDER BY price
What are the names of wines, sorted by price ascending?
-- 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. Translate `What are the names of wines, sorted by price ascending?` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT Name FROM WINE ORDER BY price
What is the area of the appelation that produces the highest number of wines before the year of 2010?
-- 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. Translate `What is the area of the appelation that produces the highest number of wines before the year of 2010?` to a syntactically-correct PostgreSQL query.
SELECT T1.Area FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation GROUP BY T2.Appelation HAVING T2.year < 2010 ORDER BY count(*) DESC LIMIT 1
What is the area for the appelation which produced the most wines prior to 2010?
-- 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. Translate `What is the area for the appelation which produced the most wines prior to 2010?` to a syntactically-correct PostgreSQL query.
SELECT T1.Area FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation GROUP BY T2.Appelation HAVING T2.year < 2010 ORDER BY count(*) DESC LIMIT 1
What is the color of the grape whose wine products has the highest average price?
-- 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. Translate `What is the color of the grape whose wine products has the highest average price?` to a syntactically-correct PostgreSQL query.
SELECT T1.Color FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape GROUP BY T2.Grape ORDER BY AVG(Price) DESC LIMIT 1
Give the color of the grape whose wine products have the highest average price?
-- 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. Translate `Give the color of the grape whose wine products have the highest average price?` to a syntactically-correct PostgreSQL query.
SELECT T1.Color FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape GROUP BY T2.Grape ORDER BY AVG(Price) DESC LIMIT 1
Find the distinct names of wines produced before the year of 2000 or after the year of 2010.
-- 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. Translate `Find the distinct names of wines produced before the year of 2000 or after the year of 2010.` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT Name FROM WINE WHERE YEAR < 2000 OR YEAR > 2010
Give the distinct names of wines made before 2000 or after 2010.
-- 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. Translate `Give the distinct names of wines made before 2000 or after 2010.` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT Name FROM WINE WHERE YEAR < 2000 OR YEAR > 2010
Find the distinct winery of wines having price between 50 and 100.
-- 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. Translate `Find the distinct winery of wines having price between 50 and 100.` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT Winery FROM WINE WHERE Price BETWEEN 50 AND 100
What are the distinct wineries which produce wines costing between 50 and 100?
-- 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. Translate `What are the distinct wineries which produce wines costing between 50 and 100?` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT Winery FROM WINE WHERE Price BETWEEN 50 AND 100
What are the average prices and cases of wines produced in the year of 2009 and made of Zinfandel grape?
-- 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. Translate `What are the average prices and cases of wines produced in the year of 2009 and made of Zinfandel grape?` to a syntactically-correct PostgreSQL query.
SELECT AVG(Price) , AVG(Cases) FROM WINE WHERE YEAR = 2009 AND Grape = "Zinfandel"
Give the average price and case of wines made from Zinfandel grapes in the year 2009.
-- 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. Translate `Give the average price and case of wines made from Zinfandel grapes in the year 2009.` to a syntactically-correct PostgreSQL query.
SELECT AVG(Price) , AVG(Cases) FROM WINE WHERE YEAR = 2009 AND Grape = "Zinfandel"
What are the maximum price and score of wines produced by St. Helena appelation?
-- 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. Translate `What are the maximum price and score of wines produced by St. Helena appelation?` to a syntactically-correct PostgreSQL query.
SELECT max(Price) , max(Score) FROM WINE WHERE Appelation = "St. Helena"
Give the maximum price and score for wines produced in the appelation St. Helena.
-- 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. Translate `Give the maximum price and score for wines produced in the appelation St. Helena.` to a syntactically-correct PostgreSQL query.
SELECT max(Price) , max(Score) FROM WINE WHERE Appelation = "St. Helena"
What are the maximum price and score of wines in each year?
-- 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. Translate `What are the maximum price and score of wines in each year?` to a syntactically-correct PostgreSQL query.
SELECT max(Price) , max(Score) , YEAR FROM WINE GROUP BY YEAR
What are the maximum price and score of wines for each year?
-- 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. Translate `What are the maximum price and score of wines for each year?` to a syntactically-correct PostgreSQL query.
SELECT max(Price) , max(Score) , YEAR FROM WINE GROUP BY YEAR
What are the average price and score of wines grouped by appelation?
-- 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. Translate `What are the average price and score of wines grouped by appelation?` to a syntactically-correct PostgreSQL query.
SELECT avg(Price) , avg(Score) , Appelation FROM WINE GROUP BY Appelation
What are the average price and score of wines for each appelation?
-- 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. Translate `What are the average price and score of wines for each appelation?` to a syntactically-correct PostgreSQL query.
SELECT avg(Price) , avg(Score) , Appelation FROM WINE GROUP BY Appelation
Find the wineries that have at least four wines.
-- 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. Translate `Find the wineries that have at least four wines.` to a syntactically-correct PostgreSQL query.
SELECT Winery FROM WINE GROUP BY Winery HAVING count(*) >= 4
Which wineries produce at least four wines?
-- 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. Translate `Which wineries produce at least four wines?` to a syntactically-correct PostgreSQL query.
SELECT Winery FROM WINE GROUP BY Winery HAVING count(*) >= 4
Find the country of all appelations who have at most three wines.
-- 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. Translate `Find the country of all appelations who have at most three wines.` to a syntactically-correct PostgreSQL query.
SELECT T1.County FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation GROUP BY T2.Appelation HAVING count(*) <= 3
What are the countries for appelations with at most 3 wines?
-- 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. Translate `What are the countries for appelations with at most 3 wines?` to a syntactically-correct PostgreSQL query.
SELECT T1.County FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation GROUP BY T2.Appelation HAVING count(*) <= 3
What are the names of wines whose production year are before the year of all wines by Brander winery?
-- 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. Translate `What are the names of wines whose production year are before the year of all wines by Brander winery?` to a syntactically-correct PostgreSQL query.
SELECT Name FROM WINE WHERE YEAR < (SELECT min(YEAR) FROM WINE WHERE Winery = "Brander")
What are the names of wines produced before any wine from the Brander winery?
-- 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. Translate `What are the names of wines produced before any wine from the Brander winery?` to a syntactically-correct PostgreSQL query.
SELECT Name FROM WINE WHERE YEAR < (SELECT min(YEAR) FROM WINE WHERE Winery = "Brander")
What are the names of wines that are more expensive then all wines made in the year 2006?
-- 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. Translate `What are the names of wines that are more expensive then all wines made in the year 2006?` to a syntactically-correct PostgreSQL query.
SELECT Name FROM WINE WHERE Price > (SELECT max(Price) FROM WINE WHERE YEAR = 2006)
Give the names of wines with prices above any wine produced in 2006.
-- 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. Translate `Give the names of wines with prices above any wine produced in 2006.` to a syntactically-correct PostgreSQL query.
SELECT Name FROM WINE WHERE Price > (SELECT max(Price) FROM WINE WHERE YEAR = 2006)
Find the top 3 wineries with the greatest number of wines made of white color grapes.
-- 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. Translate `Find the top 3 wineries with the greatest number of wines made of white color grapes.` to a syntactically-correct PostgreSQL query.
SELECT T2.Winery FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.GRAPE = T2.GRAPE WHERE T1.Color = "White" GROUP BY T2.Winery ORDER BY count(*) DESC LIMIT 3
Which 3 wineries produce the most wines made from white grapes?
-- 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. Translate `Which 3 wineries produce the most wines made from white grapes?` to a syntactically-correct PostgreSQL query.
SELECT T2.Winery FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.GRAPE = T2.GRAPE WHERE T1.Color = "White" GROUP BY T2.Winery ORDER BY count(*) DESC LIMIT 3
List the grape, winery and year of the wines whose price is bigger than 100 ordered by year.
-- 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. Translate `List the grape, winery and year of the wines whose price is bigger than 100 ordered by year.` to a syntactically-correct PostgreSQL query.
SELECT Grape , Winery , YEAR FROM WINE WHERE Price > 100 ORDER BY YEAR
What are the grapes, wineries and years for wines with price higher than 100, sorted by year?
-- 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. Translate `What are the grapes, wineries and years for wines with price higher than 100, sorted by year?` to a syntactically-correct PostgreSQL query.
SELECT Grape , Winery , YEAR FROM WINE WHERE Price > 100 ORDER BY YEAR
List the grape, appelation and name of wines whose score is higher than 93 ordered by Name.
-- 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. Translate `List the grape, appelation and name of wines whose score is higher than 93 ordered by Name.` to a syntactically-correct PostgreSQL query.
SELECT Grape , Appelation , Name FROM WINE WHERE Score > 93 ORDER BY Name
What are the grapes, appelations, and wines with scores above 93, sorted by Name?
-- 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. Translate `What are the grapes, appelations, and wines with scores above 93, sorted by Name?` to a syntactically-correct PostgreSQL query.
SELECT Grape , Appelation , Name FROM WINE WHERE Score > 93 ORDER BY Name
Find the appelations that produce wines after the year of 2008 but not in Central Coast area.
-- 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. Translate `Find the appelations that produce wines after the year of 2008 but not in Central Coast area.` to a syntactically-correct PostgreSQL query.
SELECT Appelation FROM WINE WHERE YEAR > 2008 EXCEPT SELECT Appelation FROM APPELLATIONS WHERE Area = "Central Coast"
What are the appelations for wines produced after 2008 but not in the Central Coast area?
-- 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. Translate `What are the appelations for wines produced after 2008 but not in the Central Coast area?` to a syntactically-correct PostgreSQL query.
SELECT Appelation FROM WINE WHERE YEAR > 2008 EXCEPT SELECT Appelation FROM APPELLATIONS WHERE Area = "Central Coast"
Find the average price of wines that are not produced from Sonoma county.
-- 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. Translate `Find the average price of wines that are not produced from Sonoma county.` to a syntactically-correct PostgreSQL query.
SELECT avg(price) FROM wine WHERE Appelation NOT IN (SELECT T1.Appelation FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = 'Sonoma')
What is the average price for wines not produced in Sonoma county?
-- 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. Translate `What is the average price for wines not produced in Sonoma county?` to a syntactically-correct PostgreSQL query.
SELECT avg(price) FROM wine WHERE Appelation NOT IN (SELECT T1.Appelation FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = 'Sonoma')
Find the county where produces the most number of wines with score higher than 90.
-- 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. Translate `Find the county where produces the most number of wines with score higher than 90.` to a syntactically-correct PostgreSQL query.
SELECT T1.County FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T2.Score > 90 GROUP BY T1.County ORDER BY count(*) DESC LIMIT 1
What is the county that produces the most wines scoring higher than 90?
-- 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. Translate `What is the county that produces the most wines scoring higher than 90?` to a syntactically-correct PostgreSQL query.
SELECT T1.County FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T2.Score > 90 GROUP BY T1.County ORDER BY count(*) DESC LIMIT 1
How many train stations are there?
-- Language PostgreSQL -- Tables: -- Table: station columns : [['station id', 'number'], ['name', 'text'], ['annual entry exit', 'number'], ['annual interchanges', 'number'], ['total passengers', 'number'], ['location', 'text'], ['main services', 'text'], ['number of platforms', 'number']] -- Table: train columns : [['train id', 'number'], ['name', 'text'], ['time', 'text'], ['service', 'text']] -- Table: train station columns : [['train id', 'number'], ['station id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `How many train stations are there?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM station