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

Show names for all employees who have certificates on both Boeing 737-800 and Airbus A340-300.
SELECT T1.name FROM employee AS T1 JOIN certificate AS T2 ON T1.eid = T2.eid JOIN aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Boeing 737-800" INTERSECT SELECT T1.name FROM employee AS T1 JOIN certificate AS T2 ON T1.eid = T2.eid JOIN aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Airbus A340-300"
SELECT "T1"."name" FROM "employee" AS "T1" JOIN "certificate" AS "T2" ON "T1"."eid" = "T2"."eid" JOIN "aircraft" AS "T3" ON "Boeing 737-800" = "T3"."name" AND "T2"."aid" = "T3"."aid" INTERSECT SELECT "T1"."name" FROM "employee" AS "T1" JOIN "certificate" AS "T2" ON "T1"."eid" = "T2"."eid" JOIN "aircraft" AS "T3" ON "Airbus A340-300" = "T3"."name" AND "T2"."aid" = "T3"."aid"