For each id of a driver who participated in at most 30 races, how many races did they participate in?
select t1.driverid, count(*) from drivers as t1 join results as t2 on t1.driverid = t2.driverid join races as t3 on t2.raceid = t3.raceid group by t1.driverid having count(*) <= 30