For the relational algebra queries, you can cut and paste the following as needed into your answer: p subscript (A) σ subscript (A) A ⋈ subscript B ρ (A(1→stuff), B) A ∩ B A U B symbol subscript1 ≤ subscript2 ˄ subscript3 ≥ subscript4 ˅ subscript5 < > subscript6 Consider the following database schema: Flights(flno, from, to, distance) Aircraft(aid, aname, cruisingrange) Certified(eid, aid) Employees(eid, ename, salary) In the above schema, Employees describes all employees, while Certified represents the fact that a given employee is certified to fly a given aircraft. Thus, all employees who are pilots will be listed in Certified (and no other employees will). An aircraft is able to fly a given flight if the aircraft’s cruisingrange is at least as great as the flight’s distance. a) Express the following query in both (i) Relational Algebra and (ii) SQL: Find the departure airport (from) and arrival airport (to) of flights that are able to be flown by the aircraft with aid 777. b) Express the following query in Relational Algebra only: Find the eids of pilots who are certified to fly every aircraft. c) Express the following query in both (i) Relational Algebra and (ii) SQL: Find the aid and aname of the aircraft with the highest cruisingrange. d) Express the following query in Relational Algebra only: Find the aid and aname of aircraft for which no pilot is certified. e) Express the following query in SQL only: For each pilot (identified by eid), find the number of aircraft they are certified to fly.
For the relational algebra queries, you can cut and paste the following as needed into your answer:
p subscript (A) σ subscript (A) A ⋈ subscript B ρ (A(1→stuff), B) A ∩ B A U B
symbol subscript1 ≤ subscript2 ˄ subscript3 ≥ subscript4 ˅ subscript5 < > subscript6
Consider the following database schema:
Flights(flno, from, to, distance)
Aircraft(aid, aname, cruisingrange)
Certified(eid, aid)
Employees(eid, ename, salary)
In the above schema, Employees describes all employees, while Certified represents the fact that a given employee is certified to fly a given aircraft. Thus, all employees who are pilots will be listed in Certified (and no other employees will). An aircraft is able to fly a given flight if the aircraft’s cruisingrange is at least as great as the flight’s distance.
a) Express the following query in both (i) Relational Algebra and (ii) SQL:
Find the departure airport (from) and arrival airport (to) of flights that are able to be flown by the aircraft with aid 777.
b) Express the following query in Relational Algebra only:
Find the eids of pilots who are certified to fly every aircraft.
c) Express the following query in both (i) Relational Algebra and (ii) SQL:
Find the aid and aname of the aircraft with the highest cruisingrange.
d) Express the following query in Relational Algebra only:
Find the aid and aname of aircraft for which no pilot is certified.
e) Express the following query in SQL only:
For each pilot (identified by eid), find the number of aircraft they are certified to fly.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps