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
Which appelation produces the most expensive wine?
assistant
SELECT T1.appelation FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T2.price = ( SELECT MAX( price ) FROM wine );
human
How much is the most expensive wine produced in Sonoma County?
assistant
SELECT MAX( T2.Price ) FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = 'Sonoma';
human
How many wines are produced in Sonoma County?
assistant
SELECT COUNT( * ) FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = 'Sonoma';
human
What is the price of the least expensive wine produced in Sonoma County?
assistant
SELECT MIN( T2.Price ) FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = "Sonoma" ;