human
Schema:
race (Race_ID, Name, Class, Date, Track_ID)
track (Track_ID, Name, Location, Seating, Year_Opened)
Please answer with SQL.
assistant
Sure, I understand.
human
For each class, show the number of races for each.
assistant
SELECT CLASS , COUNT( * ) FROM race GROUP BY CLASS;
human
Which race classes have more than 3 races?
assistant
SELECT CLASS FROM race GROUP BY CLASS HAVING COUNT( * ) > 3;
human
What about at least two?
assistant
SELECT CLASS FROM race GROUP BY CLASS HAVING COUNT( * ) >= 2 ;