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
how many wines were produced before the year of 2010?
assistant
SELECT COUNT( * ) FROM WINE WHERE year < 2010;
human
which appellation produced the highest number of these?
assistant
SELECT Appelation FROM WINE WHERE year < 2010 GROUP BY Appelation ORDER BY COUNT( * ) DESC LIMIT 1;
human
What is the area where that appellation is from?
assistant
SELECT T1.Area FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation GROUP BY T2.Appelation HAVING T2.year < 2010 ORDER BY COUNT( * ) DESC LIMIT 1 ;