CREATE TABLE aircraft (aid NUMBER, name CLOB, distance NUMBER)
CREATE TABLE flight (flno NUMBER, origin CLOB, destination CLOB, distance NUMBER, departure_date TIME, arrival_date TIME, price NUMBER, aid NUMBER)
CREATE TABLE employee (eid NUMBER, name CLOB, salary NUMBER)
CREATE TABLE certificate (eid NUMBER, aid NUMBER)

What is the name and distance of every aircraft that can cover a distance of more than 5000 and which at least 5 people can fly?
SELECT T2.name FROM certificate AS T1 JOIN aircraft AS T2 ON T2.aid = T1.aid WHERE T2.distance > 5000 GROUP BY T1.aid ORDER BY COUNT(*) >= 5
SELECT "T2"."name" FROM "certificate" "T1" JOIN "aircraft" "T2" ON "T1"."aid" = "T2"."aid" AND "T2"."distance" > 5000 GROUP BY "T1"."aid" ORDER BY COUNT(*) >= 5