In: Computer Science
Given aircraft (ano ,amodel, mfgYr) fleet ( fno, src
,dest, ano ,pno ) pilot (pno, pname, gender)
write relational alzebra query for the following
1. find those pnames who havent taken a fleet
2. retreive the fno ,amodel that the pilot has named 'abc' flew
1. Retrieve pname of pilots,who havent taken a fleet.
STRUCTURED QUERY : | SELECT pilot.pname FROM pilot WHERE pilot.pno NOT IN (SELECT fleet.pno FROM fleet); |
RELATIONAL ALGEBRA QUERY : | ![]() ![]() ![]() |
2. Retrieve fno, amodel that the pilot has named "abc" flew.
STRUCTURED QUERY : | SELECT fleet.fno FROM fleet INNER JOIN pilot ON fleet.pno=pilot.pno WHERE pilot.pname="abc" AND pilot.ano IN ( SELECT aircraft.ano,aircraft.amodel FROM aircraft INNER JOIN fleet ON aircraft.ano=fleet.ano); |
RELATIONAL ALGEBRA QUERY : |
[ ((fleet) |