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 kinds of grapes are white?
assistant
SELECT Grape FROM GRAPES WHERE Color = 'White';
human
List all the wines that use color white grapes. | What kinds of attributes of wines do you want? | List wines made with white grapes.
assistant
SELECT * FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = 'White';
human
Excellent. What is their average score?
assistant
SELECT AVG ( score ) FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = 'White';
human
What is the average score of wines not made with white grapes?
assistant
SELECT AVG ( score ) FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color ! = 'White';
human
List only the names and scores of wines made with white grapes.
assistant
SELECT T2.Name , T2.Score FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = "White" ;