human
Schema:
grapes (ID, Grape, Color)
appellations (No, Appelation, County, State, Area, isAVA)
wine (No, Grape, Winery, Appelation, State, Name, Year, Price, Score, Cases, Drink)
Please answer with SQL.
assistant
Sure, I understand.
human
What are the prices of wines produced before the year of 2010?
assistant
SELECT Price FROM WINE WHERE YEAR < 2010
human
Which winery is the wine that has the highest score from?
assistant
SELECT Winery FROM WINE ORDER BY SCORE LIMIT 1
human
List the names and scores of all wines.
assistant
SELECT Name , Score FROM WINE
human
What are the average price and score of wines grouped by appelation?
assistant
SELECT avg(Price) , avg(Score) , Appelation FROM WINE GROUP BY Appelation
human
What are the maximum price and score of wines in each year?
assistant
SELECT max(Price) , max(Score) , YEAR FROM WINE GROUP BY YEAR
human
Give the maximum price and score for wines produced in the appelation St. Helena.
assistant
SELECT MAX( Price ) , MAX( Score ) FROM WINE WHERE Appelation = "St. Helena" ;