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
Show all the classes from the race.
assistant
SELECT * FROM race;
human
For each class, show the number of races for each.
assistant
SELECT CLASS , COUNT( * ) FROM race GROUP BY CLASS;
human
How many are there for the class 'GT'?
assistant
SELECT CLASS , COUNT( * ) FROM race GROUP BY CLASS having class = 'GT';
human
Which one has the most number of races?
assistant
SELECT CLASS FROM race GROUP BY CLASS ORDER BY COUNT( * ) DESC LIMIT 1 ;