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
Find the top 3 wineries with the greatest number of wines made of white color grapes.
assistant
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
human
What are the numbers of wines for different grapes?
assistant
SELECT count(*) , Grape FROM WINE GROUP BY Grape
human
List the grape, appelation and name of wines whose score is higher than 93 ordered by Name.
assistant
SELECT Grape , Appelation , Name FROM WINE WHERE Score > 93 ORDER BY Name
human
List the grapes and appelations of all wines.
assistant
SELECT Grape , Appelation FROM WINE
human
List the names and scores of all wines.
assistant
SELECT Name , Score FROM WINE
human
Give the names and scores of wines made from white grapes.
assistant
SELECT T2.Name , T2.Score FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = "White" ;