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 names of all wines produced in 2008.
assistant
SELECT Name FROM WINE WHERE YEAR = '2008'
human
List the grapes and appelations of all wines.
assistant
SELECT Grape , Appelation FROM WINE
human
Find the distinct names of all wines that have prices higher than some wines from John Anthony winery.
assistant
SELECT DISTINCT Name FROM WINE WHERE Price > (SELECT min(Price) FROM wine WHERE Winery = 'John Anthony')
human
List the names and scores of all wines.
assistant
SELECT Name , Score FROM WINE
human
List the names of all distinct wines in alphabetical order.
assistant
SELECT DISTINCT Name FROM WINE ORDER BY Name
human
List the names of all distinct wines ordered by price.
assistant
SELECT DISTINCT Name FROM WINE ORDER BY price ;