sert121/SpiderSQL huggingface dataset:
-- Language PostgreSQL
        -- Tables: 
             -- Table: grapes 
columns : [['id', 'number'], ['grape', 'text'], ['color', 'text']]

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

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

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



Question: Return the prices of wines produced before 2010.
SQL: SELECT Price FROM WINE WHERE YEAR  <  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.



Question: List the names of all distinct wines that have scores higher than 90.
SQL: SELECT Name FROM WINE WHERE score  >  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.



Question: What are the names of wines with scores higher than 90?
SQL: SELECT Name FROM WINE WHERE score  >  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.



Question: List the names of all distinct wines that are made of red color grape.
SQL: SELECT DISTINCT T2.Name FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape  =  T2.Grape WHERE T1.Color  =  "Red"
-- Language PostgreSQL
        -- Tables: 
             -- Table: grapes 
columns : [['id', 'number'], ['grape', 'text'], ['color', 'text']]

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

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

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



Question: What are the names of wines made from red grapes?
SQL: SELECT DISTINCT T2.Name FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape  =  T2.Grape WHERE T1.Color  =  "Red"
-- Language PostgreSQL
        -- Tables: 
             -- Table: grapes 
columns : [['id', 'number'], ['grape', 'text'], ['color', 'text']]

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

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

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



Question: Find the names of all distinct wines that have appellations in North Coast area.
SQL: SELECT DISTINCT T2.Name FROM APPELLATIONs AS T1 JOIN WINE AS T2 ON T1.Appelation  =  T2.Appelation WHERE T1.Area  =  "North Coast"
-- Language PostgreSQL
        -- Tables: 
             -- Table: grapes 
columns : [['id', 'number'], ['grape', 'text'], ['color', 'text']]

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

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

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



Question: What are the distinct names of wines that have appellations in the North Coast area?
SQL: SELECT DISTINCT T2.Name FROM APPELLATIONs AS T1 JOIN WINE AS T2 ON T1.Appelation  =  T2.Appelation WHERE T1.Area  =  "North Coast"
-- Language PostgreSQL
        -- Tables: 
             -- Table: grapes 
columns : [['id', 'number'], ['grape', 'text'], ['color', 'text']]

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

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

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



Question: How many wines are produced at Robert Biale winery?
SQL: SELECT count(*) FROM WINE WHERE Winery  =  "Robert Biale"
-- Language PostgreSQL
        -- Tables: 
             -- Table: grapes 
columns : [['id', 'number'], ['grape', 'text'], ['color', 'text']]

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

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

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



Question: Count the number of wines produced at Robert Biale winery.
SQL: SELECT count(*) FROM WINE WHERE Winery  =  "Robert Biale"
-- Language PostgreSQL
        -- Tables: 
             -- Table: grapes 
columns : [['id', 'number'], ['grape', 'text'], ['color', 'text']]

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

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

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



Question: How many appelations are in Napa Country?
SQL: SELECT count(*) FROM APPELLATIONS WHERE County  =  "Napa"
-- Language PostgreSQL
        -- Tables: 
             -- Table: grapes 
columns : [['id', 'number'], ['grape', 'text'], ['color', 'text']]

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

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

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



Question: Count the number of appelations in Napa County.
SQL: SELECT count(*) FROM APPELLATIONS WHERE County  =  "Napa"
-- Language PostgreSQL
        -- Tables: 
             -- Table: grapes 
columns : [['id', 'number'], ['grape', 'text'], ['color', 'text']]

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

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

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



Question: Give me the average prices of wines that are produced by appelations in Sonoma County.
SQL: SELECT AVG(T2.Price) FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation  =  T2.Appelation WHERE T1.County  =  "Sonoma"
-- Language PostgreSQL
        -- Tables: 
             -- Table: grapes 
columns : [['id', 'number'], ['grape', 'text'], ['color', 'text']]

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

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

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



Question: What is the average price of wines produced in appelations in Sonoma County?
SQL: SELECT AVG(T2.Price) FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation  =  T2.Appelation WHERE T1.County  =  "Sonoma"
-- Language PostgreSQL
        -- Tables: 
             -- Table: grapes 
columns : [['id', 'number'], ['grape', 'text'], ['color', 'text']]

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

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

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



Question: What are the names and scores of wines that are made of white color grapes?
SQL: SELECT T2.Name ,   T2.Score FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape  =  T2.Grape WHERE T1.Color  =  "White"
-- Language PostgreSQL
        -- Tables: 
             -- Table: grapes 
columns : [['id', 'number'], ['grape', 'text'], ['color', 'text']]

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

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

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



Question: Give the names and scores of wines made from white grapes.
SQL: SELECT T2.Name ,   T2.Score FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape  =  T2.Grape WHERE T1.Color  =  "White"
-- Language PostgreSQL
        -- Tables: 
             -- Table: grapes 
columns : [['id', 'number'], ['grape', 'text'], ['color', 'text']]

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

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

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



Question: Find the maximum price of wins from the appelations in Central Coast area and produced before the year of 2005.
SQL: 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
-- Language PostgreSQL
        -- Tables: 
             -- Table: grapes 
columns : [['id', 'number'], ['grape', 'text'], ['color', 'text']]

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

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

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



Question: What is the maximum price of wines from the appelation in the Central Coast area, which was produced before 2005?
SQL: 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
-- Language PostgreSQL
        -- Tables: 
             -- Table: grapes 
columns : [['id', 'number'], ['grape', 'text'], ['color', 'text']]

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

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

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



Question: Find the the grape whose white color grapes are used to produce wines with scores higher than 90.
SQL: 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
-- Language PostgreSQL
        -- Tables: 
             -- Table: grapes 
columns : [['id', 'number'], ['grape', 'text'], ['color', 'text']]

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

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

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



Question: Find the white grape used to produce wines with scores above 90.
SQL: 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
-- Language PostgreSQL
        -- Tables: 
             -- Table: grapes 
columns : [['id', 'number'], ['grape', 'text'], ['color', 'text']]

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

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

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



Question: What are the wines that have prices higher than 50 and made of Red color grapes?
SQL: SELECT T2.Name FROM Grapes AS T1 JOIN WINE AS T2 ON T1.Grape  =  T2.Grape WHERE T1.Color  =  "Red" AND T2.price  >  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.



Question: What are the names of wines made from red grapes and with prices above 50?
SQL: SELECT T2.Name FROM Grapes AS T1 JOIN WINE AS T2 ON T1.Grape  =  T2.Grape WHERE T1.Color  =  "Red" AND T2.price  >  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.



Question: What are the wines that have prices lower than 50 and have appelations in Monterey county?
SQL: SELECT T2.Name FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation  =  T2.Appelation WHERE T1.County  =  "Monterey" AND T2.price  <  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.



Question: Give the neames of wines with prices below 50 and with appelations in Monterey county.
SQL: SELECT T2.Name FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation  =  T2.Appelation WHERE T1.County  =  "Monterey" AND T2.price  <  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.



Question: What are the numbers of wines for different grapes?
SQL: SELECT count(*) ,  Grape FROM WINE GROUP BY 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.



Question: How many wines are there for each grape?
SQL: SELECT count(*) ,  Grape FROM WINE GROUP BY 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.



Question: What are the average prices of wines for different years?
SQL: SELECT avg(Price) ,  YEAR FROM WINE GROUP 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.



Question: What is the average prices of wines for each each?
SQL: SELECT avg(Price) ,  YEAR FROM WINE GROUP 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.



Question: Find the distinct names of all wines that have prices higher than some wines from John Anthony winery.
SQL: SELECT DISTINCT Name FROM WINE WHERE Price  >  (SELECT min(Price) FROM wine WHERE Winery  =  "John Anthony")
-- Language PostgreSQL
        -- Tables: 
             -- Table: grapes 
columns : [['id', 'number'], ['grape', 'text'], ['color', 'text']]

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

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

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



Question: What are the distinct names of wines with prices higher than any wine from John Anthony winery.
SQL: SELECT DISTINCT Name FROM WINE WHERE Price  >  (SELECT min(Price) FROM wine WHERE Winery  =  "John Anthony")
-- Language PostgreSQL
        -- Tables: 
             -- Table: grapes 
columns : [['id', 'number'], ['grape', 'text'], ['color', 'text']]

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

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

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



Question: List the names of all distinct wines in alphabetical order.
SQL: SELECT DISTINCT Name FROM WINE ORDER 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.



Question: What are the names of wines, sorted in alphabetical order?
SQL: SELECT DISTINCT Name FROM WINE ORDER 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.



Question: List the names of all distinct wines ordered by price.
SQL: SELECT DISTINCT Name FROM WINE ORDER 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.



Question: What are the names of wines, sorted by price ascending?
SQL: SELECT DISTINCT Name FROM WINE ORDER 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.



Question: What is the area of the appelation that produces the highest number of wines before the year of 2010?
SQL: 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
-- Language PostgreSQL
        -- Tables: 
             -- Table: grapes 
columns : [['id', 'number'], ['grape', 'text'], ['color', 'text']]

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

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

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



Question: What is the area for the appelation which produced the most wines prior to 2010?
SQL: 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
-- Language PostgreSQL
        -- Tables: 
             -- Table: grapes 
columns : [['id', 'number'], ['grape', 'text'], ['color', 'text']]

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

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

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



Question: What is the color of the grape whose wine products has the highest average price?
SQL: 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
-- Language PostgreSQL
        -- Tables: 
             -- Table: grapes 
columns : [['id', 'number'], ['grape', 'text'], ['color', 'text']]

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

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

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



Question: Give the color of the grape whose wine products have the highest average price?
SQL: 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
-- Language PostgreSQL
        -- Tables: 
             -- Table: grapes 
columns : [['id', 'number'], ['grape', 'text'], ['color', 'text']]

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

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

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



Question: Find the distinct names of wines produced before the year of 2000 or after the year of 2010.
SQL: SELECT DISTINCT Name FROM WINE WHERE YEAR  <  2000 OR YEAR  >  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.



Question: Give the distinct names of wines made before 2000 or after 2010.
SQL: SELECT DISTINCT Name FROM WINE WHERE YEAR  <  2000 OR YEAR  >  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.



Question: Find the distinct winery of wines having price between 50 and 100.
SQL: SELECT DISTINCT Winery FROM WINE WHERE 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.



Question: What are the distinct wineries which produce wines costing between 50 and 100?
SQL: SELECT DISTINCT Winery FROM WINE WHERE 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.



Question: What are the average prices and cases of wines produced in the year of 2009 and made of Zinfandel grape?
SQL: SELECT AVG(Price) ,  AVG(Cases) FROM WINE WHERE YEAR  =  2009 AND Grape  =  "Zinfandel"
-- Language PostgreSQL
        -- Tables: 
             -- Table: grapes 
columns : [['id', 'number'], ['grape', 'text'], ['color', 'text']]

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

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

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



Question: Give the average price and case of wines made from Zinfandel grapes in the year 2009.
SQL: SELECT AVG(Price) ,  AVG(Cases) FROM WINE WHERE YEAR  =  2009 AND Grape  =  "Zinfandel"
-- Language PostgreSQL
        -- Tables: 
             -- Table: grapes 
columns : [['id', 'number'], ['grape', 'text'], ['color', 'text']]

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

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

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



Question: What are the maximum price and score of wines produced by St. Helena appelation?
SQL: SELECT max(Price) ,  max(Score) FROM WINE WHERE 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.



Question: Give the maximum price and score for wines produced in the appelation St. Helena.
SQL: SELECT max(Price) ,  max(Score) FROM WINE WHERE 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.



Question: What are the maximum price and score of wines in each year?
SQL: SELECT max(Price) ,  max(Score) ,  YEAR FROM WINE GROUP 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.



Question: What are the maximum price and score of wines for each year?
SQL: SELECT max(Price) ,  max(Score) ,  YEAR FROM WINE GROUP BY YEAR