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 are there?
assistant
SELECT COUNT( * ) FROM WINE;
human
how many of them have a price higher than 50?
assistant
SELECT COUNT( * ) FROM WINE WHERE price > 50;
human
find their names.
assistant
SELECT name FROM WINE WHERE price > 50;
human
which are made from red colored grapes?
assistant
SELECT T2.Name FROM Grapes AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = "Red" AND T2.price > 50 ;