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 appelations that produce wines after the year of 2008 but not in Central Coast area.
assistant
SELECT Appelation FROM WINE WHERE YEAR > 2008 EXCEPT SELECT Appelation FROM APPELLATIONS WHERE Area = 'Central Coast'
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
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
Find the names of all wines produced in 2008.
assistant
SELECT Name FROM WINE WHERE YEAR = '2008'
human
Find the distinct names of wines produced before the year of 2000 or after the year of 2010.
assistant
SELECT DISTINCT Name FROM WINE WHERE YEAR < 2000 OR YEAR > 2010 ;