db_id
stringclasses
146 values
question
stringlengths
3
224
sql
stringlengths
18
577
database_schema
stringclasses
146 values
scientist_1
What are the names of the scientists, and how many projects are each of them working on?
SELECT count(*) , T1.name FROM scientists AS T1 JOIN assignedto AS T2 ON T1.ssn = T2.scientist GROUP BY T1.name
CREATE TABLE Scientists ( SSN int, Name Char(30) not null, Primary Key (SSN) ) 3 rows from Scientists table: SSN Name 123234877 Michael Rogers 152934485 Anand Manikutty 222364883 Carol Smith CREATE TABLE Projects ( Code Char(4), Name Char(50) not null, Hours int, Primary Key (Code) ) 3 rows from Projects table: Code Name Hours AeH1 Winds: Studying Bernoullis Principle 156 AeH2 Aerodynamics and Bridge Design 189 AeH3 Aerodynamics and Gas Mileage 256 CREATE TABLE AssignedTo ( Scientist int not null, Project char(4) not null, Primary Key (Scientist, Project), Foreign Key (Scientist) references Scientists (SSN), Foreign Key (Project) references Projects (Code) ) 3 rows from AssignedTo table: Scientist Project 123234877 AeH1 152934485 AeH3 222364883 Ast3
scientist_1
Find the SSN and name of scientists who are assigned to the project with the longest hours.
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)
CREATE TABLE Scientists ( SSN int, Name Char(30) not null, Primary Key (SSN) ) 3 rows from Scientists table: SSN Name 123234877 Michael Rogers 152934485 Anand Manikutty 222364883 Carol Smith CREATE TABLE Projects ( Code Char(4), Name Char(50) not null, Hours int, Primary Key (Code) ) 3 rows from Projects table: Code Name Hours AeH1 Winds: Studying Bernoullis Principle 156 AeH2 Aerodynamics and Bridge Design 189 AeH3 Aerodynamics and Gas Mileage 256 CREATE TABLE AssignedTo ( Scientist int not null, Project char(4) not null, Primary Key (Scientist, Project), Foreign Key (Scientist) references Scientists (SSN), Foreign Key (Project) references Projects (Code) ) 3 rows from AssignedTo table: Scientist Project 123234877 AeH1 152934485 AeH3 222364883 Ast3
scientist_1
What are the SSN and names of scientists working on the project with the most hours?
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)
CREATE TABLE Scientists ( SSN int, Name Char(30) not null, Primary Key (SSN) ) 3 rows from Scientists table: SSN Name 123234877 Michael Rogers 152934485 Anand Manikutty 222364883 Carol Smith CREATE TABLE Projects ( Code Char(4), Name Char(50) not null, Hours int, Primary Key (Code) ) 3 rows from Projects table: Code Name Hours AeH1 Winds: Studying Bernoullis Principle 156 AeH2 Aerodynamics and Bridge Design 189 AeH3 Aerodynamics and Gas Mileage 256 CREATE TABLE AssignedTo ( Scientist int not null, Project char(4) not null, Primary Key (Scientist, Project), Foreign Key (Scientist) references Scientists (SSN), Foreign Key (Project) references Projects (Code) ) 3 rows from AssignedTo table: Scientist Project 123234877 AeH1 152934485 AeH3 222364883 Ast3
scientist_1
Find the name of scientists who are assigned to some project.
SELECT T2.name FROM assignedto AS T1 JOIN scientists AS T2 ON T1.scientist = T2.ssn
CREATE TABLE Scientists ( SSN int, Name Char(30) not null, Primary Key (SSN) ) 3 rows from Scientists table: SSN Name 123234877 Michael Rogers 152934485 Anand Manikutty 222364883 Carol Smith CREATE TABLE Projects ( Code Char(4), Name Char(50) not null, Hours int, Primary Key (Code) ) 3 rows from Projects table: Code Name Hours AeH1 Winds: Studying Bernoullis Principle 156 AeH2 Aerodynamics and Bridge Design 189 AeH3 Aerodynamics and Gas Mileage 256 CREATE TABLE AssignedTo ( Scientist int not null, Project char(4) not null, Primary Key (Scientist, Project), Foreign Key (Scientist) references Scientists (SSN), Foreign Key (Project) references Projects (Code) ) 3 rows from AssignedTo table: Scientist Project 123234877 AeH1 152934485 AeH3 222364883 Ast3
scientist_1
What are the names of scientists who are assigned to any project?
SELECT T2.name FROM assignedto AS T1 JOIN scientists AS T2 ON T1.scientist = T2.ssn
CREATE TABLE Scientists ( SSN int, Name Char(30) not null, Primary Key (SSN) ) 3 rows from Scientists table: SSN Name 123234877 Michael Rogers 152934485 Anand Manikutty 222364883 Carol Smith CREATE TABLE Projects ( Code Char(4), Name Char(50) not null, Hours int, Primary Key (Code) ) 3 rows from Projects table: Code Name Hours AeH1 Winds: Studying Bernoullis Principle 156 AeH2 Aerodynamics and Bridge Design 189 AeH3 Aerodynamics and Gas Mileage 256 CREATE TABLE AssignedTo ( Scientist int not null, Project char(4) not null, Primary Key (Scientist, Project), Foreign Key (Scientist) references Scientists (SSN), Foreign Key (Project) references Projects (Code) ) 3 rows from AssignedTo table: Scientist Project 123234877 AeH1 152934485 AeH3 222364883 Ast3
scientist_1
Select the project names which are not assigned yet.
SELECT Name FROM Projects WHERE Code NOT IN (SELECT Project FROM AssignedTo)
CREATE TABLE Scientists ( SSN int, Name Char(30) not null, Primary Key (SSN) ) 3 rows from Scientists table: SSN Name 123234877 Michael Rogers 152934485 Anand Manikutty 222364883 Carol Smith CREATE TABLE Projects ( Code Char(4), Name Char(50) not null, Hours int, Primary Key (Code) ) 3 rows from Projects table: Code Name Hours AeH1 Winds: Studying Bernoullis Principle 156 AeH2 Aerodynamics and Bridge Design 189 AeH3 Aerodynamics and Gas Mileage 256 CREATE TABLE AssignedTo ( Scientist int not null, Project char(4) not null, Primary Key (Scientist, Project), Foreign Key (Scientist) references Scientists (SSN), Foreign Key (Project) references Projects (Code) ) 3 rows from AssignedTo table: Scientist Project 123234877 AeH1 152934485 AeH3 222364883 Ast3
scientist_1
What are the names of projects that have not been assigned?
SELECT Name FROM Projects WHERE Code NOT IN (SELECT Project FROM AssignedTo)
CREATE TABLE Scientists ( SSN int, Name Char(30) not null, Primary Key (SSN) ) 3 rows from Scientists table: SSN Name 123234877 Michael Rogers 152934485 Anand Manikutty 222364883 Carol Smith CREATE TABLE Projects ( Code Char(4), Name Char(50) not null, Hours int, Primary Key (Code) ) 3 rows from Projects table: Code Name Hours AeH1 Winds: Studying Bernoullis Principle 156 AeH2 Aerodynamics and Bridge Design 189 AeH3 Aerodynamics and Gas Mileage 256 CREATE TABLE AssignedTo ( Scientist int not null, Project char(4) not null, Primary Key (Scientist, Project), Foreign Key (Scientist) references Scientists (SSN), Foreign Key (Project) references Projects (Code) ) 3 rows from AssignedTo table: Scientist Project 123234877 AeH1 152934485 AeH3 222364883 Ast3
scientist_1
Find the name of scientists who are not assigned to any project.
SELECT Name FROM scientists WHERE ssn NOT IN (SELECT scientist FROM AssignedTo)
CREATE TABLE Scientists ( SSN int, Name Char(30) not null, Primary Key (SSN) ) 3 rows from Scientists table: SSN Name 123234877 Michael Rogers 152934485 Anand Manikutty 222364883 Carol Smith CREATE TABLE Projects ( Code Char(4), Name Char(50) not null, Hours int, Primary Key (Code) ) 3 rows from Projects table: Code Name Hours AeH1 Winds: Studying Bernoullis Principle 156 AeH2 Aerodynamics and Bridge Design 189 AeH3 Aerodynamics and Gas Mileage 256 CREATE TABLE AssignedTo ( Scientist int not null, Project char(4) not null, Primary Key (Scientist, Project), Foreign Key (Scientist) references Scientists (SSN), Foreign Key (Project) references Projects (Code) ) 3 rows from AssignedTo table: Scientist Project 123234877 AeH1 152934485 AeH3 222364883 Ast3
scientist_1
What are the names of scientists who have not been assigned a project?
SELECT Name FROM scientists WHERE ssn NOT IN (SELECT scientist FROM AssignedTo)
CREATE TABLE Scientists ( SSN int, Name Char(30) not null, Primary Key (SSN) ) 3 rows from Scientists table: SSN Name 123234877 Michael Rogers 152934485 Anand Manikutty 222364883 Carol Smith CREATE TABLE Projects ( Code Char(4), Name Char(50) not null, Hours int, Primary Key (Code) ) 3 rows from Projects table: Code Name Hours AeH1 Winds: Studying Bernoullis Principle 156 AeH2 Aerodynamics and Bridge Design 189 AeH3 Aerodynamics and Gas Mileage 256 CREATE TABLE AssignedTo ( Scientist int not null, Project char(4) not null, Primary Key (Scientist, Project), Foreign Key (Scientist) references Scientists (SSN), Foreign Key (Project) references Projects (Code) ) 3 rows from AssignedTo table: Scientist Project 123234877 AeH1 152934485 AeH3 222364883 Ast3
scientist_1
Find the number of scientists who are not assigned to any project.
SELECT count(*) FROM scientists WHERE ssn NOT IN (SELECT scientist FROM AssignedTo)
CREATE TABLE Scientists ( SSN int, Name Char(30) not null, Primary Key (SSN) ) 3 rows from Scientists table: SSN Name 123234877 Michael Rogers 152934485 Anand Manikutty 222364883 Carol Smith CREATE TABLE Projects ( Code Char(4), Name Char(50) not null, Hours int, Primary Key (Code) ) 3 rows from Projects table: Code Name Hours AeH1 Winds: Studying Bernoullis Principle 156 AeH2 Aerodynamics and Bridge Design 189 AeH3 Aerodynamics and Gas Mileage 256 CREATE TABLE AssignedTo ( Scientist int not null, Project char(4) not null, Primary Key (Scientist, Project), Foreign Key (Scientist) references Scientists (SSN), Foreign Key (Project) references Projects (Code) ) 3 rows from AssignedTo table: Scientist Project 123234877 AeH1 152934485 AeH3 222364883 Ast3
scientist_1
How many scientists do not have any projects assigned to them?
SELECT count(*) FROM scientists WHERE ssn NOT IN (SELECT scientist FROM AssignedTo)
CREATE TABLE Scientists ( SSN int, Name Char(30) not null, Primary Key (SSN) ) 3 rows from Scientists table: SSN Name 123234877 Michael Rogers 152934485 Anand Manikutty 222364883 Carol Smith CREATE TABLE Projects ( Code Char(4), Name Char(50) not null, Hours int, Primary Key (Code) ) 3 rows from Projects table: Code Name Hours AeH1 Winds: Studying Bernoullis Principle 156 AeH2 Aerodynamics and Bridge Design 189 AeH3 Aerodynamics and Gas Mileage 256 CREATE TABLE AssignedTo ( Scientist int not null, Project char(4) not null, Primary Key (Scientist, Project), Foreign Key (Scientist) references Scientists (SSN), Foreign Key (Project) references Projects (Code) ) 3 rows from AssignedTo table: Scientist Project 123234877 AeH1 152934485 AeH3 222364883 Ast3
scientist_1
Find the names of scientists who are not working on the project with the highest hours.
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)
CREATE TABLE Scientists ( SSN int, Name Char(30) not null, Primary Key (SSN) ) 3 rows from Scientists table: SSN Name 123234877 Michael Rogers 152934485 Anand Manikutty 222364883 Carol Smith CREATE TABLE Projects ( Code Char(4), Name Char(50) not null, Hours int, Primary Key (Code) ) 3 rows from Projects table: Code Name Hours AeH1 Winds: Studying Bernoullis Principle 156 AeH2 Aerodynamics and Bridge Design 189 AeH3 Aerodynamics and Gas Mileage 256 CREATE TABLE AssignedTo ( Scientist int not null, Project char(4) not null, Primary Key (Scientist, Project), Foreign Key (Scientist) references Scientists (SSN), Foreign Key (Project) references Projects (Code) ) 3 rows from AssignedTo table: Scientist Project 123234877 AeH1 152934485 AeH3 222364883 Ast3
scientist_1
What are the names of scientists who are not working on the project with the most hours?
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)
CREATE TABLE Scientists ( SSN int, Name Char(30) not null, Primary Key (SSN) ) 3 rows from Scientists table: SSN Name 123234877 Michael Rogers 152934485 Anand Manikutty 222364883 Carol Smith CREATE TABLE Projects ( Code Char(4), Name Char(50) not null, Hours int, Primary Key (Code) ) 3 rows from Projects table: Code Name Hours AeH1 Winds: Studying Bernoullis Principle 156 AeH2 Aerodynamics and Bridge Design 189 AeH3 Aerodynamics and Gas Mileage 256 CREATE TABLE AssignedTo ( Scientist int not null, Project char(4) not null, Primary Key (Scientist, Project), Foreign Key (Scientist) references Scientists (SSN), Foreign Key (Project) references Projects (Code) ) 3 rows from AssignedTo table: Scientist Project 123234877 AeH1 152934485 AeH3 222364883 Ast3
scientist_1
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.
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
CREATE TABLE Scientists ( SSN int, Name Char(30) not null, Primary Key (SSN) ) 3 rows from Scientists table: SSN Name 123234877 Michael Rogers 152934485 Anand Manikutty 222364883 Carol Smith CREATE TABLE Projects ( Code Char(4), Name Char(50) not null, Hours int, Primary Key (Code) ) 3 rows from Projects table: Code Name Hours AeH1 Winds: Studying Bernoullis Principle 156 AeH2 Aerodynamics and Bridge Design 189 AeH3 Aerodynamics and Gas Mileage 256 CREATE TABLE AssignedTo ( Scientist int not null, Project char(4) not null, Primary Key (Scientist, Project), Foreign Key (Scientist) references Scientists (SSN), Foreign Key (Project) references Projects (Code) ) 3 rows from AssignedTo table: Scientist Project 123234877 AeH1 152934485 AeH3 222364883 Ast3
scientist_1
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.
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
CREATE TABLE Scientists ( SSN int, Name Char(30) not null, Primary Key (SSN) ) 3 rows from Scientists table: SSN Name 123234877 Michael Rogers 152934485 Anand Manikutty 222364883 Carol Smith CREATE TABLE Projects ( Code Char(4), Name Char(50) not null, Hours int, Primary Key (Code) ) 3 rows from Projects table: Code Name Hours AeH1 Winds: Studying Bernoullis Principle 156 AeH2 Aerodynamics and Bridge Design 189 AeH3 Aerodynamics and Gas Mileage 256 CREATE TABLE AssignedTo ( Scientist int not null, Project char(4) not null, Primary Key (Scientist, Project), Foreign Key (Scientist) references Scientists (SSN), Foreign Key (Project) references Projects (Code) ) 3 rows from AssignedTo table: Scientist Project 123234877 AeH1 152934485 AeH3 222364883 Ast3
scientist_1
Find name of the project that needs the least amount of time to finish and the name of scientists who worked on it.
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)
CREATE TABLE Scientists ( SSN int, Name Char(30) not null, Primary Key (SSN) ) 3 rows from Scientists table: SSN Name 123234877 Michael Rogers 152934485 Anand Manikutty 222364883 Carol Smith CREATE TABLE Projects ( Code Char(4), Name Char(50) not null, Hours int, Primary Key (Code) ) 3 rows from Projects table: Code Name Hours AeH1 Winds: Studying Bernoullis Principle 156 AeH2 Aerodynamics and Bridge Design 189 AeH3 Aerodynamics and Gas Mileage 256 CREATE TABLE AssignedTo ( Scientist int not null, Project char(4) not null, Primary Key (Scientist, Project), Foreign Key (Scientist) references Scientists (SSN), Foreign Key (Project) references Projects (Code) ) 3 rows from AssignedTo table: Scientist Project 123234877 AeH1 152934485 AeH3 222364883 Ast3
scientist_1
What is the name of the project that requires the fewest number of hours, and the names of the scientists assigned to it?
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)
CREATE TABLE Scientists ( SSN int, Name Char(30) not null, Primary Key (SSN) ) 3 rows from Scientists table: SSN Name 123234877 Michael Rogers 152934485 Anand Manikutty 222364883 Carol Smith CREATE TABLE Projects ( Code Char(4), Name Char(50) not null, Hours int, Primary Key (Code) ) 3 rows from Projects table: Code Name Hours AeH1 Winds: Studying Bernoullis Principle 156 AeH2 Aerodynamics and Bridge Design 189 AeH3 Aerodynamics and Gas Mileage 256 CREATE TABLE AssignedTo ( Scientist int not null, Project char(4) not null, Primary Key (Scientist, Project), Foreign Key (Scientist) references Scientists (SSN), Foreign Key (Project) references Projects (Code) ) 3 rows from AssignedTo table: Scientist Project 123234877 AeH1 152934485 AeH3 222364883 Ast3
wine_1
What is the name of the highest rated wine?
SELECT Name FROM WINE ORDER BY Score LIMIT 1
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
Give the name of the wine with the highest score.
SELECT Name FROM WINE ORDER BY Score LIMIT 1
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
Which winery is the wine that has the highest score from?
SELECT Winery FROM WINE ORDER BY SCORE LIMIT 1
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
What is the winery at which the wine with the highest score was made?
SELECT Winery FROM WINE ORDER BY SCORE LIMIT 1
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
Find the names of all wines produced in 2008.
SELECT Name FROM WINE WHERE YEAR = "2008"
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
What are the names of all wines produced in 2008?
SELECT Name FROM WINE WHERE YEAR = "2008"
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
List the grapes and appelations of all wines.
SELECT Grape , Appelation FROM WINE
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
What are the grapes and appelations of each wine?
SELECT Grape , Appelation FROM WINE
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
List the names and scores of all wines.
SELECT Name , Score FROM WINE
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
What are the names and scores of all wines?
SELECT Name , Score FROM WINE
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
List the area and county of all appelations.
SELECT Area , County FROM APPELLATIONS
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
What are the areas and counties for all appelations?
SELECT Area , County FROM APPELLATIONS
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
What are the prices of wines produced before the year of 2010?
SELECT Price FROM WINE WHERE YEAR < 2010
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
Return the prices of wines produced before 2010.
SELECT Price FROM WINE WHERE YEAR < 2010
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
List the names of all distinct wines that have scores higher than 90.
SELECT Name FROM WINE WHERE score > 90
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
What are the names of wines with scores higher than 90?
SELECT Name FROM WINE WHERE score > 90
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
List the names of all distinct wines that are made of red color grape.
SELECT DISTINCT T2.Name FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = "Red"
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
What are the names of wines made from red grapes?
SELECT DISTINCT T2.Name FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = "Red"
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
Find the names of all distinct wines that have appellations in North Coast area.
SELECT DISTINCT T2.Name FROM APPELLATIONs AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.Area = "North Coast"
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
What are the distinct names of wines that have appellations in the North Coast area?
SELECT DISTINCT T2.Name FROM APPELLATIONs AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.Area = "North Coast"
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
How many wines are produced at Robert Biale winery?
SELECT count(*) FROM WINE WHERE Winery = "Robert Biale"
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
Count the number of wines produced at Robert Biale winery.
SELECT count(*) FROM WINE WHERE Winery = "Robert Biale"
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
How many appelations are in Napa Country?
SELECT count(*) FROM APPELLATIONS WHERE County = "Napa"
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
Count the number of appelations in Napa County.
SELECT count(*) FROM APPELLATIONS WHERE County = "Napa"
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
Give me the average prices of wines that are produced by appelations in Sonoma County.
SELECT AVG(T2.Price) FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = "Sonoma"
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
What is the average price of wines produced in appelations in Sonoma County?
SELECT AVG(T2.Price) FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = "Sonoma"
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
What are the names and scores of wines that are made of white color grapes?
SELECT T2.Name , T2.Score FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = "White"
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
Give the names and scores of wines made from white grapes.
SELECT T2.Name , T2.Score FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = "White"
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
Find the maximum price of wins from the appelations in Central Coast area and produced before the year of 2005.
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
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
What is the maximum price of wines from the appelation in the Central Coast area, which was produced before 2005?
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
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
Find the the grape whose white color grapes are used to produce wines with scores higher than 90.
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
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
Find the white grape used to produce wines with scores above 90.
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
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
What are the wines that have prices higher than 50 and made of Red color grapes?
SELECT T2.Name FROM Grapes AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = "Red" AND T2.price > 50
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
What are the names of wines made from red grapes and with prices above 50?
SELECT T2.Name FROM Grapes AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = "Red" AND T2.price > 50
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
What are the wines that have prices lower than 50 and have appelations in Monterey county?
SELECT T2.Name FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = "Monterey" AND T2.price < 50
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
Give the neames of wines with prices below 50 and with appelations in Monterey county.
SELECT T2.Name FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = "Monterey" AND T2.price < 50
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
What are the numbers of wines for different grapes?
SELECT count(*) , Grape FROM WINE GROUP BY Grape
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
How many wines are there for each grape?
SELECT count(*) , Grape FROM WINE GROUP BY Grape
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
What are the average prices of wines for different years?
SELECT avg(Price) , YEAR FROM WINE GROUP BY YEAR
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
What is the average prices of wines for each each?
SELECT avg(Price) , YEAR FROM WINE GROUP BY YEAR
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
Find the distinct names of all wines that have prices higher than some wines from John Anthony winery.
SELECT DISTINCT Name FROM WINE WHERE Price > (SELECT min(Price) FROM wine WHERE Winery = "John Anthony")
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
What are the distinct names of wines with prices higher than any wine from John Anthony winery.
SELECT DISTINCT Name FROM WINE WHERE Price > (SELECT min(Price) FROM wine WHERE Winery = "John Anthony")
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
List the names of all distinct wines in alphabetical order.
SELECT DISTINCT Name FROM WINE ORDER BY Name
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
What are the names of wines, sorted in alphabetical order?
SELECT DISTINCT Name FROM WINE ORDER BY Name
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
List the names of all distinct wines ordered by price.
SELECT DISTINCT Name FROM WINE ORDER BY price
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
What are the names of wines, sorted by price ascending?
SELECT DISTINCT Name FROM WINE ORDER BY price
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
What is the area of the appelation that produces the highest number of wines before the year of 2010?
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
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
What is the area for the appelation which produced the most wines prior to 2010?
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
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
What is the color of the grape whose wine products has the highest average price?
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
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
Give the color of the grape whose wine products have the highest average price?
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
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
Find the distinct names of wines produced before the year of 2000 or after the year of 2010.
SELECT DISTINCT Name FROM WINE WHERE YEAR < 2000 OR YEAR > 2010
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
Give the distinct names of wines made before 2000 or after 2010.
SELECT DISTINCT Name FROM WINE WHERE YEAR < 2000 OR YEAR > 2010
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
Find the distinct winery of wines having price between 50 and 100.
SELECT DISTINCT Winery FROM WINE WHERE Price BETWEEN 50 AND 100
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
What are the distinct wineries which produce wines costing between 50 and 100?
SELECT DISTINCT Winery FROM WINE WHERE Price BETWEEN 50 AND 100
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
What are the average prices and cases of wines produced in the year of 2009 and made of Zinfandel grape?
SELECT AVG(Price) , AVG(Cases) FROM WINE WHERE YEAR = 2009 AND Grape = "Zinfandel"
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
Give the average price and case of wines made from Zinfandel grapes in the year 2009.
SELECT AVG(Price) , AVG(Cases) FROM WINE WHERE YEAR = 2009 AND Grape = "Zinfandel"
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
What are the maximum price and score of wines produced by St. Helena appelation?
SELECT max(Price) , max(Score) FROM WINE WHERE Appelation = "St. Helena"
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
Give the maximum price and score for wines produced in the appelation St. Helena.
SELECT max(Price) , max(Score) FROM WINE WHERE Appelation = "St. Helena"
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
What are the maximum price and score of wines in each year?
SELECT max(Price) , max(Score) , YEAR FROM WINE GROUP BY YEAR
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
What are the maximum price and score of wines for each year?
SELECT max(Price) , max(Score) , YEAR FROM WINE GROUP BY YEAR
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
What are the average price and score of wines grouped by appelation?
SELECT avg(Price) , avg(Score) , Appelation FROM WINE GROUP BY Appelation
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
What are the average price and score of wines for each appelation?
SELECT avg(Price) , avg(Score) , Appelation FROM WINE GROUP BY Appelation
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
Find the wineries that have at least four wines.
SELECT Winery FROM WINE GROUP BY Winery HAVING count(*) >= 4
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
Which wineries produce at least four wines?
SELECT Winery FROM WINE GROUP BY Winery HAVING count(*) >= 4
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
Find the country of all appelations who have at most three wines.
SELECT T1.County FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation GROUP BY T2.Appelation HAVING count(*) <= 3
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
What are the countries for appelations with at most 3 wines?
SELECT T1.County FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation GROUP BY T2.Appelation HAVING count(*) <= 3
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
What are the names of wines whose production year are before the year of all wines by Brander winery?
SELECT Name FROM WINE WHERE YEAR < (SELECT min(YEAR) FROM WINE WHERE Winery = "Brander")
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
What are the names of wines produced before any wine from the Brander winery?
SELECT Name FROM WINE WHERE YEAR < (SELECT min(YEAR) FROM WINE WHERE Winery = "Brander")
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
What are the names of wines that are more expensive then all wines made in the year 2006?
SELECT Name FROM WINE WHERE Price > (SELECT max(Price) FROM WINE WHERE YEAR = 2006)
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
Give the names of wines with prices above any wine produced in 2006.
SELECT Name FROM WINE WHERE Price > (SELECT max(Price) FROM WINE WHERE YEAR = 2006)
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
Find the top 3 wineries with the greatest number of wines made of white color grapes.
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
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
Which 3 wineries produce the most wines made from white grapes?
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
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
List the grape, winery and year of the wines whose price is bigger than 100 ordered by year.
SELECT Grape , Winery , YEAR FROM WINE WHERE Price > 100 ORDER BY YEAR
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
What are the grapes, wineries and years for wines with price higher than 100, sorted by year?
SELECT Grape , Winery , YEAR FROM WINE WHERE Price > 100 ORDER BY YEAR
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
List the grape, appelation and name of wines whose score is higher than 93 ordered by Name.
SELECT Grape , Appelation , Name FROM WINE WHERE Score > 93 ORDER BY Name
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
What are the grapes, appelations, and wines with scores above 93, sorted by Name?
SELECT Grape , Appelation , Name FROM WINE WHERE Score > 93 ORDER BY Name
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
Find the appelations that produce wines after the year of 2008 but not in Central Coast area.
SELECT Appelation FROM WINE WHERE YEAR > 2008 EXCEPT SELECT Appelation FROM APPELLATIONS WHERE Area = "Central Coast"
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
What are the appelations for wines produced after 2008 but not in the Central Coast area?
SELECT Appelation FROM WINE WHERE YEAR > 2008 EXCEPT SELECT Appelation FROM APPELLATIONS WHERE Area = "Central Coast"
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
Find the average price of wines that are not produced from Sonoma county.
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')
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
What is the average price for wines not produced in Sonoma county?
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')
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
Find the county where produces the most number of wines with score higher than 90.
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
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
wine_1
What is the county that produces the most wines scoring higher than 90?
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
CREATE TABLE "grapes" ( "ID" INTEGER PRIMARY KEY, "Grape" TEXT UNIQUE, "Color" TEXT ) 3 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red 3 Cabernet Sauvingnon Red CREATE TABLE "appellations" ( "No" INTEGER PRIMARY KEY, "Appelation" TEXT UNIQUE, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT ) 3 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No 3 Amador-Mendocino-Sonoma Counties N/A California N/A No CREATE TABLE "wine" ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY (Grape) REFERENCES grapes(Grape), FOREIGN KEY (Appelation) REFERENCES appellations(Appelation) ) 3 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now 3 Zinfandel Robert Biale Napa Valley California Black Chicken 2008 40 91 2700 2012
train_station
How many train stations are there?
SELECT count(*) FROM station
CREATE TABLE "station" ( "Station_ID" int, "Name" text, "Annual_entry_exit" real, "Annual_interchanges" real, "Total_Passengers" real, "Location" text, "Main_Services" text, "Number_of_Platforms" int, PRIMARY KEY ("Station_ID") ) 3 rows from station table: Station_ID Name Annual_entry_exit Annual_interchanges Total_Passengers Location Main_Services Number_of_Platforms 1 London Waterloo 94.046 9.489 103.534 London South Western Main Line West of England Main Line 19 2 London Victoria 76.231 9.157 85.380 London Brighton Main Line Chatham Main Line 19 3 London Bridge 52.634 8.742 61.376 London South Eastern Main Line Thameslink 12 CREATE TABLE "train" ( "Train_ID" int, "Name" text, "Time" text, "Service" text, PRIMARY KEY ("Train_ID") ) 3 rows from train table: Train_ID Name Time Service 1 Ananthapuri Express 17:15 Daily 2 Guruvayur Express 22:10 Daily 3 Guruvayur Express 4:49 Daily CREATE TABLE "train_station" ( "Train_ID" int, "Station_ID" int, PRIMARY KEY ("Train_ID","Station_ID"), FOREIGN KEY ("Train_ID") REFERENCES "train"("Train_ID"), FOREIGN KEY ("Station_ID") REFERENCES "station"("Station_ID") ) 3 rows from train_station table: Train_ID Station_ID 1 1 2 1 3 1