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 names of wines that are more expensive then all wines made in the year 2006?
assistant
SELECT Name FROM WINE WHERE Price > (SELECT max(Price) FROM WINE WHERE YEAR = 2006)
human
What are the names and scores of wines that are made of white color grapes?
assistant
SELECT T2.Name , T2.Score FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = 'White'
human
List the names and scores of all wines.
assistant
SELECT Name , Score FROM WINE
human
List the grapes and appelations of all wines.
assistant
SELECT Grape , Appelation FROM WINE
human
Find the wineries that have at least four wines.
assistant
SELECT Winery FROM WINE GROUP BY Winery HAVING count(*) >= 4
human
How many wines are there for each grape?
assistant
SELECT COUNT( * ) , Grape FROM WINE GROUP BY Grape ;