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
List the names of all distinct wines that have scores higher than 90.
assistant
SELECT Name FROM WINE WHERE score > 90
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 of all distinct wines ordered by price.
assistant
SELECT DISTINCT Name FROM WINE ORDER BY price
human
Find the distinct winery of wines having price between 50 and 100.
assistant
SELECT DISTINCT Winery FROM WINE WHERE Price BETWEEN 50 AND 100
human
List the grape, winery and year of the wines whose price is bigger than 100 ordered by year.
assistant
SELECT Grape , Winery , YEAR FROM WINE WHERE Price > 100 ORDER BY YEAR ;