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
What are the names of wines whose production year are before the year of all wines by Brander winery?
assistant
SELECT Name FROM WINE WHERE YEAR < (SELECT min(YEAR) FROM WINE WHERE Winery = 'Brander')
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 names and scores of all wines.
assistant
SELECT Name , Score FROM WINE
human
List the names of all distinct wines ordered by price.
assistant
SELECT DISTINCT Name FROM WINE ORDER BY price
human
What are the names of wines, sorted in alphabetical order?
assistant
SELECT DISTINCT Name FROM WINE ORDER BY Name ;