CREATE TABLE pitstops (driverid VARCHAR2)
CREATE TABLE results (driverid VARCHAR2)
CREATE TABLE drivers (surname VARCHAR2, driverid VARCHAR2)

What are the drivers' last names and id who had 11 pit stops and participated in more than 5 race results?
SELECT T1.surname, T1.driverid FROM drivers AS T1 JOIN pitstops AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING COUNT(*) = 11 INTERSECT SELECT T1.surname, T1.driverid FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING COUNT(*) > 5
SELECT "T1"."surname", "T1"."driverid" FROM "drivers" "T1" JOIN "pitstops" "T2" ON "T1"."driverid" = "T2"."driverid" GROUP BY "T1"."driverid" HAVING COUNT(*) = 11 INTERSECT SELECT "T1"."surname", "T1"."driverid" FROM "drivers" "T1" JOIN "results" "T2" ON "T1"."driverid" = "T2"."driverid" GROUP BY "T1"."driverid" HAVING COUNT(*) > 5