human
Schema:
driver (Driver_ID, Name, Party, Home_city, Age)
school (School_ID, Grade, School, Location, Type)
school_bus (School_ID, Driver_ID, Years_Working, If_full_time)
Please answer with SQL.
assistant
Sure, I understand.
human
How many different parties are there?
assistant
SELECT COUNT( DISTINCT party ) FROM driver;
human
How many drivers are from Hartford?
assistant
SELECT COUNT( * ) FROM driver WHERE home_city = 'Hartford';
human
Among these drivers, how many of them are older than 40?
assistant
SELECT COUNT( * ) FROM driver WHERE home_city = "Hartford" AND age > 40 ;