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 is the average price of all wine products?
assistant
SELECT AVG ( Price ) FROM wine;
human
Which wine product has the highest price?
assistant
SELECT * FROM wine WHERE price = ( SELECT MAX( price ) FROM wine );
human
Which wine products have the highest average price? | Do you mean which grape whose wine products has the highest average price? | Yes, Which grapes are in the wine products that have the highest average price?
assistant
SELECT T1.grape FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape GROUP BY T2.Grape ORDER BY AVG ( Price ) DESC LIMIT 1;
human
What is the average price of the products that Roussanne is in?
assistant
SELECT AVG ( price ) FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape GROUP BY T2.Grape ORDER BY AVG ( Price ) DESC LIMIT 1;
human
What color of grape is Roussanne?
assistant
SELECT color FROM grapes WHERE grape = "Roussanne" ;