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 numbers of wines for different grapes?
assistant
SELECT count(*) , Grape FROM WINE GROUP BY Grape
human
List the names of all distinct wines that are made of red color grape.
assistant
SELECT DISTINCT T2.Name FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = 'Red'
human
List the names of all distinct wines ordered by price.
assistant
SELECT DISTINCT Name FROM WINE ORDER BY price
human
List the names of all distinct wines in alphabetical order.
assistant
SELECT DISTINCT Name FROM WINE ORDER BY Name
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 ;