Show names for all employees.
select name from employee
Which of those have certificates on Boeing 737-800?
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"
How about those with certificates on 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 = "Airbus a340-300"
Who have both?
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"